[Bug 1894166] Re: libasan missing debug symbols break debugging
Launchpad Bug Tracker
1894166 at bugs.launchpad.net
Wed Mar 17 11:07:36 UTC 2021
This bug was fixed in the package gcc-9 - 9.3.0-23ubuntu1
---------------
gcc-9 (9.3.0-23ubuntu1) hirsute; urgency=medium
* Merge with Debian; remaining changes:
- Build from upstream sources.
gcc-9 (9.3.0-23) experimental; urgency=medium
* Update to git 20210316 from the gcc-9 branch.
- Fix PR go/99458, PR target/85074 (PA), PR target/99234 (x86),
PR target/99234 (x86), PR ada/99264, PR c/99137, PR c++/98810,
PR c++/95675, PR c++/90333, PR d/99337, PR fortran/99124,
PR fortran/99060, PR libfortran/99218, PR fortran/99545.
* Don't strip the sanitizer libraries, these are only used for debugging.
LP: #1894166.
* Fix --as-needed specs for -fsanitize=* options for backports.
LP: #1896458.
* Revert the PR ada/99264 fix, causing an ABI breakage in libgnat.
* debian/ada/check_ali_update.sh: Fix syntax errors.
Always run the script.
* Fix lib*gcc* dependencies for backports.
gcc-9 (9.3.0-22) unstable; urgency=medium
* Update to git 20210207 from the gcc-9 branch.
- Fix PR tree-optimization/97236, PR target/97528 (ARM), PR d/98921.
* Revert the fix for PR c++/95158, causing PR target/98032.
-- Matthias Klose <doko at ubuntu.com> Tue, 16 Mar 2021 10:58:28 +0100
** Changed in: gcc-9 (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-10 in Ubuntu.
https://bugs.launchpad.net/bugs/1894166
Title:
libasan missing debug symbols break debugging
Status in gcc-10 package in Ubuntu:
Fix Released
Status in gcc-9 package in Ubuntu:
Fix Released
Bug description:
By default, all symbols are missing from libasan binary that is
installed with this package. This, among other things, effectively
breaks debugging with gdb (and LLDB , but that doesn't matter).
To be able to catch ASAN errors in GDB , one would break on
"__sanitizer::Die" and go from there, but without symbols, this won't
work. Other tools rely on symbol lookups to determine instrumentation
presence , which would fail in this case as well.
For example, without libasan5-dbgsym installed:
(gdb) break __sanitizer::Die
Function "__sanitizer::Die" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (__sanitizer::Die) pending.
(gdb) r
...
ASAN REPORT
...
==1802381==ABORTING
[Inferior 1 (process 1802381) exited with code 01]
However, with libasan5-dbgsym installed:
(gdb) break __sanitizer::Die
Breakpoint 1 at 0x7ffff76bc200: file ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc, line 49.
(gdb) r
...
ASAN REPORT
...
==1805058==ABORTING
Breakpoint 1, __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:49
49 ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc: No such file or directory.
(gdb) bt
#0 __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:49
#1 0x00007ffff769d8ec in __asan::ScopedInErrorReport::~ScopedInErrorReport (this=0x7fffffffd156, __in_chrg=<optimized out>)
at ../../../../src/libsanitizer/asan/asan_report.cc:185
#2 0x00007ffff769d363 in __asan::ReportGenericError (pc=93824992236075, bp=bp at entry=140737488346576, sp=sp at entry=140737488346560, addr=106034152603909,
is_write=is_write at entry=false, access_size=access_size at entry=1, exp=0, fatal=true) at ../../../../src/libsanitizer/asan/asan_report.cc:192
#3 0x00007ffff769de4b in __asan::__asan_report_load1 (addr=<optimized out>) at ../../../../src/libsanitizer/asan/asan_rtl.cc:116
#4 0x000055555555522b in main ()
(gdb)
In this example, it's fairly obvious that missing symbols will prevent one to put a breakpoint on __sanitizer::Die , but as I mentioned, checks in other tools would fail silently and the issue isn't immediately traceable back to missing symbols.
Since AddressSanitizer is primarily used for debugging anyway, would
it make sense to have libasan with symbols by default?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-10/+bug/1894166/+subscriptions
More information about the foundations-bugs
mailing list