Bug 159919 - Not possible to GDB WebKitGtk+ 2.13.3: demangler-warning: unable to demangle
Summary: Not possible to GDB WebKitGtk+ 2.13.3: demangler-warning: unable to demangle
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-19 06:09 PDT by Andres Gomez Garcia
Modified: 2016-09-17 08:11 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gomez Garcia 2016-07-19 06:09:18 PDT
I'm using WebKitGtk+ with my own JHBuild setting:
https://github.com/tanty/jhbuild-epiphany/tree/master

Epiphany 3.20.3 and WebKit 2.13.3

I'm running Epiphany with the dconf key:

"process-model" = "shared-secondary-process"

The compilation was done with CMake args:

'-DPORT=GTK -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-O0 -g1 -DNDEBUG -DG_DISABLE_CAST_CHECKS" -DCMAKE_CXX_FLAGS_RELEASE="-O0 -g1 -DNDEBUG -DG_DISABLE_CAST_CHECKS"'

When trying to attach with gdb to any of the running processes (epiphany, WebKitNetworkProcess or WebKitWebProcess), I get:

/build/gdb-7.10/gdb/cp-support.c:1595: demangler-warning: unable to demangle '_ZSt7forwardIRZN6WebKit29NetworkConnectionToWebProcess26writeBlobsToTemporaryFilesERKN3WTF6VectorINS2_6StringELm0ENS2_15CrashOnOverflowELm16EEEmEUlRT_E_EOS9_RNSt16remove_referenceIS9_E4typeE' (demangler failed with signal 11)

And the only option is to exit the debugging session.
Comment 1 Andres Gomez Garcia 2016-07-19 06:11:10 PDT
Compilation and gdb done in current Debian Testing:

$ gdb --version
GNU gdb (Debian 7.10-1.1) 7.10

$ gcc --version
gcc (Debian 5.4.0-4) 5.4.0 20160609
Comment 2 Andres Gomez Garcia 2016-07-19 06:20:05 PDT
As a workaround in the meanwhile, it is possible to add:

set demangle-style none

Into ~/.gdbinit
Comment 3 Andres Gomez Garcia 2016-07-19 06:25:13 PDT
Reproducible also with:

$ gdb --version
GNU gdb (Debian 7.11.1-2) 7.11.1
Comment 4 Michael Catanzaro 2016-07-20 13:43:38 PDT
This is really annoying, but it's clearly a toolchain bug, not a WebKit issue. It's been reported with several different versions of gcc, so we can safely say it's a gdb issue.
Comment 5 Philippe Normand 2016-07-21 00:11:15 PDT
Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68383
Comment 6 Carlos Alberto Lopez Perez 2016-07-27 17:16:07 PDT
I think the issue is this one:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61321

I'm able to reproduce the issue with this test case that comes from <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68159#c4>:

$ echo 'void _ZSt7forwardIRKZN5Write14DataMapGrammarISt20back_insert_iteratorISsEEC4EvEUlRT_E_EOS5_RNSt16remove_referenceIS5_E4typeE() {} int main() {}' | gcc -xc - -o /tmp/a.out && gdb /tmp/a.out

[...]
Reading symbols from /tmp/a.out.../build/gdb-GtCqbH/gdb-7.11.1/gdb/cp-support.c:1595: demangler-warning: unable to demangle '_ZSt7forwardIRKZN5Write14DataMapGrammarISt20back_insert_iteratorISsEEC4EvEUlRT_E_EOS5_RNSt16remove_referenceIS5_E4typeE' (demangler failed with signal 11)
Unable to dump core, use `ulimit -c unlimited' before executing GDB next time.
/build/gdb-GtCqbH/gdb-7.11.1/gdb/cp-support.c:1608: demangler-warning: unable to demangle '_ZSt7forwardIRKZN5Write14DataMapGrammarISt20back_insert_iteratorISsEEC4EvEUlRT_E_EOS5_RNSt16remove_referenceIS5_E4typeE' (demangler failed with signal 11)
Comment 7 Carlos Alberto Lopez Perez 2016-07-29 12:34:13 PDT
The bug is definitive this one: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68159 and is still present in last GDB git master.

I tried using lldb (LLVM debugger) and its also crashing (segfaults)...


So... at least on my environment I'm complete unable to use a debugger on current trunk of WebKit with Debug builds.


Is anybody here able to work with gdb/llvdb and debug builds?
Comment 8 Carlos Alberto Lopez Perez 2016-08-01 12:40:17 PDT
(In reply to comment #7)
> The bug is definitive this one:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68159 and is still present in
> last GDB git master.
> 
> I tried using lldb (LLVM debugger) and its also crashing (segfaults)...
> 
> 
> So... at least on my environment I'm complete unable to use a debugger on
> current trunk of WebKit with Debug builds.
> 
> 
> Is anybody here able to work with gdb/llvdb and debug builds?

BTW, adrian perez pointed me to this very helpful trick:

 * Put in your ~/.gdbinit file:
set demangle-style none
 * Then pipe the output of GDB through c++filt (a stand-alone demangler).

It works for me.

I see that the WebKit tooling for generating GDB crash logs is already piping the output through c++filt. So I'm going to just set this line on the GTK+ bots ~/.gdbinit files.