Permalink
Browse files

Reduce object nesting level from 1500 to 700

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...
1 parent 1abe1c5 commit c32b1e7c07f79b89641f32d6b68a01ea6f22b23b @tadmarshall tadmarshall committed Jul 16, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 jstests/nestedobj1.js
@@ -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 );
@@ -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.