Bug 166397 - ChildProcessProxy::shutDownProcess calls Connection::terminateSoon even on invalid connections, but shouldn’t
Summary: ChildProcessProxy::shutDownProcess calls Connection::terminateSoon even on in...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-12-21 15:10 PST by mitz
Modified: 2016-12-21 15:11 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2016-12-21 15:10:08 PST
I noticed that Web Content process crashes are sometimes followed by this being logged:

Unable to acquire assertion for process 0

This happens because the ProcessAssertion constructor gets called with a 0 pid, which comes from the connection to the crashed process, which is no longer valid. In this backtrace:

#0	0x0000000195b0d300 in WebKit::ProcessAssertion::ProcessAssertion(int, WebKit::AssertionState, WTF::Function<void ()>&&) at WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:167
#1	0x0000000195b0da40 in WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion(int, WebKit::AssertionState) at WebKit2/UIProcess/ios/ProcessAssertionIOS.mm:228
#2	0x0000000195a83f34 in std::__1::__unique_if<WebKit::ProcessAndUIAssertion>::__unique_single std::__1::make_unique<WebKit::ProcessAndUIAssertion, int, WebKit::AssertionState>(int&&, WebKit::AssertionState&&) [inlined] at /usr/bin/../include/c++/v1/memory:3153
#3	0x0000000195a83f18 in IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog(WTF::OSObjectPtr<NSObject<OS_xpc_object>*>&, double) at WebKit2/Platform/IPC/mac/ConnectionMac.mm:93
#4	0x0000000195a82ff0 in IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog(WTF::OSObjectPtr<NSObject<OS_xpc_object>*>&, double) [inlined] at WebKit2/Platform/IPC/mac/ConnectionMac.mm:95
#5	0x0000000195a82fe4 in IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog(WTF::OSObjectPtr<NSObject<OS_xpc_object>*>&, double) at WebKit2/Platform/IPC/mac/ConnectionMac.mm:85
#6	0x0000000195a7c2c0 in WebKit::ChildProcessProxy::shutDownProcess() at WebKit2/UIProcess/ChildProcessProxy.cpp:196
#7	0x0000000195c52298 in WebKit::WebProcessProxy::shutDown() at WebKit2/UIProcess/WebProcessProxy.cpp:165
#8	0x0000000195c53dd4 in WebKit::WebProcessProxy::didClose(IPC::Connection&) at WebKit2/UIProcess/WebProcessProxy.cpp:523

shutDownProcess() should not call Connection::terminateSoon if the connection is already invalid.
Comment 1 mitz 2016-12-21 15:11:28 PST
<rdar://problem/29778802>