[SERVER-4449] syntax error in function stored in system.db.js terminates mongod (v8) Created: 07/Dec/11  Updated: 08/Mar/13  Resolved: 07/Mar/13

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

Type: Bug Priority: Major - P3
Reporter: Antoine Girbal Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-8647 InvalidStoredJS test failure Closed
Operating System: ALL
Participants:

 Description   

stored function as: 'print("yo"); return "yo";'
Upon calling db.eval("myprint()") the db terminates:

yo
<unknown>:46: Uncaught SyntaxError: Illegal return statement
Wed Dec 7 09:35:25 Invalid access at address: 0

Wed Dec 7 09:35:25 Got signal: 11 (Segmentation fault).

Wed Dec 7 09:35:25 Backtrace:
0x953633 0x9491c0 0x9494f3 0x7f4af2481c60 0x9b603b 0xab4c89 0x9b638a 0x96abda 0x6bb7c0 0x69966c 0x6b9acd 0x7c2827 0x7c5d11 0x8869ce 0x888f00 0x889453 0x8666fa 0x868e5a 0x7dadab 0x954572
./mongod(_ZN5mongo15printStackTraceERSo+0x23) [0x953633]
./mongod(_ZN5mongo10abruptQuitEi+0x380) [0x9491c0]
./mongod(_ZN5mongo24abruptQuitWithAddrSignalEiP7siginfoPv+0x1f3) [0x9494f3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfc60) [0x7f4af2481c60]
./mongod() [0x9b603b]
./mongod() [0xab4c89]
./mongod() [0x9b638a]
./mongod() [0x96abda]
./mongod(_ZN5mongo7V8Scope10setElementEPKcRKNS_11BSONElementE+0xa0) [0x6bb7c0]
./mongod(_ZN5mongo5Scope10loadStoredEb+0x49c) [0x69966c]
./mongod(_ZN5mongo7V8Scope12localConnectEPKc+0x28d) [0x6b9acd]
./mongod(_ZN5mongo6dbEvalERKSsRNS_7BSONObjERNS_14BSONObjBuilderERSs+0xe7) [0x7c2827]
./mongod(_ZN5mongo7CmdEval3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x4a1) [0x7c5d11]
./mongod(_ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRNS_14BSONObjBuilderEb+0x3e) [0x8869ce]
./mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x620) [0x888f00]
./mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x263) [0x889453]
./mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x3a) [0x8666fa]
./mongod(ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x120a) [0x868e5a]
./mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0xc7b) [0x7dadab]
./mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x92) [0x954572]



 Comments   
Comment by Ben Becker [ 07/Mar/13 ]

This issue has been resolved by SERVER-8647

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