Skip to content

Commit

Permalink
Reduce object nesting level from 1500 to 700
Browse files Browse the repository at this point in the history
On Windows, creating a nested object 1500 levels deep crashes
the shell with a stack overflow.  This is presumably because of
the default stack size of 1 MB on Windows; the default stack
size on Linux is 8 MB.  So, reduce the nesting level from 1500
to 700 to make the test pass on Windows.

This doesn't address the actual stack overflow problem, which
also exists on Linux but requires a larger number.  Testing with
20000 crashes Linux and Mac OS X with segfaults.
  • Loading branch information
Tad Marshall committed Jul 16, 2012
1 parent 1abe1c5 commit c32b1e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jstests/nestedobj1.js
Expand Up @@ -16,8 +16,7 @@ t = db.objNestTest;
t.drop();
t.ensureIndex({a:1});

nestedObj = makeNestObj(1500);
print(nestedObj);
nestedObj = makeNestObj(700);

t.insert( { tst : "test1", a : nestedObj }, true );
t.insert( { tst : "test2", a : nestedObj }, true );
Expand All @@ -28,5 +27,5 @@ assert.eq(1, t.find({tst : "test2"}).count(), "find test");

//make sure index insertion failed (nesting must be large enough)
assert.eq(0, t.find().hint({a:1}).explain().n, "index not empty");

print("Test succeeded!")
}

0 comments on commit c32b1e7

Please sign in to comment.