Bug 127683

Summary: [WK2] http/tests/navigation/new-window-redirect-history.html crashes
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: Tools / TestsAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, beidson, commit-queue, darin, don.olmstead, Hironori.Fujii, mitz, ossy
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Csaba Osztrogonác 2014-01-27 08:09:55 PST
http/tests/navigation/new-window-redirect-history.html crashes on WK2 platforms. It is 
skipped by the generic TestExpectations file with "Unexplained back/forward list failures"
Comment 1 Csaba Osztrogonác 2014-01-27 08:49:37 PST
I added the proper entry to the wk2/TestExpectations file with bug number.
Comment 2 Alexey Proskuryakov 2014-06-10 14:19:05 PDT
run-webkit-tests -2 --no-retry http/tests/navigation/new-window-redirect-history.html

This crash happens in WebKitTestRunner code. I don't know if it's a WebKitTestRunner bug, or an API that misbehaves, and makes WebKitTestRunner crash.

<rdar://problem/16928624>
Comment 3 Alexey Proskuryakov 2014-06-10 14:21:23 PDT
Changed expectation from Crash to Skip in <http://trac.webkit.org/r169764>. Generating more crash logs only makes other tests more flaky without providing useful information about this test.
Comment 4 Fujii Hironori 2018-02-19 18:48:05 PST
Callstack:

