Bug 91098 - [BlackBerry] WebPage::executeJavaScriptFunction crashes when there is an exception
Summary: [BlackBerry] WebPage::executeJavaScriptFunction crashes when there is an exce...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-12 08:28 PDT by Benjamin Meyer
Modified: 2012-07-12 10:11 PDT (History)
5 users (show)

See Also:


Attachments
patch (3.17 KB, patch)
2012-07-12 09:07 PDT, Benjamin Meyer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Meyer 2012-07-12 08:28:02 PDT
When there is an exception currently the code tries to get the string of the exception via JSValueToStringCopy to pass back, but this cases a crash inside JavaScriptCore, so change it to simply return false and not set the return value with the exception string.
Comment 1 Benjamin Meyer 2012-07-12 09:07:36 PDT
Created attachment 151968 [details]
patch
Comment 2 Benjamin Meyer 2012-07-12 09:18:09 PDT
For the curious, here is the BT for the crash

#0  isString (this=0x0) at /home/bmeyer/git/qnx/webkit/Source/JavaScriptCore/runtime/JSCell.cpp:215
#1  JSC::JSCell::toPrimitive (this=0x0, exec=0x82bfcb0, preferredType=JSC::PreferString)
    at /home/bmeyer/git/qnx/webkit/Source/JavaScriptCore/runtime/JSCell.cpp:138
#2  0xbb3139be in JSC::JSValue::toStringSlowCase (this=0x7bc1c84, exec=0x82bfcb0)
    at /home/bmeyer/git/qnx/webkit/Source/JavaScriptCore/runtime/JSValue.cpp:279
#3  0xbb291d36 in toString (exec=0x82bfcb0, this=0x7bc1c84)
    at /home/bmeyer/git/qnx/webkit/Source/JavaScriptCore/runtime/JSString.h:495
#4  JSValueToStringCopy (ctx=0x82bfcb0, value=0x0, exception=0x0)
    at /home/bmeyer/git/qnx/webkit/Source/JavaScriptCore/API/JSValueRef.cpp:296
#5  0xb9db1d8e in BlackBerry::WebKit::WebPage::executeJavaScriptFunction (this=0x81e6e90, function=..., args=..., 
    returnType=@0x7bc1d5c: BlackBerry::WebKit::JSException, returnValue=...)
Comment 3 WebKit Review Bot 2012-07-12 10:11:15 PDT
Comment on attachment 151968 [details]
patch

Clearing flags on attachment: 151968

Committed r122476: <http://trac.webkit.org/changeset/122476>
Comment 4 WebKit Review Bot 2012-07-12 10:11:24 PDT
All reviewed patches have been landed.  Closing bug.