[SERVER-5482] array access attempt after a find failure puts shell in an unusable state Created: 02/Apr/12  Updated: 15/Aug/12  Resolved: 18/May/12

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

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Tad Marshall
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-5842 Exceptions thrown in scripting/engine... Closed
Operating System: ALL
Participants:

 Description   

 
> c.drop()
true
> c.save( {} )
> c.find().hint( { a:1 } )[ 0 ] // There is not such { a:1 } index.
Mon Apr  2 13:59:49   Assertion failure JS_CallFunctionName( cx , obj , "arrayAccess" , 1 , &id , &val ) src/mongo/scripting/sm_db.cpp 1141
0x108f54835 0x1091f335b 0x1091f70c9 0x109148f28 0x109006be9 0x109006702 0x109007d7e 0x108fea805 0x108fdbbf3 0x108f8b373 0x108f8b266 0x108f8b0a3 0x10916bbe8 0x108f3afd5 0x108f3d45b 0x108f2ede4 0x1 
 0   mongo                               0x0000000108f54835 _ZN5mongo15printStackTraceERSo + 37
 1   mongo                               0x00000001091f335b _ZN5mongo12sayDbContextEPKc + 123
 2   mongo                               0x00000001091f70c9 _ZN5mongo8assertedEPKcS1_j + 409
 3   mongo                               0x0000000109148f28 _ZN5mongo15dbquery_resolveEP9JSContextP8JSObjectljPS3_ + 264
 4   mongo                               0x0000000109006be9 js_LookupPropertyWithFlags + 1225
 5   mongo                               0x0000000109006702 js_LookupProperty + 98
 6   mongo                               0x0000000109007d7e js_GetProperty + 366
 7   mongo                               0x0000000108fea805 js_Interpret + 55557
 8   mongo                               0x0000000108fdbbf3 js_Execute + 1075
 9   mongo                               0x0000000108f8b373 JS_EvaluateUCScriptForPrincipals + 243
 10  mongo                               0x0000000108f8b266 JS_EvaluateUCScript + 134
 11  mongo                               0x0000000108f8b0a3 JS_EvaluateScript + 179
 12  mongo                               0x000000010916bbe8 _ZN5mongo7SMScope4execERKNS_10StringDataERKSsbbbi + 250
 13  mongo                               0x0000000108f3afd5 _Z5_mainiPPc + 22837
 14  mongo                               0x0000000108f3d45b main + 155
 15  mongo                               0x0000000108f2ede4 start + 52
 16  ???                                 0x0000000000000001 0x0 + 1
error:assertion src/mongo/scripting/sm_db.cpp:1141
> c.drop() // Subsequent shell interactions seem to fail.
error: { "$err" : "bad hint", "code" : 10113 }
error2:(shellhelp1) exec failed: error: { "$err" : "bad hint", "code" : 10113 }
> c.drop()
error: { "$err" : "bad hint", "code" : 10113 }
error2:(shellhelp1) exec failed: error: { "$err" : "bad hint", "code" : 10113 }
> x = 1
error: { "$err" : "bad hint", "code" : 10113 }
error2:(shellhelp1) exec failed: error: { "$err" : "bad hint", "code" : 10113 }
>



 Comments   
Comment by Tad Marshall [ 18/May/12 ]

I will promote SERVER-5842 to 2.1.2 to cover fixing this.

Comment by Tad Marshall [ 18/May/12 ]

This is another instance of throwing an exception while called from SpiderMonkey, which skips past SpiderMonkey's state cleanup and leaves SpiderMonkey in a bad state.

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