#960644 valgrind: Doesn't support D programming language demangling

Package:
valgrind
Source:
valgrind
Description:
instrumentation framework for building dynamic analysis tools
Submitter:
Witold Baryluk
Date:
2023-01-29 06:06:03 UTC
Severity:
normal
#960644#5
Date:
2020-05-15 02:28:42 UTC
From:
To:
It looks like valgrind doesn't support D programming language symbol
mangling (as emitted by DMD, GDC or LDC2 compilers);

==29535== valgrind: Unrecognised instruction at address 0x1b38db.
==29535==    at 0x1B38DB: _D3rcu__T3RCUTSQn1AZQl6updateMFNbPQuZv (rcu.d:390)
==29535==    by 0x1B2F6F: _D3rcu6writerFZv (rcu.d:96)
==29535==    by 0x1B3230: _D3rcu4mainFAAyaZ9__lambda3FZv (rcu.d:600)
==29535==    by 0x1E52B7: _D4core6thread8osthread6Thread3runMFZv (in /home/user/vps1/home/baryluk/Projekty/rcu.d/rcu)
==29535==    by 0x1FE929: thread_entryPoint (in /home/user/vps1/home/baryluk/Projekty/rcu.d/rcu)
==29535==    by 0x487DF26: start_thread (pthread_create.c:479)
==29535==    by 0x49AD31E: clone (clone.S:95)

That is a bit unfortunate. Most of this compilers allow to emulate "C"
mangling in debug symbols (ldc2 -gc), but it interferes with other
things, and is not supported everywhere.

gdb and objdump do demangle D symbols very well. I hope valgrind could pick it up too?

#960644#10
Date:
2020-05-15 12:32:20 UTC
From:
To:
Hi,

Best to file this upstream.
Yes, it shouldn't be too hard to support.
valgrind uses the same demangler as gdb and binutils.
So since this works:

$ echo _D4core6thread8osthread6Thread3runMFZv | c++filt -s dlang
core.thread.osthread.Thread.run()

valgrind just needs to know when to switch to "dlang". See
coregrind/m_demangle/demangle.c where it already checks for "rust"
demangling.

Cheers,

Mark

#960644#15
Date:
2020-05-15 12:32:20 UTC
From:
To:
Hi,

Best to file this upstream.
Yes, it shouldn't be too hard to support.
valgrind uses the same demangler as gdb and binutils.
So since this works:

$ echo _D4core6thread8osthread6Thread3runMFZv | c++filt -s dlang
core.thread.osthread.Thread.run()

valgrind just needs to know when to switch to "dlang". See
coregrind/m_demangle/demangle.c where it already checks for "rust"
demangling.

Cheers,

Mark

#960644#20
Date:
2020-05-16 01:39:45 UTC
From:
To:
Hi Mark.

I will do that, and try to submit a code to that. valgrind looks to be
used pretty outdated libiberify code. It does have some support for
the D, but it doesn't support latest ABIs, and doesn't detect it
automatically.

As you already know, the valgrind has autodetection for rust, and same
can be done for dlang, to make user experience easier. I will talk to
valgrind about it.

Thanks for maintaining valgrind packages in Debian! Cheers.

#960644#25
Date:
2020-05-16 01:39:45 UTC
From:
To:
Hi Mark.

I will do that, and try to submit a code to that. valgrind looks to be
used pretty outdated libiberify code. It does have some support for
the D, but it doesn't support latest ABIs, and doesn't detect it
automatically.

As you already know, the valgrind has autodetection for rust, and same
can be done for dlang, to make user experience easier. I will talk to
valgrind about it.

Thanks for maintaining valgrind packages in Debian! Cheers.

#960644#30
Date:
2023-01-29 06:03:56 UTC
From:
To:
For reference

I submitted patch upstream to add support for this:

https://bugs.kde.org/show_bug.cgi?id=464969