Bug 156077

Summary: inspector/heap/getRemoteObject.html is a flaky failure
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: Web InspectorAssignee: Devin Rousso <drousso>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, ddkilzer, drousso, graouts, inspector-bugzilla-changes, tsavell, webkit-bug-importer, yurys
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Mac   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=206903
Attachments:
Description Flags
Skip the test on GTK.
none
Patch none

Description Ryan Haddad 2016-03-31 12:01:26 PDT
<https://build.webkit.org/builders/Apple%20Yosemite%20Debug%20WK2%20(Tests)/builds/11119>
<https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=inspector%2Fheap%2FgetRemoteObject.html>

--- /Volumes/Data/slave/yosemite-debug-tests-wk2/build/layout-test-results/inspector/heap/getRemoteObject-expected.txt
+++ /Volumes/Data/slave/yosemite-debug-tests-wk2/build/layout-test-results/inspector/heap/getRemoteObject-actual.txt
@@ -10,7 +10,9 @@
 PASS: Should not have an error creating a snapshot.
 PASS: Should should include at least one 'Window' instance.
 PASS: Should not have an error getting remote object.
-Window
+function Window() {
+    [native code]
+}
 
 -- Running test case: GetRemoteObjectBadIdentifier
 PASS: Should not have an error creating a snapshot.
Comment 1 Radar WebKit Bug Importer 2016-03-31 12:07:05 PDT
<rdar://problem/25469998>
Comment 2 Alexey Proskuryakov 2016-04-12 13:55:56 PDT
*** Bug 156514 has been marked as a duplicate of this bug. ***
Comment 3 David Kilzer (:ddkilzer) 2016-04-12 13:57:14 PDT
Marked test as flakey:

Committed r199386  <http://trac.webkit.org/changeset/199386>
Comment 4 Alexey Proskuryakov 2016-04-12 13:57:28 PDT
It seems to have become more flaky recently, failing ~10% of time.
Comment 5 David Kilzer (:ddkilzer) 2016-04-12 14:04:02 PDT
Updated bug number:

Committed r199387  <http://trac.webkit.org/changeset/199387>
Comment 6 Truitt Savell 2019-10-23 16:14:20 PDT
Updated expectations for this test in https://trac.webkit.org/changeset/251507/webkit
because it is crashing now.
Comment 7 Yury Semikhatsky 2019-10-25 09:08:05 PDT
It is crashing intermittently on GTK as well:

