[SERVER-19612] JSThread exception messages are not printed when using SpiderMonkey Created: 27/Jul/15  Updated: 08/Jan/24  Resolved: 30/Jul/15

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 3.1.6
Fix Version/s: 3.1.7

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: 32qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

load('jstests/libs/parallelTester.js');
 
var fn = function() {throw new Error('print me');};
var t = new ScopedThread(fn);
t.start();
t.join();

Sprint: Platform 7 08/10/15
Participants:

 Description   

The included JS test prints out this exception info in 3.1.5 (notice 'print me' in the output):

MongoDB shell version: 3.1.5
connecting to: test
connecting to: test
2015-07-27T16:41:53.861-0400 I -        [thread1] js thread raised js exception: Error: print me
    at ____MongoToV8_newFunction_temp (<anonymous>:1:53)

Here's the output from master (notice that 'print me' is missing):

MongoDB shell version: 3.1.7-pre-
connecting to: test
connecting to: test
2015-07-27T16:42:08.329-0400 I QUERY    [thread2] js thread raised js exception: JSInterpreterFailure Unknown callThread failure
2015-07-27T16:42:08.336-0400 I QUERY    [thread2] js thread threw c++ exception: JSInterpreterFailure Unknown callThread failure



 Comments   
Comment by Githook User [ 30/Jul/15 ]

Author:

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

Message: SERVER-19612 JSThread exceptions lost on SM

After we return from JS::Call we don't have exceptions pending, they've
already been captured by the error handler. Handle JSThread exceptions
like the others and return them correctly.
Branch: master
https://github.com/mongodb/mongo/commit/3feccd233307a8a4fc81e312d072046f8cf2f499

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