[SERVER-23191] Group command needs to make a copy of the obj it passes to JS Created: 16/Mar/16  Updated: 11/Sep/17  Resolved: 28/Mar/16

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 3.2.4
Fix Version/s: 3.2.17, 3.3.4

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-30943 Segmentation fault on attempt to acce... Closed
is duplicated by SERVER-23169 group failed : Command failed with er... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.2
Sprint: Platforms 12 (04/01/16)
Participants:
Linked BF Score: 0

 Description   

GroupStage::processObject needs to make a copy of obj before passing it down into js, because those objects can be copied into the accumulating object (after which that object won't be readable).

It doesn't appear that this is a crasher (because we use the scope's generation to trap the invalid access), but it does mean that valid operations will fail with uasserts later on.

We should make obj an owned copy and add a test for the functionality



 Comments   
Comment by Ramon Fernandez Marina [ 11/Sep/17 ]

Author:

{'username': u'jbreams', 'name': u'Jonathan Reams', 'email': u'jbreams@mongodb.com'}

Message:SERVER-23191 group should pass an owned BSONObj to the reduce function

(cherry picked from commit 6adda9f7dde0bf62b9ff8d27ade8f1bb6e574fec)
Branch:v3.2
https://github.com/mongodb/mongo/commit/339c13172b6adee205d3f08a8f95e98b62792a80

Comment by Githook User [ 28/Mar/16 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-23191 group should pass an owned BSONObj to the reduce function
Branch: master
https://github.com/mongodb/mongo/commit/6adda9f7dde0bf62b9ff8d27ade8f1bb6e574fec

Generated at Thu Feb 08 04:02:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.