Last Comment Bug 589308 - Jetpack child process doesn't report errors outside of registerReceiver() callbacks
: Jetpack child process doesn't report errors outside of registerReceiver() cal...
Status: NEW
:
Product: Core
Classification: Components
Component: DOM: Content Processes (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: [PTO to Dec5] Bill McCloskey (:billm)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-20 14:45 PDT by Atul Varma [:atul]
Modified: 2014-06-17 12:39 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Atul Varma [:atul] 2010-08-20 14:45:22 PDT
If the main body of a script executed via nsIJetpack.evalScript() throws an exception that isn't caught, it isn't reported as an error via a "core:exception" message.

Looking at the source code, it seems like this is a result of the JSOPTION_DONT_REPORT_UNCAUGHT option being set on the context running JS in the Jetpack child process and the fact that JetpackChild::RecvEvalScript() isn't checking the return value of JS_EvaluateUCScript() and calling JS_ReportPendingException() if it's failed. I could be wrong, though.
This bug also has a workaround, in that the whole script that's executed can just be surrounded by a try ... catch.
Comment 1 Eddy Bruel [:ejpbruel] 2011-06-09 11:51:16 PDT
Comparing JetpackChild::RecvEvalScript with  JetpackActorCommon::RecvMessage (which *does* throw an exception) it seems as if it is enough to just check the return value of JS_EvaluateUCScript and call JS_ReportPendingException, as Atul suggested.

I have tried this out and it looks as if this does indeed solve the problem.

Note You need to log in before you can comment on or make changes to this bug.