<?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>207933</bug_id>
          
          <creation_ts>2020-02-19 03:38:51 -0800</creation_ts>
          <short_desc>[Linux] StackTrace symbols are not demangled</short_desc>
          <delta_ts>2020-02-25 01:20: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 Template Framework</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="Philippe Normand">pnormand</reporter>
          <assigned_to name="Philippe Normand">pnormand</assigned_to>
          <cc>benjamin</cc>
    
    <cc>cdumez</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>dbates</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1620621</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-02-19 03:38:51 -0800</bug_when>
    <thetext>The demangle() function should be called when BACKTRACE_SYMBOLS is enabled as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1620623</commentid>
    <comment_count>1</comment_count>
      <attachid>391151</attachid>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-02-19 03:47:00 -0800</bug_when>
    <thetext>Created attachment 391151
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1622074</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-02-24 01:06:30 -0800</bug_when>
    <thetext>Traces are incomplete in WPE because BACKTRACE_SYMBOLS is disabled, we have traces like this:

  1   0x7f9be067c7e4 webkitWebViewLoadFailed(_WebKitWebView*, WebKitLoadEvent, char const*, _GError*)
    2   0x7f9be0650e31 NavigationClient::didFailProvisionalNavigationWithError(WebKit::WebPageProxy&amp;, WebKit::WebFrameProxy&amp;, API::Navigation*, WebCore::ResourceError const&amp;, API::Object*)
    3   0x7f9be05929d0 WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared(WTF::Ref&lt;WebKit::WebProcessProxy, WTF::DumbPtrTraits&lt;WebKit::WebProcessProxy&gt; &gt;&amp;&amp;, WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)
    4   0x7f9be05ce0f3 WebKit::WebPageProxy::didFailProvisionalLoadForFrame(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)
    5   0x7f9be02ff0de void IPC::handleMessage&lt;Messages::WebPageProxy::DidFailProvisionalLoadForFrame, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)&gt;(IPC::Decoder&amp;, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;))
    6   0x7f9be02d6744 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    7   0x7f9be04b1f8a IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    8   0x7f9be0589d2f non-virtual thunk to WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    9   0x7f9be04aaca0 IPC::Connection::dispatchMessage(IPC::Decoder&amp;)
    10  0x7f9be04ac075 IPC::Connection::dispatchMessage(std::unique_ptr&lt;IPC::Decoder, std::default_delete&lt;IPC::Decoder&gt; &gt;)
    11  0x7f9be04ac90f IPC::Connection::dispatchIncomingMessages()
    12  0x7f9bde091e49 WTF::RunLoop::performWork()
    13  0x7f9bde0f32f9
    14  0x7f9be4a3858e g_main_context_dispatch
    15  0x7f9be4a38940
    16  0x7f9be4a38c33 g_main_loop_run
    17  0x55847d369de9
    18  0x7f9be4a60cae
    19  0x7f9be4a60a54
    20  0x7f9be4a60a54
    21  0x7f9be4a6115b g_test_run_suite
    22  0x7f9be4a611b5 g_test_run
    23  0x55847d368fea
    24  0x7f9bd9849173 __libc_start_main
    25  0x55847d36915e

With backtrace_symbols enabled we&apos;d get:

