Bug 173760 - [WPE] Crash in wpe_view_backend_get_renderer_host_fd
Summary: [WPE] Crash in wpe_view_backend_get_renderer_host_fd
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-23 02:10 PDT by Carlos Garcia Campos
Modified: 2017-06-23 04:14 PDT (History)
2 users (show)

See Also:


Attachments
Patch (3.07 KB, patch)
2017-06-23 02:12 PDT, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-06-23 02:10:46 PDT
This can happen if views are created and destroyed quickly. The problem is that CompositingManagerProxy adds a message receiver but never removes it, so it's possible that the message arrives right after the view has been destroyed. This is happening most of the times running /wpe/WebKitAutomationSession/request-session that creates 3 web views in a row that are deleted when the test finishes. 

TEST: bin/TestWebKitAPI/WPE/TestAutomationSession... (pid=20138)
  /wpe/WebKitAutomationSession/request-session:                        
** (bin/TestWebKitAPI/WPE/TestAutomationSession:20138): WARNING **: Not enabling automation on WebKitWebContext because there's another context with automation enabled, only one is allowed
FAIL
GTester: last random seed: R02Sb82032fa981c69b9235fb7b2877ed160
(pid=20178)
FAIL: bin/TestWebKitAPI/WPE/TestAutomationSession

Do not worry abut the warnings, that's expected and handled, the test is failing because it's crashing after it finishes.
Comment 1 Carlos Garcia Campos 2017-06-23 02:11:04 PDT
Thread 1 "TestAutomationS" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff75d5a36 in wpe_view_backend_get_renderer_host_fd (backend=0x5555555bc0d0) at /home/cgarcia/src/git/WPEBackend/src/view-backend.c:102
#2  0x00007ffff49e8d16 in WebKit::CompositingManagerProxy::establishConnection(IPC::Attachment&) () from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#3  0x00007ffff4a610dd in WebKit::CompositingManagerProxy::didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder, std::default_delete<IPC::Encoder> >&) ()
   from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#4  0x00007ffff47b44a1 in IPC::MessageReceiverMap::dispatchSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder, std::default_delete<IPC::Encoder> >&) ()
   from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#5  0x00007ffff4870055 in WebKit::WebProcessProxy::didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder, std::default_delete<IPC::Encoder> >&) ()
   from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#6  0x00007ffff47afffd in IPC::Connection::dispatchSyncMessage(IPC::Decoder&) () from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#7  0x00007ffff47b00c5 in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) ()
   from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#8  0x00007ffff47b0fac in IPC::Connection::dispatchOneMessage() () from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#9  0x00007ffff6b4ddc5 in WTF::RunLoop::performWork() () from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#10 0x00007ffff6b8c0a9 in WTF::RunLoop::RunLoop()::{lambda(void*)#1}::_FUN(void*) () from /home/cgarcia/src/git/gnome/WebKit-WPE/WebKitBuild/Release/lib/libWPEWebKit.so.0
#11 0x00007ffff7b105aa in g_main_dispatch (context=0x5555555a0ca0) at gmain.c:3234
#12 g_main_context_dispatch (context=context@entry=0x5555555a0ca0) at gmain.c:3899
#13 0x00007ffff7b10928 in g_main_context_iterate (context=0x5555555a0ca0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3972
#14 0x00007ffff7b10c42 in g_main_loop_run (loop=0x555555582aa0) at gmain.c:4168
#15 0x00005555555588ea in AutomationTest::createTopLevelBrowsingContext(_WebKitWebView*) ()
#16 0x00005555555578ba in testAutomationSessionRequestSession(AutomationTest*, void const*) ()
#17 0x00007ffff7b361c9 in test_case_run (tc=0x55555559cc00) at gtestutils.c:2161
#18 g_test_run_suite_internal (suite=suite@entry=0x55555559b2c0, path=path@entry=0x0) at gtestutils.c:2244
#19 0x00007ffff7b36397 in g_test_run_suite_internal (suite=suite@entry=0x55555559b2a0, path=path@entry=0x0) at gtestutils.c:2256
#20 0x00007ffff7b36397 in g_test_run_suite_internal (suite=suite@entry=0x55555559b280, path=path@entry=0x0) at gtestutils.c:2256
#21 0x00007ffff7b3658e in g_test_run_suite (suite=0x55555559b280) at gtestutils.c:2332
#22 0x00007ffff7b365b1 in g_test_run () at gtestutils.c:1599
#23 0x00005555555570d4 in main ()
Comment 2 Carlos Garcia Campos 2017-06-23 02:12:49 PDT
Created attachment 313701 [details]
Patch
Comment 3 Carlos Garcia Campos 2017-06-23 02:15:41 PDT
I noticed this also fixed /wpe/WebKitWebView/session-state

TEST: bin/TestWebKitAPI/WPE/TestBackForwardList... (pid=20179)
  /wpe/BackForwardList/navigation:                                     OK
  /wpe/BackForwardList/list-limit-and-cache:                           Error receiving IPC message on socket 16 in process 20220: Connection reset by peer
OK
  /wpe/WebKitWebView/session-state:                                    FAIL
GTester: last random seed: R02S37699baee8511600deae59b41409503a
(pid=20289)
  /wpe/WebKitWebView/session-state-with-form-data:                     OK
  /wpe/WebKitWebView/navigation-after-session-restore:                 Error sending IPC message: Broken pipe
Error sending IPC message: Broken pipe
OK
FAIL: bin/TestWebKitAPI/WPE/TestBackForwardList
Comment 4 Carlos Garcia Campos 2017-06-23 04:14:56 PDT
Committed r218741: <http://trac.webkit.org/changeset/218741>