Thread 1 (Thread 0x7f68b978d9c0 (LWP 81370)):
#0  0x00007f68c15e3f3e in WTFCrash () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#1  0x00007f68c1003500 in _ZN9Inspector20InjectedScriptModule14ensureInjectedEPNS_21InjectedScriptManagerERKNS_14InjectedScriptE.part.562 () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#2  0x00007f68c4bdeca7 in _ZN7WebCore20CommandLineAPIModule14injectIfNeededEPN9Inspector21InjectedScriptManagerERKNS1_14InjectedScriptE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#3  0x00007f68c0fb7998 in _ZN9Inspector21InjectedScriptManager17injectedScriptForEPN3JSC14JSGlobalObjectE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#4  0x00007f68c102969a in _ZN9Inspector18InspectorHeapAgent15getRemoteObjectERN3WTF6StringEiPKS2_RNS1_6RefPtrINS_8Protocol7Runtime12RemoteObjectENS1_13DumbPtrTraitsIS9_EEEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#5  0x00007f68c0fe739d in _ZN9Inspector21HeapBackendDispatcher15getRemoteObjectElON3WTF6RefPtrINS1_8JSONImpl6ObjectENS1_13DumbPtrTraitsIS4_EEEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#6  0x00007f68c0fc44c4 in _ZN9Inspector21HeapBackendDispatcher8dispatchElRKN3WTF6StringEONS1_3RefINS1_8JSONImpl6ObjectENS1_13DumbPtrTraitsIS7_EEEE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#7  0x00007f68c0fd1b89 in _ZN9Inspector17BackendDispatcher8dispatchERKN3WTF6StringE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#8  0x00007f68c3a3e853 in _ZN3IPC13handleMessageIN8Messages7WebPage26SendMessageToTargetBackendEN6WebKit7WebPageEMS5_FvRKN3WTF6StringES9_EEEvRNS_7DecoderEPT0_T1_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#9  0x00007f68c3a30c4b in _ZN6WebKit7WebPage24didReceiveWebPageMessageERN3IPC10ConnectionERNS1_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#10 0x00007f68c3b03043 in _ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#11 0x00007f68c3d43a66 in _ZN6WebKit10WebProcess17didReceiveMessageERN3IPC10ConnectionERNS1_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#12 0x00007f68c3afd0af in _ZN3IPC10Connection15dispatchMessageERNS_7DecoderE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#13 0x00007f68c3afe535 in _ZN3IPC10Connection15dispatchMessageESt10unique_ptrINS_7DecoderESt14default_deleteIS2_EE () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#14 0x00007f68c3aff63b in _ZN3IPC10Connection26dispatchOneIncomingMessageEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#15 0x00007f68c160066d in _ZN3WTF7RunLoop11performWorkEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#16 0x00007f68c165c179 in _ZZN3WTF7RunLoopC4EvENUlPvE_4_FUNES1_ () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#17 0x00007f68bcbaa6b8 in g_main_dispatch () at ../../Source/glib-2.58.1/glib/gmain.c:3182
#18 g_main_context_dispatch () at ../../Source/glib-2.58.1/glib/gmain.c:3847
#19 0x00007f68bcbaaa78 in g_main_context_iterate () at ../../Source/glib-2.58.1/glib/gmain.c:3920
#20 0x00007f68bcbaad62 in g_main_loop_run () at ../../Source/glib-2.58.1/glib/gmain.c:4116
#21 0x00007f68c165cc90 in _ZN3WTF7RunLoop3runEv () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18
#22 0x00007f68c3ed915d in _ZN6WebKit20AuxiliaryProcessMainINS_10WebProcessENS_14WebProcessMainEEEiiPPc () from /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#23 0x00007f68bb30509b in __libc_start_main (main=0x558393835b80 <main>, argc=4, argv=0x7fff83d57088, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff83d57078) at ../csu/libc-start.c:308
#24 0x0000558393835bfa in _start ()
Comment 8 Yury Semikhatsky 2019-10-25 09:16:06 PDT
Created attachment 381931 [details]
Skip the test on GTK.
Comment 9 Yury Semikhatsky 2019-10-25 09:42:49 PDT
(In reply to Alexey Proskuryakov from comment #4)
> It seems to have become more flaky recently, failing ~10% of time.

The source of flakiness is that snapshot.instancesWithClassName("Window",...) sometimes finds global Window object (expected) but sometimes it is native function Window. Looks like a problem with classifying heap objects in the snapshot as the latter one should probably be a Function.
Comment 10 WebKit Commit Bot 2019-10-25 10:53:52 PDT
The commit-queue encountered the following flaky tests while processing attachment 381931 [details]:

The commit-queue is continuing to process your patch.
Comment 11 WebKit Commit Bot 2019-10-25 10:53:59 PDT
The commit-queue encountered the following flaky tests while processing attachment 381931 [details]:

imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/integrity.html bug 203394 (author: ysuzuki@apple.com)
The commit-queue is continuing to process your patch.
Comment 12 WebKit Commit Bot 2019-10-25 15:37:53 PDT
Comment on attachment 381931 [details]
Skip the test on GTK.

Clearing flags on attachment: 381931

Committed r251606: <https://trac.webkit.org/changeset/251606>
Comment 13 WebKit Commit Bot 2019-10-25 15:37:54 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Yury Semikhatsky 2019-10-25 15:39:44 PDT
The patch didn't fix the test, it just skipped it on more platforms.
Comment 15 Devin Rousso 2020-01-17 13:53:01 PST
Created attachment 388087 [details]
Patch

I was not able to reproduce the crash or the text failure in release or debug with 1000 iterations each, but I can see how the text failure might happen, so I reworked the test a bit to make less assumptions.
Comment 16 WebKit Commit Bot 2020-01-20 13:00:40 PST
Comment on attachment 388087 [details]
Patch

Clearing flags on attachment: 388087

Committed r254835: <https://trac.webkit.org/changeset/254835>
Comment 17 WebKit Commit Bot 2020-01-20 13:00:42 PST
All reviewed patches have been landed.  Closing bug.