<?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>248293</bug_id>
          
          <creation_ts>2022-11-23 16:01:22 -0800</creation_ts>
          <short_desc>Uninitialized memory read when opening web inspector</short_desc>
          <delta_ts>2022-11-24 07:47:17 -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>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=209468</see_also>
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1914390</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-23 16:01:22 -0800</bug_when>
    <thetext>This looks identical to bug #209468. Seems it was not fixed after all. Happens when opening the web inspector. Pretty sure the bug is that WebPageInspectorController::m_enabledBrowserAgent is not initially initialized to anything, so it&apos;s invalid to call InspectorBrowserAgent::enabled before InspectorBrowserAgent::enable or InspectorBrowserAgent::disable has been called. Let&apos;s hope that&apos;s the only problem here....

==573540== Conditional jump or move depends on uninitialised value(s)
==573540==    at 0x6D452DB: non-virtual thunk to WebKit::InspectorBrowserAgent::enable() (InspectorBrowserAgent.h:50)
==573540==    by 0xADBBDD0: Inspector::BrowserBackendDispatcher::enable(long, WTF::RefPtr&lt;WTF::JSONImpl::Object, WTF::RawPtrTraits&lt;WTF::JSONImpl::Object&gt;, WTF::DefaultRefDerefTraits&lt;WTF::JSONImpl::Object&gt; &gt;&amp;&amp;) (InspectorBackendDispatchers.cpp:566)
==573540==    by 0xADBC127: Inspector::BrowserBackendDispatcher::dispatch(long, WTF::String const&amp;, WTF::Ref&lt;WTF::JSONImpl::Object, WTF::RawPtrTraits&lt;WTF::JSONImpl::Object&gt; &gt;&amp;&amp;) (InspectorBackendDispatchers.cpp:546)
==573540==    by 0xADEBFF5: Inspector::BackendDispatcher::dispatch(WTF::String const&amp;) (InspectorBackendDispatcher.cpp:183)
==573540==    by 0x6954B05: operator()&lt;WTF::String&gt; (HandleMessage.h:133)
==573540==    by 0x6954B05: __invoke_impl&lt;void, IPC::callMemberFunction&lt;WebKit::WebInspectorUIProxy, WebKit::WebInspectorUIProxy, void(const WTF::String&amp;), std::tuple&lt;WTF::String&gt; &gt;(WebKit::WebInspectorUIProxy*, void (WebKit::WebInspectorUIProxy::*)(const WTF::String&amp;), std::tuple&lt;WTF::String&gt;&amp;&amp;)::&lt;lambda(auto:60&amp;&amp; ...)&gt;, WTF::String&gt; (invoke.h:61)
==573540==    by 0x6954B05: __invoke&lt;IPC::callMemberFunction&lt;WebKit::WebInspectorUIProxy, WebKit::WebInspectorUIProxy, void(const WTF::String&amp;), std::tuple&lt;WTF::String&gt; &gt;(WebKit::WebInspectorUIProxy*, void (WebKit::WebInspectorUIProxy::*)(const WTF::String&amp;), std::tuple&lt;WTF::String&gt;&amp;&amp;)::&lt;lambda(auto:60&amp;&amp; ...)&gt;, WTF::String&gt; (invoke.h:96)
==573540==    by 0x6954B05: __apply_impl&lt;IPC::callMemberFunction&lt;WebKit::WebInspectorUIProxy, WebKit::WebInspectorUIProxy, void(const WTF::String&amp;), std::tuple&lt;WTF::String&gt; &gt;(WebKit::WebInspectorUIProxy*, void (WebKit::WebInspectorUIProxy::*)(const WTF::String&amp;), std::tuple&lt;WTF::String&gt;&amp;&amp;)::&lt;lambda(auto:60&amp;&amp; ...)&gt;, std::tuple&lt;WTF::String&gt;, 0&gt; (tuple:1852)
==573540==    by 0x6954B05: apply&lt;IPC::callMemberFunction&lt;WebKit::WebInspectorUIProxy, WebKit::WebInspectorUIProxy, void(const WTF::String&amp;), std::tuple&lt;WTF::String&gt; &gt;(WebKit::WebInspectorUIProxy*, void (WebKit::WebInspectorUIProxy::*)(const WTF::String&amp;), std::tuple&lt;WTF::String&gt;&amp;&amp;)::&lt;lambda(auto:60&amp;&amp; ...)&gt;, std::tuple&lt;WTF::String&gt; &gt; (tuple:1863)
==573540==    by 0x6954B05: callMemberFunction&lt;WebKit::WebInspectorUIProxy, WebKit::WebInspectorUIProxy, void(const WTF::String&amp;), std::tuple&lt;WTF::String&gt; &gt; (HandleMessage.h:131)
==573540==    by 0x6954B05: handleMessage&lt;Messages::WebInspectorUIProxy::SendMessageToBackend, WebKit::WebInspectorUIProxy, WebKit::WebInspectorUIProxy, void(const WTF::String&amp;)&gt; (HandleMessage.h:213)
==573540==    by 0x6954B05: WebKit::WebInspectorUIProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (WebInspectorUIProxyMessageReceiver.cpp:57)
==573540==    by 0x6B571B7: IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (MessageReceiverMap.cpp:129)
==573540==    by 0x6C028B1: WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) (WebProcessProxy.cpp:883)
==573540==    by 0x6B5011C: IPC::Connection::dispatchMessage(std::unique_ptr&lt;IPC::Decoder, std::default_delete&lt;IPC::Decoder&gt; &gt;) (Connection.cpp:1242)
==573540==    by 0x6B51BEB: IPC::Connection::dispatchIncomingMessages() [clone .part.0] (Connection.cpp:1358)
==573540==    by 0xB68A75D: operator() (Function.h:82)
==573540==    by 0xB68A75D: WTF::RunLoop::performWork() (RunLoop.cpp:146)
==573540==    by 0xB6E61B8: WTF::RunLoop::RunLoop()::{lambda(void*)#1}::_FUN(void*) (RunLoopGLib.cpp:80)
==573540==    by 0xB6E6B0E: operator() (RunLoopGLib.cpp:53)
==573540==    by 0xB6E6B0E: WTF::RunLoop::{lambda(_GSource*, int (*)(void*), void*)#1}::_FUN(_GSource*, int (*)(void*), void*) (RunLoopGLib.cpp:56)
==573540==  Uninitialised value was created by a heap allocation
==573540==    at 0x484286F: malloc (vg_replace_malloc.c:393)
==573540==    by 0xB6F26DF: pas_debug_heap_allocate (pas_debug_heap.h:101)
==573540==    by 0xB6F26DF: pas_try_allocate_intrinsic_impl_casual_case (pas_try_allocate_intrinsic.h:104)
==573540==    by 0xB6F26DF: bmalloc_allocate_impl_casual_case.constprop.0 (bmalloc_heap_inlines.h:70)
==573540==    by 0xB6F2998: bmalloc_allocate_casual (bmalloc_heap.c:64)
==573540==    by 0x6C53452: operator new (WebPageInspectorController.h:49)
==573540==    by 0x6C53452: make_unique&lt;WebKit::WebPageInspectorController, WebKit::WebPageProxy&amp;&gt; (unique_ptr.h:1065)
==573540==    by 0x6C53452: makeUnique&lt;WebKit::WebPageInspectorController, WebKit::WebPageProxy&amp;&gt; (StdLibExtras.h:570)
==573540==    by 0x6C53452: WebKit::WebPageProxy::WebPageProxy(WebKit::PageClient&amp;, WebKit::WebProcessProxy&amp;, WTF::Ref&lt;API::PageConfiguration, WTF::RawPtrTraits&lt;API::PageConfiguration&gt; &gt;&amp;&amp;) (WebPageProxy.cpp:525)
==573540==    by 0x6C63DD1: create (WebPageProxy.cpp:473)
==573540==    by 0x6C63DD1: createWebPage (WebProcessProxy.cpp:609)
==573540==    by 0x6C63DD1: WebKit::WebProcessPool::createWebPage(WebKit::PageClient&amp;, WTF::Ref&lt;API::PageConfiguration, WTF::RawPtrTraits&lt;API::PageConfiguration&gt; &gt;&amp;&amp;) (WebProcessPool.cpp:1107)
==573540==    by 0x6D141B1: webkitWebViewBaseCreateWebPage(_WebKitWebViewBase*, WTF::Ref&lt;API::PageConfiguration, WTF::RawPtrTraits&lt;API::PageConfiguration&gt; &gt;&amp;&amp;) (WebKitWebViewBase.cpp:2333)
==573540==    by 0x6CEE7C8: webkitWebContextCreatePageForWebView(_WebKitWebContext*, _WebKitWebView*, _WebKitUserContentManager*, _WebKitWebView*, _WebKitWebsitePolicies*) (WebKitWebContext.cpp:1994)
==573540==    by 0x6CFABC6: webkitWebViewConstructed(_GObject*) (WebKitWebView.cpp:747)
==573540==    by 0x4938BA9: ephy_web_view_constructed (ephy-web-view.c:3944)
==573540==    by 0x4A1249C: g_object_new_internal (gobject.c:2279)
==573540==    by 0x4A1324C: g_object_new_valist (gobject.c:2567)
==573540==    by 0x4A11D86: g_object_new (gobject.c:2040)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914391</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-23 16:06:38 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; Let&apos;s hope that&apos;s the only
&gt; problem here....

It is. Errors are gone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914395</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-23 16:12:20 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6775</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914396</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-23 16:12:26 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #0)
&gt; so it&apos;s invalid to call
&gt; InspectorBrowserAgent::enabled before InspectorBrowserAgent::enable or
&gt; InspectorBrowserAgent::disable has been called.

Well, not quite, because both these functions themselves call InspectorBrowserAgent::enabled. So InspectorBrowserAgent::enable and InspectorBrowserAgent::disable may fail spuriously.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914485</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-24 07:46:07 -0800</bug_when>
    <thetext>Committed 256990@main (138c1e2a317b): &lt;https://commits.webkit.org/256990@main&gt;

Reviewed commits have been landed. Closing PR #6775 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1914487</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-24 07:47:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/102648412&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>