> Thread 1 (Thread 0x7f0e0c0b8ac0 (LWP 98101)):
> #0  0x00007f0e051a6f14 in WTF::DumbPtrTraits<WebCore::HistoryItem>::unwrap (ptr=<error reading variable>) at DerivedSources/ForwardingHeaders/wtf/DumbPtrTraits.h:41
> #1  0x00007f0e051bc67e in WTF::RefPtr<WebCore::HistoryItem, WTF::DumbPtrTraits<WebCore::HistoryItem> >::get (this=0x10) at DerivedSources/ForwardingHeaders/wtf/RefPtr.h:72
> #2  0x00007f0e051bc540 in (anonymous namespace)::InjectedBundleBackForwardListItem::item (this=0x0) at ../../Source/WebKit/WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:49
> #3  0x00007f0e051bc367 in WKBundleBackForwardListItemIsSame (itemRef1=0x7f0d8d188480, itemRef2=0x0) at ../../Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:42
> #4  0x00007f0da5be09d9 in WTR::InjectedBundlePage::dumpBackForwardList (this=0x55df182e90d0, stringBuilder=...) at ../../Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:1985
> #5  0x00007f0da5bcfae9 in WTR::InjectedBundle::dumpBackForwardListsForAllPages (this=0x55df179a7530, stringBuilder=...) at ../../Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:464
> #6  0x00007f0da5bdbaf5 in WTR::InjectedBundlePage::dump (this=0x55df17ba4fb0) at ../../Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:904
> #7  0x00007f0da5be0c91 in WTR::InjectedBundlePage::frameDidChangeLocation (this=0x55df182e90d0, frame=0x7f0d8d1d6078) at ../../Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:2033
> #8  0x00007f0da5bdbdd2 in WTR::InjectedBundlePage::didFinishLoadForFrame (this=0x55df182e90d0, frame=0x7f0d8d1d6078) at ../../Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:941
> #9  0x00007f0da5bda853 in WTR::InjectedBundlePage::didFinishLoadForFrame (page=0x7f0da62fac00, frame=0x7f0d8d1d6078, clientInfo=0x55df182e90d0) at ../../Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:568
> #10 0x00007f0e051b2a2a in (anonymous namespace)::InjectedBundlePageLoaderClient::didFinishLoadForFrame (this=0x55df1800c8c0, page=..., frame=..., userData=...) at ../../Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:150
> #11 0x00007f0e052b1b7b in (anonymous namespace)::WebFrameLoaderClient::dispatchDidFinishLoad (this=0x55df18062650) at ../../Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:600
> #12 0x00007f0e06ec3d58 in (anonymous namespace)::FrameLoader::checkLoadCompleteForThisFrame (this=0x55df182f8000) at ../../Source/WebCore/loader/FrameLoader.cpp:2397
> #13 0x00007f0e06ec4752 in (anonymous namespace)::FrameLoader::checkLoadComplete (this=0x55df182f8000) at ../../Source/WebCore/loader/FrameLoader.cpp:2537
> #14 0x00007f0e06e9312d in (anonymous namespace)::DocumentLoader::finishedLoading (this=0x7f0d8d1ad000) at ../../Source/WebCore/loader/DocumentLoader.cpp:434
> #15 0x00007f0e06e92d6e in (anonymous namespace)::DocumentLoader::notifyFinished (this=0x7f0d8d1ad000, resource=...) at ../../Source/WebCore/loader/DocumentLoader.cpp:379
> #16 0x00007f0e06f73a4c in (anonymous namespace)::CachedResource::checkNotify (this=0x7f0d8d1b3700) at ../../Source/WebCore/loader/cache/CachedResource.cpp:348
> #17 0x00007f0e06f73b4a in (anonymous namespace)::CachedResource::finishLoading (this=0x7f0d8d1b3700) at ../../Source/WebCore/loader/cache/CachedResource.cpp:364
> #18 0x00007f0e06f70068 in (anonymous namespace)::CachedRawResource::finishLoading (this=0x7f0d8d1b3700, data=0x7f0d8d1dcfc0) at ../../Source/WebCore/loader/cache/CachedRawResource.cpp:117
> #19 0x00007f0e06f2108e in (anonymous namespace)::SubresourceLoader::didFinishLoading (this=0x7f0de8773780, networkLoadMetrics=...) at ../../Source/WebCore/loader/SubresourceLoader.cpp:601
> #20 0x00007f0e051fdbf2 in (anonymous namespace)::WebResourceLoader::didFinishResourceLoad (this=0x7f0d8d1de8c0, networkLoadMetrics=...) at ../../Source/WebKit/WebProcess/Network/WebResourceLoader.cpp:150
> #21 0x00007f0e0543ac7c in IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::tuple<WebCore::NetworkLoadMetrics>, 0> (object=0x7f0d8d1de8c0, function=(void ((anonymous namespace)::WebResourceLoader::*)((anonymous namespace)::WebResourceLoader * const, const (anonymous namespace)::NetworkLoadMetrics &)) 0x7f0e051fdb42 <(anonymous namespace)::WebResourceLoader::didFinishResourceLoad((anonymous namespace)::NetworkLoadMetrics const&)>, args=...) at ../../Source/WebKit/Platform/IPC/HandleMessage.h:40
> #22 0x00007f0e0543a4d7 in IPC::callMemberFunction<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::tuple<WebCore::NetworkLoadMetrics> > (args=..., object=0x7f0d8d1de8c0, function=(void ((anonymous namespace)::WebResourceLoader::*)((anonymous namespace)::WebResourceLoader * const, const (anonymous namespace)::NetworkLoadMetrics &)) 0x7f0e051fdb42 <(anonymous namespace)::WebResourceLoader::didFinishResourceLoad((anonymous namespace)::NetworkLoadMetrics const&)>) at ../../Source/WebKit/Platform/IPC/HandleMessage.h:46
> #23 0x00007f0e05439c8a in IPC::handleMessage<Messages::WebResourceLoader::DidFinishResourceLoad, WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)> (decoder=..., object=0x7f0d8d1de8c0, function=(void ((anonymous namespace)::WebResourceLoader::*)((anonymous namespace)::WebResourceLoader * const, const (anonymous namespace)::NetworkLoadMetrics &)) 0x7f0e051fdb42 <(anonymous namespace)::WebResourceLoader::didFinishResourceLoad((anonymous namespace)::NetworkLoadMetrics const&)>) at ../../Source/WebKit/Platform/IPC/HandleMessage.h:126
> #24 0x00007f0e05439343 in (anonymous namespace)::WebResourceLoader::didReceiveWebResourceLoaderMessage (this=0x7f0d8d1de8c0, connection=..., decoder=...) at DerivedSources/WebKit/WebResourceLoaderMessageReceiver.cpp:65
> #25 0x00007f0e051e42db in (anonymous namespace)::NetworkProcessConnection::didReceiveMessage (this=0x7f0de87c9000, connection=..., decoder=...) at ../../Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp:69
> #26 0x00007f0e04dc1a04 in IPC::Connection::dispatchMessage (this=0x7f0de87e01f8, decoder=...) at ../../Source/WebKit/Platform/IPC/Connection.cpp:907
> #27 0x00007f0e04dc1b77 in IPC::Connection::dispatchMessage (this=0x7f0de87e01f8, message=std::unique_ptr<IPC::Decoder> containing 0x7f0de87c5410) at ../../Source/WebKit/Platform/IPC/Connection.cpp:934
> #28 0x00007f0e04dc1d7d in IPC::Connection::dispatchOneMessage (this=0x7f0de87e01f8) at ../../Source/WebKit/Platform/IPC/Connection.cpp:965
> #29 0x00007f0e04dc18b5 in IPC::Connection::<lambda()>::operator()(void) (__closure=0x7f0de87c60a8) at ../../Source/WebKit/Platform/IPC/Connection.cpp:901
> #30 0x00007f0e04dc812e in WTF::Function<void()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::unique_ptr<IPC::Decoder>)::<lambda()> >::call(void) (this=0x7f0de87c60a0) at DerivedSources/ForwardingHeaders/wtf/Function.h:101
> #31 0x00007f0e04c98c5a in WTF::Function<void()>::operator()(void) const (this=0x7ffee5441360) at DerivedSources/ForwardingHeaders/wtf/Function.h:56
> #32 0x00007f0df992b514 in WTF::RunLoop::performWork (this=0x7f0de87f9000) at ../../Source/WTF/wtf/RunLoop.cpp:123
> #33 0x00007f0df997bfd8 in WTF::RunLoop::<lambda(gpointer)>::operator()(gpointer) const (__closure=0x0, userData=0x7f0de87f9000) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:68
> #34 0x00007f0df997bffc in WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:70
> #35 0x00007f0df997bf78 in WTF::<lambda(GSource*, GSourceFunc, gpointer)>::operator()(GSource *, GSourceFunc, gpointer) const (__closure=0x0, source=0x55df179b1200, callback=0x7f0df997bfdf <WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer)>, userData=0x7f0de87f9000) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:45
> #36 0x00007f0df997bfa7 in WTF::<lambda(GSource*, GSourceFunc, gpointer)>::_FUN(GSource *, GSourceFunc, gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:46
> #37 0x00007f0dfb492c35 in g_main_dispatch () at /home/fujii/work/webkit/ga/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3148
> #38 g_main_context_dispatch () at /home/fujii/work/webkit/ga/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3813
> #39 0x00007f0dfb493000 in g_main_context_iterate () at /home/fujii/work/webkit/ga/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3886
> #40 0x00007f0dfb493312 in g_main_loop_run () at /home/fujii/work/webkit/ga/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:4082
> #41 0x00007f0df997c4e7 in WTF::RunLoop::run () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:96
> #42 0x00007f0e0571b414 in (anonymous namespace)::ChildProcessMain<WebKit::WebProcess, WebKit::WebProcessMain> (argc=3, argv=0x7ffee5441768) at ../../Source/WebKit/Shared/unix/ChildProcessMain.h:61
> #43 0x00007f0e0571b02f in (anonymous namespace)::WebProcessMainUnix (argc=3, argv=0x7ffee5441768) at ../../Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp:68
> #44 0x000055df161bba45 in main (argc=3, argv=0x7ffee5441768) at ../../Source/WebKit/WebProcess/EntryPoint/unix/WebProcessMain.cpp:52
Comment 5 Fujii Hironori 2018-02-19 19:17:15 PST
m_previousTestBackForwardListItem was null for the new window.
m_previousTestBackForwardListItem is initialized only for the main window in InjectedBundlePage::prepare.
This code has been added in Bug 42322.
Comment 6 Fujii Hironori 2018-02-19 19:34:18 PST
I think we have two choices of solutions:

1. Do null-check of m_previousTestBackForwardListItem
2. Remove m_previousTestBackForwardListItem.
   Call WKBundleBackForwardListClear in InjectedBundlePage::prepare.
   Rebaseline all expected.txt files.
Comment 7 Fujii Hironori 2018-02-19 19:39:12 PST
Created attachment 334228 [details]
Patch
Comment 8 Fujii Hironori 2018-02-19 19:46:12 PST
*** Bug 128458 has been marked as a duplicate of this bug. ***
Comment 9 Fujii Hironori 2018-02-20 18:17:12 PST
Hi Darin, can I ask you review this patch?
Comment 10 Fujii Hironori 2018-02-25 17:42:48 PST
Could anyone review?
Comment 11 WebKit Commit Bot 2018-02-25 18:50:35 PST
Comment on attachment 334228 [details]
Patch

Clearing flags on attachment: 334228

Committed r228984: <https://trac.webkit.org/changeset/228984>
Comment 12 WebKit Commit Bot 2018-02-25 18:50:36 PST
All reviewed patches have been landed.  Closing bug.