Bug 1517259

Summary: asan and ubsan debuginfo missing
Product: [Fedora] Fedora Reporter: James Legg <jlegg+rbz>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: aoliva, davejohansen, fweimer, jakub, jwakely, law, mpolacek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-7.3.1-2.fc26 gcc-7.3.1-2.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-06 10:50:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test program with a error detected by ubsan none

Description James Legg 2017-11-24 12:06:38 UTC
Created attachment 1358646 [details]
Test program with a error detected by ubsan

Description of problem:
The debug symbols for the ubsan and asan runtime libraries cannot be obtained by any obvious means anymore in Fedora 27.

Version-Release number of selected component (if applicable):
gcc 7.2.1.2.fc27
(other packages involved: libubsan 7.2.1 2.fc27 and libasan 7.2.1.2.fc27)

How reproducible:
Always reproducible. Tried on two machines upgraded for Fedora 26, and it occurred on both.

Steps to Reproduce:
1. Compile attached ubsan-crash.cc with ubsan:
    $ g++ -fsanitize=undefined -g ubsan-crash.cc
2. Launch gdb with the result:
    $ gdb a.out
3. Run the program in gdb
    (gdb) run
4. Run the command gdb suggests to install libubsan.so.0's debug symbols
5. Try to get a backtrace from gdb
    (gdb) bt
6. Try to see the source where the crash occurred
    (gdb) tui enable
7. Try setting a breakpoint on __ubsan::ScopedReport::~ScopedReport
    (gdb) break __ubsan::ScopedReport::~ScopedReport

Actual results:
The command given by gdb to install the debug info fails:
> $ sudo dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/43/cc661ae0597e577f445abdc575571905955dcd.debug
> No match for argument: /usr/lib/debug/.build-id/43/cc661ae0597e577f445abdc575571905955dcd.debug
> Error: Unable to find a match
The backtrace has ?? for some symbol names, and the source is missing for anything in libubsan.so.0.
The symbol __ubsan::ScopedReport::~ScopedReport is not found.

Expected results:
The command for installing the debug symbols installs a package. When restarting gdb and trying again, the backtrace will have function names and the source can be viewed. Setting a breakpoint on __ubsan::ScopedReport::~ScopedReport finds the function and sets a breakpoint there. When upgrading from Fedora 26 where the appropriate debug package was already installed, gdb just finds the debug symbols the first time and doesn't even ask for a debuginfo package to be installed.

Additional info:
This is a regression from Fedora 26, where the debug information was available. You could set breakpoints on symbols such as __asan::ReportGenericError and __ubsan::ScopedReport::~ScopedReport and see the source for them in gdb and a full backtrace when errors were detected.
The command
    $ sudo dnf debuginfo-install libubsan libasan
will install gcc-debuginfo-7.2.1-2.fc27.x86_64, but this does not help. (libubsan being the name of the package that provides /usr/lib64/libubsan.so.0.) There is no package gcc-debugsource available.

Comment 1 Marek Polacek 2017-11-24 12:43:31 UTC
Surely installing gcc-debuginfo doesn't help?

It's got
/usr/lib/debug/usr/lib/gcc/x86_64-redhat-linux/7/libubsan.a
/usr/lib/debug/usr/lib64/libubsan.so.0.0.0.debug
/usr/lib/debug/usr/lib64/libubsan.so.0.debug
/usr/lib/debug/usr/lib64/libubsan.so.debug
etc.

Comment 2 James Legg 2017-11-24 13:12:17 UTC
(In reply to Marek Polacek from comment #1)
> Surely installing gcc-debuginfo doesn't help?

On my machines, rpm -ql gcc-debuginfo produces:
/usr/lib/debug
/usr/lib/debug/.dwz
/usr/lib/debug/.dwz/gcc-7.2.1-2.fc27.x86_64

I tried reinstalling it, but nothing changed.

I can't find any package containing those files with dnf provides --enablerepo fedora-debuginfo --enablerepo updates-debuginfo.

Comment 3 Fedora Update System 2018-01-31 07:49:07 UTC
gcc-7.3.1-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-75d88970d0

Comment 4 Fedora Update System 2018-01-31 07:55:51 UTC
gcc-7.3.1-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-aa879be08e

Comment 5 Fedora Update System 2018-01-31 18:43:06 UTC
gcc-7.3.1-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-aa879be08e

Comment 6 Fedora Update System 2018-01-31 22:46:01 UTC
gcc-7.3.1-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-75d88970d0

Comment 7 Fedora Update System 2018-02-06 10:50:17 UTC
gcc-7.3.1-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2018-02-06 15:32:05 UTC
gcc-7.3.1-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.