|
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.
|
|