<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>276266</bug_id>
          
          <creation_ts>2024-07-05 13:51:19 -0700</creation_ts>
          <short_desc>[WebDriver] MessageReceiverMap assertion failure for WebAutomationSessionProxy messages in debug builds</short_desc>
          <delta_ts>2025-01-21 14:29:23 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Lauro Moura">lmoura</assigned_to>
          <cc>bburg</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2044864</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2024-07-05 13:51:19 -0700</bug_when>
    <thetext>WPE WebDriver debug builds are hitting an assertion in the WPEWebProcess when processing messages:

ASSERTION FAILED: !decoder.destinationID()
&lt;snip WTF headers&gt;
#2  0x0000750e2a6fafbe in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (this=0x750e0d038138, connection=..., decoder=...) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:122
#3  0x0000750e2ae01f1c in WebKit::WebProcess::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (this=0x750e0d038100, connection=..., decoder=...) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/WebProcess/WebProcess.cpp:967
&lt;snip&gt;

Context of the assertion:

bool MessageReceiverMap::dispatchMessage(Connection&amp; connection, Decoder&amp; decoder)
{
    if (auto messageReceiver = m_globalMessageReceivers.get(decoder.messageReceiverName())) {
        ASSERT(!decoder.destinationID());

This happens at least for both `WebAutomationSessionProxy::EvaluateJavaScriptFunction` and `WebAutomationSessionProxy::TakeScreenshot` messages.

Looks like the WebAutomationSessionProxy receiver, while being stored on the globals receiver map, is being sent messages containing a destination ID.

Full trace:

#0  WTFCrash() () at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/Assertions.cpp:350
#1  0x0000750e29877a6a in WTFCrashWithInfo(int, char const*, char const*, int) () at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/WebKitBuild/WPE/Debug/WTF/Headers/wtf/Assertions.h:845
#2  0x0000750e2a6fafbe in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (this=0x750e0d038138, connection=..., decoder=...) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:122
#3  0x0000750e2ae01f1c in WebKit::WebProcess::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (this=0x750e0d038100, connection=..., decoder=...) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/WebProcess/WebProcess.cpp:967
#4  0x0000750e2a6cee59 in IPC::Connection::dispatchMessage(IPC::Decoder&amp;) (this=0x750e0d064200, decoder=...) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Platform/IPC/Connection.cpp:1332
#5  0x0000750e2a6cf0ac in IPC::Connection::dispatchMessage(WTF::UniqueRef&lt;IPC::Decoder&gt;) (this=0x750e0d064200, message=...) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Platform/IPC/Connection.cpp:1380
#6  0x0000750e2a6cf599 in IPC::Connection::dispatchOneIncomingMessage() (this=0x750e0d064200) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Platform/IPC/Connection.cpp:1445
#7  0x0000750e2a6cea86 in operator()() const (__closure=0x750e0d0681e8) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Platform/IPC/Connection.cpp:1294
#8  0x0000750e2a6f8282 in WTF::Detail::CallableWrapper&lt;IPC::Connection::enqueueIncomingMessage(WTF::UniqueRef&lt;IPC::Decoder&gt;)::&lt;lambda()&gt;, void&gt;::call(void) (this=0x750e0d0681e0) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/WebKitBuild/WPE/Debug/WTF/Headers/wtf/Function.h:53
#9  0x0000750e2a1ff1f4 in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7ffc400ad670) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/WebKitBuild/WPE/Debug/WTF/Headers/wtf/Function.h:82
#10 0x0000750e2d91cbe9 in WTF::RunLoop::performWork() (this=0x750e0d01c0c0) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/RunLoop.cpp:147
#11 0x0000750e2d9e17f8 in operator()(gpointer) const (__closure=0x0, userData=0x750e0d01c0c0) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#12 0x0000750e2d9e1820 in _FUN(gpointer) () at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/glib/RunLoopGLib.cpp:82
#13 0x0000750e2d9e1727 in operator()(GSource*, GSourceFunc, gpointer) const (__closure=0x0, source=0x642cf09471a0, callback=0x750e2d9e17ff &lt;_FUN(gpointer)&gt;, userData=0x750e0d01c0c0) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/glib/RunLoopGLib.cpp:53
#14 0x0000750e2d9e1779 in _FUN(GSource*, GSourceFunc, gpointer) () at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/glib/RunLoopGLib.cpp:56
#15 0x0000750e1e5143df in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x0000750e1e56f2f8 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x0000750e1e513c4f in g_main_loop_run () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x0000750e2d9e1e9d in WTF::RunLoop::run() () at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WTF/wtf/glib/RunLoopGLib.cpp:108
#19 0x0000750e2b2afbc9 in WebKit::AuxiliaryProcessMainBase&lt;WebKit::WebProcess, true&gt;::run(int, char**) (this=0x7ffc400ad920, argc=3, argv=0x7ffc400adad8) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Shared/AuxiliaryProcessMain.h:72
#20 0x0000750e2b2af7c7 in WebKit::AuxiliaryProcessMain&lt;WebKit::WebProcessMainWPE&gt;(int, char**) (argc=3, argv=0x7ffc400adad8) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/Shared/AuxiliaryProcessMain.h:98
#21 0x0000750e2b2af584 in WebKit::WebProcessMain(int, char**) (argc=3, argv=0x7ffc400adad8) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp:83
#22 0x0000642cefd230ad in main(int, char**) (argc=3, argv=0x7ffc400adad8) at /home/lauro/wkdev-shared/dev/wk-webdriver/WebKit-WebDriver/Source/WebKit/WebProcess/EntryPoint/unix/WebProcessMain.cpp:31</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2087891</commentid>
    <comment_count>1</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-01-16 16:08:40 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/39158</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2088793</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-01-21 14:28:53 -0800</bug_when>
    <thetext>Committed 289203@main (22bf12a5c4f8): &lt;https://commits.webkit.org/289203@main&gt;

Reviewed commits have been landed. Closing PR #39158 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2088797</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-01-21 14:29:23 -0800</bug_when>
    <thetext>&lt;rdar://problem/143346554&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>