Bug 53593 - Crash beneath HistoryController::recursiveSetProvisionalItem in web process (preceded by assertion failure) if UI process exits while Messages::WebPage::RestoreSessionAndNavigateToCurrentItem is being handled
Summary: Crash beneath HistoryController::recursiveSetProvisionalItem in web process (...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-02-02 07:46 PST by Adam Roben (:aroben)
Modified: 2011-02-13 02:19 PST (History)
4 users (show)

See Also:


Attachments
proposed patch (6.02 KB, patch)
2011-02-11 16:16 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2011-02-02 07:46:27 PST
To reproduce:

1. Put a breakpoint in WebPage::restoreSessionAndNavigateToCurrentItem and cause it to be called
2. When the breakpoint is hit, kill the UI process
3. Let the web process continue

You'll hit an assertion failure in HistoryController::recursiveSetProvisionalItem, which would then be followed by a crash in HistoryController::itemsAreClones. The failing assertion is:

    ASSERT(fromItem);

The problem is that BackForwardController::currentItem returned null inside HistoryController::goToItem. It returned null because the WebBackForwardListProxy was not able to send a synchronous message to the UI process to get the current item, because the UI process had exited.

Here's the backtrace when the assertion fires:


 	WebKit.dll!WebCore::HistoryController::recursiveSetProvisionalItem(WebCore::HistoryItem * item=0x02428e60, WebCore::HistoryItem * fromItem=0x00000000, WebCore::FrameLoadType type=FrameLoadTypeIndexedBackForward)  Line 614 + 0x22 bytes	C++
>	WebKit.dll!WebCore::HistoryController::goToItem(WebCore::HistoryItem * targetItem=0x02428e60, WebCore::FrameLoadType type=FrameLoadTypeIndexedBackForward)  Line 250	C++
 	WebKit.dll!WebCore::Page::goToItem(WebCore::HistoryItem * item=0x02428e60, WebCore::FrameLoadType type=FrameLoadTypeIndexedBackForward)  Line 353	C++
 	WebKit.dll!WebKit::WebPage::goToBackForwardItem(unsigned __int64 backForwardItemID=2)  Line 489	C++
 	WebKit.dll!WebKit::WebPage::restoreSessionAndNavigateToCurrentItem(const WebKit::SessionState & sessionState={...})  Line 988	C++
 	WebKit.dll!CoreIPC::callMemberFunction<WebKit::WebPage,void (__thiscall WebKit::WebPage::*)(WebKit::SessionState const &),WebKit::SessionState>(const CoreIPC::Arguments1<WebKit::SessionState> & args={...}, WebKit::WebPage * object=0x02391f70, void (const WebKit::SessionState &)* function=0x10009020)  Line 19 + 0xf bytes	C++
 	WebKit.dll!CoreIPC::handleMessage<Messages::WebPage::RestoreSessionAndNavigateToCurrentItem,WebKit::WebPage,void (__thiscall WebKit::WebPage::*)(WebKit::SessionState const &)>(CoreIPC::ArgumentDecoder * argumentDecoder=0x023c5070, WebKit::WebPage * object=0x02391f70, void (const WebKit::SessionState &)* function=0x10009020)  Line 222 + 0x15 bytes	C++
 	WebKit.dll!WebKit::WebPage::didReceiveWebPageMessage(CoreIPC::Connection * __formal=0x0237b670, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x023c5070)  Line 118 + 0x2f bytes	C++
 	WebKit.dll!WebKit::WebPage::didReceiveMessage(CoreIPC::Connection * connection=0x0237b670, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x023c5070)  Line 1652	C++
 	WebKit.dll!WebKit::WebProcess::didReceiveMessage(CoreIPC::Connection * connection=0x0237b670, CoreIPC::MessageID messageID={...}, CoreIPC::ArgumentDecoder * arguments=0x023c5070)  Line 537	C++
 	WebKit.dll!CoreIPC::Connection::dispatchMessages()  Line 479 + 0x31 bytes	C++
 	WebKit.dll!MemberFunctionWorkItem0<CoreIPC::Connection>::execute()  Line 76 + 0x10 bytes	C++
 	WebKit.dll!RunLoop::performWork()  Line 63 + 0x1a bytes	C++
 	WebKit.dll!RunLoop::wndProc(HWND__ * hWnd=0x00041246, unsigned int message=1025, unsigned int wParam=37201464, long lParam=0)  Line 61	C++
 	WebKit.dll!RunLoop::RunLoopWndProc(HWND__ * hWnd=0x00041246, unsigned int message=1025, unsigned int wParam=37201464, long lParam=0)  Line 43 + 0x18 bytes	C++
 	user32.dll!_InternalCallWinProc@20()  + 0x28 bytes	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7 bytes	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc bytes	
 	user32.dll!_DispatchMessageW@4()  + 0xf bytes	
 	WebKit.dll!RunLoop::runUntil(const CoreIPC::BinarySemaphore * semaphore=0x00000000, double absoluteTime=1.7976931348623157e+308)  Line 99 + 0xc bytes	C++
 	WebKit.dll!RunLoop::run()  Line 72 + 0x1c bytes	C++
 	WebKit.dll!WebKit::WebProcessMain(const WebKit::CommandLine & commandLine={...})  Line 82	C++
 	WebKit.dll!WebKitMain(const WebKit::CommandLine & commandLine={...})  Line 48 + 0x9 bytes	C++
 	WebKit.dll!WebKitMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpstrCmdLine=0x000210d4, int nCmdShow=10)  Line 172 + 0x9 bytes	C++
 	WebKit2WebProcess.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpstrCmdLine=0x000210d4, int nCmdShow=10)  Line 44 + 0x18 bytes	C++
 	WebKit2WebProcess.exe!__tmainCRTStartup()  Line 589 + 0x1c bytes	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23 bytes
Comment 1 Adam Roben (:aroben) 2011-02-02 07:46:42 PST
See also bug 52819.
Comment 2 Adam Roben (:aroben) 2011-02-02 07:47:01 PST
<rdar://problem/8948380>
Comment 3 Alexey Proskuryakov 2011-02-11 16:16:17 PST
Created attachment 82205 [details]
proposed patch
Comment 4 Darin Adler 2011-02-11 16:18:51 PST
Comment on attachment 82205 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82205&action=review

> Source/WebKit2/Platform/CoreIPC/Connection.h:87
> +        virtual void didFailToSendSyncMessage(Connection*) { };

Semicolon here is unneeded/incorrect.

> Source/WebKit2/PluginProcess/PluginProcess.cpp:116
> +    // We were making a synchronous call to web process that doesn't exist any more.

Should be “a web process”.

> Source/WebKit2/WebProcess/WebProcess.cpp:572
> +    // We were making a synchronous call to UI process that doesn't exist any more.

Should be “a UI process”.
Comment 5 Alexey Proskuryakov 2011-02-11 16:25:34 PST
Committed <http://trac.webkit.org/changeset/78392>.
Comment 6 WebKit Review Bot 2011-02-13 02:19:31 PST
http://trac.webkit.org/changeset/78392 might have broken SnowLeopard Intel Release (WebKit2 Tests)
The following tests are not passing:
fast/loader/empty-embed-src-attribute.html