Bug 194584

Summary: Crash in Page::setActivityState because m_page is null
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: WebKit2Assignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, cdumez, ggaren, koivisto, mcatanzaro
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Adds a nullcheck none

Description Ryosuke Niwa 2019-02-12 22:42:46 PST
e.g.
0   com.apple.WebCore             	0x00007fff50236b2e WebCore::Page::setActivityState(WTF::OptionSet<WebCore::ActivityState::Flag>) + 14
1   com.apple.WebKit              	0x00007fff50fc071d WebKit::WebPage::setActivityState(WTF::OptionSet<WebCore::ActivityState::Flag>, unsigned long long, WTF::Vector<WebKit::CallbackID, 0ul, WTF::CrashOnOverflow, 16ul> const&) + 83
2   com.apple.WebKit              	0x00007fff50fd446e WebKit::WebPage::didReceiveWebPageMessage(IPC::Connection&, IPC::Decoder&) + 4872
3   com.apple.WebKit              	0x00007fff50c58d84 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 126
4   com.apple.WebKit              	0x00007fff50f1dd06 WebKit::WebProcess::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 28
5   com.apple.WebKit              	0x00007fff50c48a98 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 108
6   com.apple.WebKit              	0x00007fff50c4c24b IPC::Connection::dispatchOneIncomingMessage() + 181
Comment 1 Ryosuke Niwa 2019-02-12 22:42:55 PST
<rdar://problem/47761293>
Comment 2 Ryosuke Niwa 2019-02-12 22:55:49 PST
Created attachment 361898 [details]
Adds a nullcheck
Comment 3 Ryosuke Niwa 2019-02-13 01:07:26 PST
Comment on attachment 361898 [details]
Adds a nullcheck

Clearing flags on attachment: 361898

Committed r241401: <https://trac.webkit.org/changeset/241401>
Comment 4 Ryosuke Niwa 2019-02-13 01:07:27 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Michael Catanzaro 2019-02-13 12:56:47 PST
Note incoming follow-up:

[3441/3510] Building CXX object Source...t.dir/WebProcess/WebPage/WebPage.cpp.o
In file included from DerivedSources/ForwardingHeaders/wtf/StdLibExtras.h:32,
                 from DerivedSources/ForwardingHeaders/wtf/FastMalloc.h:25,
                 from ../../Source/WebKit/config.h:47,
                 from ../../Source/WebKit/WebProcess/WebPage/WebPage.cpp:28:
../../Source/WebKit/WebProcess/WebPage/WebPage.cpp: In member function ‘void WebKit::WebPage::setActivityState(WTF::OptionSet<WebCore::ActivityState::Flag>, WebKit::ActivityStateChangeID, const WTF::Vector<WebKit::CallbackID>&)’:
../../Source/WebKit/WebProcess/WebPage/WebPage.cpp:3048:33: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
     ASSERT_WITH_MESSAGE(m_page, "setActivityState called on %lld but WebCore page was null", pageID());
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~
DerivedSources/ForwardingHeaders/wtf/Assertions.h:391:99: note: in definition of macro ‘ASSERT_WITH_MESSAGE’
         WTFReportAssertionFailureWithMessage(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion, __VA_ARGS__); \
                                                                                                   ^~~~~~~~~~~
Comment 6 Michael Catanzaro 2019-02-13 13:10:13 PST
Committed r241453: <https://trac.webkit.org/changeset/241453>