[SERVER-19614] Recursive function crashes server Created: 27/Jul/15  Updated: 04/Nov/15  Resolved: 27/Oct/15

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 3.1.6
Fix Version/s: 3.2.0-rc2

Type: Bug Priority: Major - P3
Reporter: J Delaney Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-20678 MapReduce performance Issue with 3.1.x Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform A (10/09/15), Platform B (10/30/15)
Participants:
Linked BF Score: 0

 Description   

With SpiderMonkey calling a recursive function when executing server-side JavaScript crashes the server.



 Comments   
Comment by Githook User [ 27/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19614 fix lint
Branch: master
https://github.com/mongodb/mongo/commit/90607c08ebb7dc7d6730b2d932ff06b3cef01c12

Comment by Githook User [ 27/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19614 Return to using stdx::thread for JS impl scope
Branch: master
https://github.com/mongodb/mongo/commit/0846b801c57f2e824b1aa1d031b7e3286c76c3ce

Comment by Githook User [ 27/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19614 Use stack bounds to limit JS recursion
Branch: master
https://github.com/mongodb/mongo/commit/1a95eb42b15e2e1ecf905765530cb10c12340d38

Comment by Githook User [ 27/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19614 Implement stack bounds detection
Branch: master
https://github.com/mongodb/mongo/commit/e556e4763ad88c3308347b56b4831c46b014627e

Comment by Githook User [ 13/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-19614 Temporarily disable JS recursion depth protections
Branch: master
https://github.com/mongodb/mongo/commit/804f8c7b926f999cd1eeaf4ebe50dfb99f7acfad

Comment by Andrew Morrow (Inactive) [ 13/Oct/15 ]

Re-opening, as the fix for this issue and the fix for SERVER-20678 conflict. We are keeping the SERVER-20678 changes and disabling this feature for now. We will re-enable this when we have a solution that does not compete with SERVER-20678.

Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-19614 Implement stack quotas for JS

Replace existing calls to std::thread with platform threading primitives
and set a stack quota to avoid stack overflows for some recursive use
cases in js.
Branch: master
https://github.com/mongodb/mongo/commit/e5f65d77a33e5116adb965549deb51ab3ed0a462

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