libasan missing debug symbols break debugging
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-10 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Fix Released
|
Undecided
|
Unassigned | ||
gcc-9 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Won't Fix
|
Undecided
|
Unassigned |
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 ../../.
(gdb) r
...
ASAN REPORT
...
==1805058==ABORTING
Breakpoint 1, __sanitizer::Die () at ../../.
49 ../../.
(gdb) bt
#0 __sanitizer::Die () at ../../.
#1 0x00007ffff769d8ec in __asan:
at ../../.
#2 0x00007ffff769d363 in __asan:
is_
#3 0x00007ffff769de4b in __asan:
#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?
This bug was fixed in the package gcc-10 - 10.2.0-19ubuntu3
---------------
gcc-10 (10.2.0-19ubuntu3) hirsute; urgency=medium
* Update to git 20201129 from the gcc-10 branch.
- Fix PR target/97528 (ARM), PR debug/97599, PR c/97958, PR fortran/85796,
PR libstdc++/98001, PR libstdc++/97935, PR target/97939 (SPARC),
PR target/96607 (SPARC).
* Don't strip the sanitizer libraries, these are only used for debugging.
LP: #1894166.
* Don't run the libgphobos-link test on powerpc architectures.
* Install libstdc++6 gdb pretty printer files in /usr/share/gcc (unversioned).
* Re-enable the lto build on arm64.
gcc-10 (10.2.0-19ubuntu2) hirsute; urgency=medium
* Disable the lto build on arm64 for now, builds still not
succeeding on the buildds.
gcc-10 (10.2.0-19ubuntu1) hirsute; urgency=medium
* Merge with Debian; remaining changes:
- Build from upstream sources.
* Don't run the testsuite on armhf and arm64, better chances for
a succeeding build on the buildds.
gcc-10 (10.2.0-19) unstable; urgency=medium
* Update to git 20201125 from the gcc-10 branch. checking= release.
- Fix PR target/97730 (AArch64), PR target/97887 (x86), PR d/97889,
PR d/97843, PR d/97842, PR libstdc++/92546, PR libstdc++/97876,
PR libstdc++/95989, PR libstdc++/97869, PR c++/97918, PR debug/97060,
PR target/97534 (ARM), PR c++/96805, PR c++/96199.
* Configure again with --enable-
* Enable again pgo and lto builds for 64bit architectures.
gcc-10 (10.2.0-18ubuntu1) hirsute; urgency=medium
* Merge with Debian; remaining changes:
- Build from upstream sources.
gcc-10 (10.2.0-18) unstable; urgency=medium
* Update to git 20201118 from the gcc-10 branch. /reviews. llvm.org/ D73999 for the patch causing the issue.
- Fix PR target/97535 (AArch64), PR target/97682 (RISCV), PR c/97748,
PR c++/97790, PR c/97748, PR c++/67453, PR c++/97663, PR fortran/97782,
PR fortran/95847, PR fortran/97768, PR libstdc++/97828,
PR libstdc++/93456, PR libstdc++/97798, PR libstdc++/96042,
PR libstdc++/96042, PR libstdc++/96042.
* Update VCS attributes.
* Add an autopkg test for linking libphobos.
* Build the gcn offload compiler using LLVM 11, and work around the
broken as in LLVM 11. See also LLVM Bug 48201 for this issue and
https:/
* Fix PR target/97528, proposed patch. Closes: #972665.
-- Matthias Klose <email address hidden> Sun, 29 Nov 2020 09:50:30 +0100