[SERVER-5127] Limit recursion depth of BSONObj::toString() Created: 28/Feb/12  Updated: 15/Aug/12  Resolved: 13/Apr/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.1

Type: New Feature Priority: Major - P3
Reporter: siddharth.singh@10gen.com Assignee: siddharth.singh@10gen.com
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-5036 MongoDB crashes on indexing nested array Closed
Duplicate
duplicates SERVER-6763 Random mongod Segmentation faults aft... Closed
Related
is related to SERVER-6251 mongod 2.1.2 crashes when indexing de... Closed
Participants:

 Description   

This is to safeguard against issues like (SERVER-5036) where a 1000 level deep nested array was crashing mongod when trying to print out unindexable keys.



 Comments   
Comment by auto [ 13/Jul/12 ]

Author:

{u'date': u'2012-07-12T11:14:38-07:00', u'email': u'steve.briskin@10gen.com', u'name': u'Steve Briskin'}

Message: JS tests for SERVER-5127
Branch: master
https://github.com/mongodb/mongo/commit/d8a7ced9ca0066f5e4f1679dba8b6e83cd5939b0

Comment by auto [ 18/Apr/12 ]

Author:

{u'login': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-5127 adding limit for maximum bson object nested depth
Branch: master
https://github.com/mongodb/docs/commit/a8292545c927f98d76b9d3a7798d5e984537e907

Comment by auto [ 16/Apr/12 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Lower maxToStringRecursionDepth to 100 SERVER-5127
Branch: master
https://github.com/mongodb/mongo/commit/b5348b5dc61afe0377ab06003b51029810f40b55

Comment by auto [ 14/Apr/12 ]

Author:

{u'login': u'tadmarshall', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-5127 Fix reversed test
Branch: master
https://github.com/mongodb/mongo/commit/7acafe5df00a1e72890d474b8d145136800fdd68

Comment by auto [ 14/Apr/12 ]

Author:

{u'login': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-5127 Try to make Windows and gcc compile
Branch: master
https://github.com/mongodb/mongo/commit/2ab1c27d3e0c92137eb3aec0b60d2f43582c0591

Comment by auto [ 14/Apr/12 ]

Author:

{u'login': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-5127 Fix Windows compile

Don't use BSONObjBuilder::numStr() to convert 500 to a string.
Branch: master
https://github.com/mongodb/mongo/commit/66b15e93e2da8344c01cfc8ecf45906212c71107

Comment by siddharth.singh@10gen.com [ 13/Apr/12 ]

Need to document that the current maximum nested allowable depth for BSONObj.toString() is 500.

Comment by auto [ 13/Apr/12 ]

Author:

{u'login': u'', u'name': u'Siddharth Singh', u'email': u'singhsiddharth@gmail.com'}

Message: SERVER-5127 Limit recursion depth

This is to safeguard against a scenario where a deep nested array
can crash BSONObj.toString() and BSONObjElement.toString()
which eventually was crashing mongod.
Branch: master
https://github.com/mongodb/mongo/commit/b4052ecccf00f87cad5e72b5bf56829fce0c7410

Generated at Thu Feb 08 03:07:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.