1   0x7f184b80e074 webkitWebViewLoadFailed(_WebKitWebView*, WebKitLoadEvent, char const*, _GError*)
    2   0x7f184b7e26c1 NavigationClient::didFailProvisionalNavigationWithError(WebKit::WebPageProxy&amp;, WebKit::WebFrameProxy&amp;, API::Navigation*, WebCore::ResourceError const&amp;, API::Object*)
    3   0x7f184b72556d WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared(WTF::Ref&lt;WebKit::WebProcessProxy, WTF::DumbPtrTraits&lt;WebKit::WebProcessProxy&gt; &gt;&amp;&amp;, WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)
    4   0x7f184b760633 WebKit::WebPageProxy::didFailProvisionalLoadForFrame(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)
    5   0x7f184b4ac0b0 void IPC::handleMessage&lt;Messages::WebPageProxy::DidFailProvisionalLoadForFrame, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)&gt;(IPC::Decoder&amp;, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;))
    6   0x7f184b4874e7 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    7   0x7f184b65749a IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    8   0x7f184b71cdaf non-virtual thunk to WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    9   0x7f184b6501b0 IPC::Connection::dispatchMessage(IPC::Decoder&amp;)
    10  0x7f184b651585 IPC::Connection::dispatchMessage(std::unique_ptr&lt;IPC::Decoder, std::default_delete&lt;IPC::Decoder&gt; &gt;)
    11  0x7f184b651e1f IPC::Connection::dispatchIncomingMessages()
    12  0x7f184969bea9 WTF::RunLoop::performWork()
    13  0x7f18496fd399 /app/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18(+0x1442399) [0x7f18496fd399]
    14  0x7f184f20b52e g_main_context_dispatch
    15  0x7f184f20b8e0 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x538e0) [0x7f184f20b8e0]
    16  0x7f184f20bbd3 g_main_loop_run
    17  0x560c97e9ada9 /app/webkit/WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestSSL(+0x6da9) [0x560c97e9ada9]
    18  0x7f184f233a5e /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x7ba5e) [0x7f184f233a5e]
    19  0x7f184f233804 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x7b804) [0x7f184f233804]
    20  0x7f184f233804 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x7b804) [0x7f184f233804]
    21  0x7f184f233f0b g_test_run_suite
    22  0x7f184f233f65 g_test_run
    23  0x560c97e99faa /app/webkit/WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestSSL(+0x5faa) [0x560c97e99faa]
    24  0x7f184517c173 __libc_start_main
    25  0x560c97e9a11e /app/webkit/WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestSSL(+0x611e) [0x560c97e9a11e]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1622292</commentid>
    <comment_count>3</comment_count>
      <attachid>391151</attachid>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-02-24 13:36:40 -0800</bug_when>
    <thetext>Comment on attachment 391151
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=391151&amp;action=review

&gt; Source/WTF/wtf/StackTrace.cpp:141
&gt;          auto demangled = demangle(stack[i]);
&gt;          if (demangled) {
&gt;              mangledName = demangled-&gt;mangledName();
&gt;              cxaDemangled = demangled-&gt;demangledName();
&gt;          }

If it works, why do we have `HAVE(BACKTRACE_SYMBOLS)` path? It looks like we should always use DLADDR path when we have BACKTRACE_SYMBOLS too.
Can we just remove BACKTRACE_SYMBOLS code?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1622303</commentid>
    <comment_count>4</comment_count>
      <attachid>391151</attachid>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-02-24 13:48:58 -0800</bug_when>
    <thetext>Comment on attachment 391151
Patch

Ah, I&apos;ve missed your comment. OK, dladdr cannot work well if the code is JIT, and HAVE(BACKTRACE_SYMBOLS) can fill some cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1622536</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-02-25 01:19:40 -0800</bug_when>
    <thetext>Committed r257298: &lt;https://trac.webkit.org/changeset/257298&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1622537</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-02-25 01:20:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/59758165&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>391151</attachid>
            <date>2020-02-19 03:47:00 -0800</date>
            <delta_ts>2020-02-24 13:48:58 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-207933-20200219114658.patch</filename>
            <type>text/plain</type>
            <size>1883</size>
            <attacher name="Philippe Normand">pnormand</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjU2OTE2CmRpZmYgLS1naXQgYS9Tb3VyY2UvV1RGL0NoYW5n
ZUxvZyBiL1NvdXJjZS9XVEYvQ2hhbmdlTG9nCmluZGV4IGRiODY1MTRkNjhmZWQ3MWEzNTA3MzAx
NTVkMTY5YTIxNzZjMGZiMmUuLjJmN2M2NzQyN2IzMmNmZDMxYzYyMDlhMGVjNjZiZmJmMDhmM2Zj
YzAgMTAwNjQ0Ci0t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XMlLTNkICVwICVzXG4iLCBpbmRlbnRTdHJpbmcsIGZyYW1lTnVt
YmVyLCBzdGFja1tpXSwgY3hhRGVtYW5nbGVkID8gY3hhRGVtYW5nbGVkIDogbWFuZ2xlZE5hbWUp
Owo=
</data>
<flag name="review"
          id="406715"
          type_id="1"
          status="+"
          setter="ysuzuki"
    />
          </attachment>
      

    </bug>

</bugzilla>