-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Index Maintenance, Security, Stability
-
None
-
Query
-
ALL
Observed behavior: When mongod compares two deeply nested objects, a stack overflow is triggered. The following example triggers a stack overflow on osx 10.7.4 with both debug and release builds:
t = db.t; t.drop(); function makeNestObj(depth){ toret = { a : 1}; for(i = 1; i < depth; i++){ toret = {a : toret}; } return toret; } nestedObj = makeNestObj(1500); // Save two deeply recursive 'a' values, so we can sort them. t.insert( { a:nestedObj }, true ); t.insert( { a:nestedObj }, true ); t.find().sort( { a:1 } ).itcount(); // In memory sort triggers a stack overflow. t.ensureIndex( { a:1 } ); // External sorter triggers a stack overflow.
- is depended on by
-
SERVER-6251 mongod 2.1.2 crashes when indexing deeply nested arrays
- Closed
-
SERVER-6448 illegal instruction following deep recursive comparison in external sorter when running repair.js after nestedobj1.js
- Closed
- is duplicated by
-
SERVER-6448 illegal instruction following deep recursive comparison in external sorter when running repair.js after nestedobj1.js
- Closed
- is related to
-
SERVER-8433 Aggregating deeply-nested documents can cause stack overflow
- Closed