RESOLVED FIXED 160325
Function Call on NULL Object
https://bugs.webkit.org/show_bug.cgi?id=160325
Summary Function Call on NULL Object
Jonathan Bedard
Reported 2016-07-28 16:10:17 PDT
In InjectedBundle.cpp, the 'reset' signal is received at the beginning of a test run. In this reset, all web notifications are removed from the test runner. However, the first reset message is received before the test runner has been instantiated.
Attachments
Patch (1.31 KB, patch)
2016-07-28 16:15 PDT, Jonathan Bedard
no flags
Patch (2.30 KB, patch)
2016-07-29 09:15 PDT, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2016-07-28 16:11:51 PDT
Note that this problem was only revealed with UBSan since removeAllWebNotifications() does not actually need the test runner to be instantiated to function. Another possible solution is to make this function a static one, but that would pollute the global namespace and may not be desired.
Jonathan Bedard
Comment 2 2016-07-28 16:15:48 PDT
Darin Adler
Comment 3 2016-07-28 16:33:14 PDT
(In reply to comment #1) > Another possible solution is to make this function a static one, but that > would pollute the global namespace and may not be desired. We should make it a static member function. That won’t pollute any namespaces at all.
Jonathan Bedard
Comment 4 2016-07-29 09:15:10 PDT
Jonathan Bedard
Comment 5 2016-07-29 09:17:26 PDT
I made all functions in this family static, since none of them actually need the object to work. As a larger architectural question: why aren't more functions in the TestRunner static? Inspection of the code seems to indicate that most functions in the TestRunner could be declared as static.
Darin Adler
Comment 6 2016-08-01 10:31:43 PDT
(In reply to comment #5) > As a larger architectural question: why aren't more functions in the > TestRunner static? Inspection of the code seems to indicate that most > functions in the TestRunner could be declared as static. TestRunner is primarily an object that exposes bindings to be called from JavaScript using the JavaScript testRunner object exposed to tests. People writing these functions probably don’t think about which ones do and don’t need the state; it would be fine, although not particularly important, to change any that can be static member functions to be defined that way.
WebKit Commit Bot
Comment 7 2016-08-01 10:51:20 PDT
Comment on attachment 284867 [details] Patch Clearing flags on attachment: 284867 Committed r203975: <http://trac.webkit.org/changeset/203975>
WebKit Commit Bot
Comment 8 2016-08-01 10:51:24 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.