Bug 229657 - ASSERT(m_resourceTiming.networkLoadMetrics().isComplete() || m_resourceTiming.resourceLoadTiming().endTime()) is failing in PerformanceResourceTiming::responseEnd
Summary: ASSERT(m_resourceTiming.networkLoadMetrics().isComplete() || m_resourceTiming...
Status: RESOLVED DUPLICATE of bug 229751
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-29 13:32 PDT by Fujii Hironori
Modified: 2021-09-01 12:52 PDT (History)
4 users (show)

See Also:


Attachments
WIP patch (1.12 KB, patch)
2021-08-29 15:05 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
WIP patch (802 bytes, patch)
2021-08-31 19:45 PDT, Fujii Hironori
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-08-29 13:32:33 PDT
[curl] ASSERT(m_resourceTiming.networkLoadMetrics().isComplete() || m_resourceTiming.resourceLoadTiming().endTime()) is failing in PerformanceResourceTiming::responseEnd

1. Start WinCairo Debug WK2 MiniBrowser
2. Go to https://twitter.com
3. the assertion fails

ASSERTION FAILED: m_resourceTiming.networkLoadMetrics().isComplete() || m_resourceTiming.resourceLoadTiming().endTime()
C:\home\webkit\gc\Source\WebCore\page/PerformanceResourceTiming.cpp(225) : WebCore::PerformanceResourceTiming::responseEnd

Callstack:

> WTF.dll!WTFCrash() Line 321	C++
> WebKit2.dll!WTFCrashWithInfo(int __formal, const char * __formal, const char * __formal, int __formal) Line 704	C++
> WebKit2.dll!WebCore::PerformanceResourceTiming::responseEnd() Line 225	C++
> WebKit2.dll!WebCore::jsPerformanceResourceTiming_responseEndGetter(JSC::JSGlobalObject & lexicalGlobalObject, WebCore::JSPerformanceResourceTiming & thisObject) Line 412	C++
> WebKit2.dll!WebCore::IDLAttribute<WebCore::JSPerformanceResourceTiming>::get<&WebCore::jsPerformanceResourceTiming_responseEndGetter,3>(JSC::JSGlobalObject & lexicalGlobalObject, __int64 thisValue, JSC::PropertyName attributeName) Line 88	C++
> WebKit2.dll!WebCore::jsPerformanceResourceTiming_responseEnd(JSC::JSGlobalObject * lexicalGlobalObject, __int64 thisValue, JSC::PropertyName attributeName) Line 418	C++
> JavaScriptCore.dll!JSC::PropertySlot::customGetter(JSC::VM & vm, JSC::PropertyName propertyName) Line 47	C++
> JavaScriptCore.dll!JSC::PropertySlot::getValue(JSC::JSGlobalObject * globalObject, JSC::PropertyName propertyName) Line 408	C++
> JavaScriptCore.dll!JSC::JSValue::get(JSC::JSGlobalObject * globalObject, JSC::PropertyName propertyName, JSC::PropertySlot & slot) Line 950	C++
> JavaScriptCore.dll!JSC::LLInt::performLLIntGetByID(const JSC::Instruction * pc, JSC::CodeBlock * codeBlock, JSC::JSGlobalObject * globalObject, JSC::JSValue baseValue, const JSC::Identifier & ident, JSC::GetByIdModeMetadata & metadata) Line 771	C++
> JavaScriptCore.dll!llint_slow_path_get_by_id(JSC::CallFrame * callFrame, const JSC::Instruction * pc) Line 845	C++
> JavaScriptCore.dll!llint_entry()	Unknown
> 000000c55f0fd750()	Unknown
> 000000c55f0fd830()	Unknown
> 0000022a0fc0f078()	Unknown
> cccccccccccccccc()	Unknown
> 0000022a0fc0f073()	Unknown
Comment 1 Fujii Hironori 2021-08-29 15:04:35 PDT
This assertion failure is caused by the response of https://twitter.com/.

https://twitter.com/ is retrieved by ServiceWorker fetch.
ServiceWorkerFetchTask::didFinish sends a WebResourceLoader::DidFinishResourceLoad message with empty NetworkLoadMetrics.
Comment 2 Fujii Hironori 2021-08-29 15:05:23 PDT
Created attachment 436751 [details]
WIP patch
Comment 3 Fujii Hironori 2021-08-29 17:51:53 PDT
This assertion failure can be reproduced also by Mac Debug MiniBrowser.

1. Start Mac Debug MiniBrowser
2. Go to https://twitter.com/
3. Reload 2-4 times.
4. The assertion fails

Callstack:

Thread 1 Queue : com.apple.main-thread (serial)
#0	0x00000003ac92dcfe in ::WTFCrash() at /Volumes/Data/webkit/gb/Source/WTF/wtf/Assertions.cpp:321
#1	0x000000038af941fb in WTFCrashWithInfo(int, char const*, char const*, int) at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Assertions.h:703
#2	0x000000038f131a4e in WebCore::PerformanceResourceTiming::responseEnd() const at /Volumes/Data/webkit/gb/Source/WebCore/page/PerformanceResourceTiming.cpp:225
#3	0x000000038c2568af in WebCore::jsPerformanceResourceTiming_responseEndGetter(JSC::JSGlobalObject&, WebCore::JSPerformanceResourceTiming&) at /Volumes/Data/webkit/gb/WebKitBuild/Debug/DerivedSources/WebCore/JSPerformanceResourceTiming.cpp:412
#4	0x000000038c1b94bf in long long WebCore::IDLAttribute<WebCore::JSPerformanceResourceTiming>::get<&(WebCore::jsPerformanceResourceTiming_responseEndGetter(JSC::JSGlobalObject&, WebCore::JSPerformanceResourceTiming&)), (WebCore::CastedThisErrorBehavior)3>(JSC::JSGlobalObject&, long long, JSC::PropertyName) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSDOMAttribute.h:88
#5	0x000000038c1b936d in WebCore::jsPerformanceResourceTiming_responseEnd(JSC::JSGlobalObject*, long long, JSC::PropertyName) at /Volumes/Data/webkit/gb/WebKitBuild/Debug/DerivedSources/WebCore/JSPerformanceResourceTiming.cpp:417
#6	0x00000003ae794e1e in JSC::PropertySlot::customGetter(JSC::VM&, JSC::PropertyName) const at /Volumes/Data/webkit/gb/Source/JavaScriptCore/runtime/PropertySlot.cpp:47
#7	0x00000003acf97526 in JSC::PropertySlot::getValue(JSC::JSGlobalObject*, JSC::PropertyName) const at /Volumes/Data/webkit/gb/Source/JavaScriptCore/runtime/PropertySlot.h:408
#8	0x00000003ae34c1c5 in JSC::JSValue::get(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) const at /Volumes/Data/webkit/gb/Source/JavaScriptCore/runtime/JSCJSValueInlines.h:950
#9	0x00000003ae14185c in JSC::LLInt::performLLIntGetByID(JSC::Instruction const*, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&, JSC::GetByIdModeMetadata&) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:770
#10	0x00000003ae1415ea in ::llint_slow_path_get_by_id(JSC::CallFrame *, const JSC::Instruction *) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:844
#11	0x00000003acfbe056 in llint_entry at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:97
#12	0x00000003acfd6339 in llint_entry at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LowLevelInterpreter.asm:1097
#13	0x00000003acfd6339 in llint_entry at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LowLevelInterpreter.asm:1097
#14	0x00000003acfd7221 in llint_entry at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LowLevelInterpreter.asm:1097
#15	0x0000225f77161e36 in 0x225f77161e36 ()
#16	0x00000003acfb3290 in vmEntryToJavaScript at /Volumes/Data/webkit/gb/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:316
#17	0x00000003adf9b5cb in JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/jit/JITCodeInlines.h:42
#18	0x00000003adf9bd2c in JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/interpreter/Interpreter.cpp:903
#19	0x00000003ae39b3ad in JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/runtime/CallData.cpp:57
#20	0x00000003ae39b683 in JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/runtime/CallData.cpp:78
#21	0x00000003ae631121 in JSC::JSMicrotask::run(JSC::JSGlobalObject*) at /Volumes/Data/webkit/gb/Source/JavaScriptCore/runtime/JSMicrotask.cpp:93
#22	0x000000038d9d6dbe in WebCore::JSExecState::runTask(JSC::JSGlobalObject*, JSC::Microtask&) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSExecState.h:91
#23	0x000000038d9ddd6b in WebCore::JSMicrotaskCallback::call() at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSMicrotaskCallback.h:47
#24	0x000000038d9ddba4 in WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop(JSC::JSGlobalObject&, WTF::Ref<JSC::Microtask, WTF::RawPtrTraits<JSC::Microtask> >&&)::$_40::operator()() at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSDOMWindowBase.cpp:232
#25	0x000000038d9dda8e in WTF::Detail::CallableWrapper<WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop(JSC::JSGlobalObject&, WTF::Ref<JSC::Microtask, WTF::RawPtrTraits<JSC::Microtask> >&&)::$_40, void>::call() at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Function.h:53
#26	0x000000038afad6e2 in WTF::Function<void ()>::operator()() const at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Function.h:82
#27	0x000000038e18ffee in WebCore::EventLoopFunctionDispatchTask::execute() at /Volumes/Data/webkit/gb/Source/WebCore/dom/EventLoop.cpp:159
#28	0x000000038e1d94eb in WebCore::MicrotaskQueue::performMicrotaskCheckpoint() at /Volumes/Data/webkit/gb/Source/WebCore/dom/Microtasks.cpp:64
#29	0x000000038e1849a1 in WebCore::EventLoop::performMicrotaskCheckpoint() at /Volumes/Data/webkit/gb/Source/WebCore/dom/EventLoop.cpp:51
#30	0x000000038e185f5d in WebCore::EventLoopTaskGroup::performMicrotaskCheckpoint() at /Volumes/Data/webkit/gb/Source/WebCore/dom/EventLoop.cpp:180
#31	0x000000038d97edfe in WebCore::JSExecState::didLeaveScriptContext(JSC::JSGlobalObject*) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSExecState.cpp:42
#32	0x000000038d98b112 in WebCore::JSExecState::~JSExecState() at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSExecState.h:143
#33	0x000000038d98af35 in WebCore::JSExecState::~JSExecState() at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSExecState.h:132
#34	0x000000038da2b609 in WebCore::JSExecState::profiledEvaluate(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/JSExecState.h:80
#35	0x000000038da2b1de in WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld&) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/ScriptController.cpp:148
#36	0x000000038da2b009 in WebCore::ScriptController::evaluateInWorldIgnoringException(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld&) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/ScriptController.cpp:121
#37	0x000000038da2b8e5 in WebCore::ScriptController::evaluateIgnoringException(WebCore::ScriptSourceCode const&) at /Volumes/Data/webkit/gb/Source/WebCore/bindings/js/ScriptController.cpp:167
#38	0x000000038e28e4fa in WebCore::ScriptElement::executeClassicScript(WebCore::ScriptSourceCode const&) at /Volumes/Data/webkit/gb/Source/WebCore/dom/ScriptElement.cpp:407
#39	0x000000038e1c5e90 in WebCore::LoadableClassicScript::execute(WebCore::ScriptElement&) at /Volumes/Data/webkit/gb/Source/WebCore/dom/LoadableClassicScript.cpp:124
#40	0x000000038e28f1ea in WebCore::ScriptElement::executeScriptAndDispatchEvent(WebCore::LoadableScript&) at /Volumes/Data/webkit/gb/Source/WebCore/dom/ScriptElement.cpp:449
#41	0x000000038e28f3bd in WebCore::ScriptElement::executePendingScript(WebCore::PendingScript&) at /Volumes/Data/webkit/gb/Source/WebCore/dom/ScriptElement.cpp:462
#42	0x000000038e294b6e in WebCore::ScriptRunner::timerFired() at /Volumes/Data/webkit/gb/Source/WebCore/dom/ScriptRunner.cpp:138
#43	0x000000038e2b2de7 in decltype(*(std::__1::forward<WebCore::ScriptRunner*&>(fp0)).*fp()) std::__1::__invoke<void (WebCore::ScriptRunner::*&)(), WebCore::ScriptRunner*&, void>(void (WebCore::ScriptRunner::*&)(), WebCore::ScriptRunner*&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/type_traits:3688
#44	0x000000038e2b2d60 in std::__1::__bind_return<void (WebCore::ScriptRunner::*)(), std::__1::tuple<WebCore::ScriptRunner*>, std::__1::tuple<>, __is_valid_bind_return<void (WebCore::ScriptRunner::*)(), std::__1::tuple<WebCore::ScriptRunner*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (WebCore::ScriptRunner::*)(), std::__1::tuple<WebCore::ScriptRunner*>, 0ul, std::__1::tuple<> >(void (WebCore::ScriptRunner::*&)(), std::__1::tuple<WebCore::ScriptRunner*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/functional:2852
#45	0x000000038e2b2d19 in std::__1::__bind_return<void (WebCore::ScriptRunner::*)(), std::__1::tuple<WebCore::ScriptRunner*>, std::__1::tuple<>, __is_valid_bind_return<void (WebCore::ScriptRunner::*)(), std::__1::tuple<WebCore::ScriptRunner*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (WebCore::ScriptRunner::*&)(), WebCore::ScriptRunner*>::operator()<>() at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/functional:2885
#46	0x000000038e2b2c9e in WTF::Detail::CallableWrapper<std::__1::__bind<void (WebCore::ScriptRunner::*&)(), WebCore::ScriptRunner*>, void>::call() at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Function.h:53
#47	0x000000038afad6e2 in WTF::Function<void ()>::operator()() const at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Function.h:82
#48	0x000000038aff5cce in WebCore::Timer::fired() at /Volumes/Data/webkit/gb/Source/WebCore/platform/Timer.h:135
#49	0x000000038f2da634 in WebCore::ThreadTimers::sharedTimerFiredInternal() at /Volumes/Data/webkit/gb/Source/WebCore/platform/ThreadTimers.cpp:127
#50	0x000000038f2e5311 in WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0::operator()() const at /Volumes/Data/webkit/gb/Source/WebCore/platform/ThreadTimers.cpp:67
#51	0x000000038f2e529e in WTF::Detail::CallableWrapper<WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0, void>::call() at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Function.h:53
#52	0x000000038afad6e2 in WTF::Function<void ()>::operator()() const at /Volumes/Data/webkit/gb/WebKitBuild/Debug/usr/local/include/wtf/Function.h:82
#53	0x000000038f28912b in WebCore::MainThreadSharedTimer::fired() at /Volumes/Data/webkit/gb/Source/WebCore/platform/MainThreadSharedTimer.cpp:83
#54	0x000000038f371296 in WebCore::timerFired(__CFRunLoopTimer*, void*) at /Volumes/Data/webkit/gb/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp:85
#55	0x00007fff204fe279 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ ()
#56	0x00007fff204fdd6d in __CFRunLoopDoTimer ()
#57	0x00007fff204fd8ca in __CFRunLoopDoTimers ()
#58	0x00007fff204e44a3 in __CFRunLoopRun ()
#59	0x00007fff204e361c in CFRunLoopRunSpecific ()
#60	0x00007fff21273607 in -[NSRunLoop(NSRunLoop) runMode:beforeDate:] ()
#61	0x00007fff213014d1 in -[NSRunLoop(NSRunLoop) run] ()
#62	0x00007fff2013b38d in _xpc_objc_main ()
#63	0x00007fff2013acd3 in xpc_main ()
#64	0x0000000378f12055 in WebKit::XPCServiceMain(int, char const**) at /Volumes/Data/webkit/gb/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:243
#65	0x000000037a74263b in WKXPCServiceMain at /Volumes/Data/webkit/gb/Source/WebKit/Shared/API/Cocoa/WKMain.mm:33
#66	0x000000010f98cea2 in main at /Volumes/Data/webkit/gb/Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:30
#67	0x00007fff20407f3d in start ()
#68	0x00007fff20407f3d in start ()
Comment 4 Alex Christensen 2021-08-30 10:55:33 PDT
I think a better fix would be to mark the end time.  Is the start time also empty?
Comment 5 Fujii Hironori 2021-08-30 23:51:21 PDT
m_resourceTiming.m_resourceLoadTiming.m_startTime isn't empty.
Comment 6 Fujii Hironori 2021-08-31 19:45:23 PDT
Created attachment 436987 [details]
WIP patch

The end time is marked because DocumentLoader::notifyFinished calls addNavigationTiming before DocumentLoader::finishedLoading does markEndTime.
Comment 7 Alex Christensen 2021-09-01 00:09:13 PDT
Does https://bugs.webkit.org/show_bug.cgi?id=229751 fix this too?
Comment 8 Fujii Hironori 2021-09-01 00:30:38 PDT
Yes, it does. Thank you.
Comment 9 Fujii Hironori 2021-09-01 12:52:42 PDT

*** This bug has been marked as a duplicate of bug 229751 ***