-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 3.4.8
-
Component/s: JavaScript
-
Fully Compatible
-
ALL
-
v3.4, v3.2
-
Platforms 2017-09-11
"scope" allows a user to provide a map of global variables to expose to all JS functions ran during a mapReduce job. However, we do not take an owned copy of the map from the command. If scope contains an object, this triggers the memory protection mechanisms added in SERVER-30875.
MongoDB Enterprise > db.runCommand({mapReduce: "foo", map: function(x) {return emit("hello", 1);}, reduce: function(x) { return 0; }, scope: {x: {x: function() {return 5;}}}, out: "bar"}) { "ok" : 0, "errmsg" : "Attempt to bind an unowned BSON Object to a JS scope marked as requiring ownership", "code" : 2, "codeName" : "BadValue" }
- is related to
-
SERVER-30875 Add support for a "no-owned bson" mode for JS Scopes
- Closed