[SERVER-10136] Passing impossible value to skip on aggregation framework causes mongo to exit with out of memory Created: 08/Jul/13 Updated: 11/Jul/16 Resolved: 22/Jul/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Stability |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | 2.5.2 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Chen Fisher | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 12.04 LTS, MongoDB 2.4.3 |
||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Steps To Reproduce: | send "aggregate" command with some $match and pass 4294967294 to $skip operator. mongo should immediately exit. 1. Did not try this with different number but I suspect big enough number would cause mongo to exit as well 2. Did not try this with "normal" query (non aggregation framework) |
||||||||||||
| Participants: | |||||||||||||
| Description |
|
When passing the following value to $skip on aggregation framework, mongo immediately exists with log message "out of memory" It appears mongo tries to allocate memory according to this number and fails with out of memory. In the log file: |
| Comments |
| Comment by auto [ 22/Jul/13 ] |
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: Add sort with large limit case to Crash reported in |
| Comment by Mathias Stearn [ 22/Jul/13 ] |
|
Ok, then it is the same issue and it is solved in master by |
| Comment by Chen Fisher [ 22/Jul/13 ] |
|
I've managed to reproduce it with the following pipeline (I narrowed it down to this): example: |
| Comment by Mathias Stearn [ 18/Jul/13 ] |
|
Looking at this ticket again, I'm not sure this is the same issue. I know there was an issue with unindexed $sort + $limit, but I'm not able to repro with $skip. Could you provide the exact pipeline that is crashing for you? It sounds like it should crash w/o any data, but if data is nessisary, please provide it or a script that can generate crashing data. |
| Comment by Mathias Stearn [ 08/Jul/13 ] |
|
This will automatically be fixed by |