Bug 1483222 - GDB doesn't find Python 3 debug symbols even though they are installed
Summary: GDB doesn't find Python 3 debug symbols even though they are installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: 26
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Iryna Shcherbina
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-19 11:33 UTC by Sam Thursfield
Modified: 2017-09-25 00:52 UTC (History)
9 users (show)

Fixed In Version: python3-3.6.2-7.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-25 00:52:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Sam Thursfield 2017-08-19 11:33:27 UTC
Description of problem:

I have the python3 and python3-debuginfo packages installed on my Fedora 26 machine. When I debug python3 processes in GDB, I see only the function names, with no information about function parameters, code, or local variables.

When I start GDB it shows the following message:

Reading symbols from /usr/bin/python3...Reading symbols from /usr/lib/debug/usr/libexec/system-python.debug...(no debugging symbols found)...done.
(no debugging symbols found)...done.


This problem has only occurred since I updated to Fedora 26 -- I used to be able to debug python3 processes fine in Fedora 25.


Version-Release number of selected component (if applicable):

$ rpm  -q python3 --qf '%{NAME}-%{VERSION}-%{RELEASE}'
python3-3.6.2-1.fc26
$ rpm  -q python3-debuginfo --qf '%{NAME}-%{VERSION}-%{RELEASE}'
python3-debuginfo-3.6.2-1.fc26


How reproducible:

Every time.


Steps to Reproduce:
1. gdb /usr/bin/python3
2. run
3. <hit ctrl+c>
4. backtrace


Actual results:

Notice that the backtrace has no function parameters for any symbols from libpython3.6m:

(gdb) ba
#0  0x00007fb5de065cb3 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007fb5d72699fe in readline_until_enter_or_signal (signal=<synthetic pointer>, 
    prompt=<optimized out>) at /usr/src/debug/Python-3.6.2/Modules/readline.c:1230
#2  call_readline () at /usr/src/debug/Python-3.6.2/Modules/readline.c:1328
#3  0x00007fb5ded01474 in PyOS_Readline () from /lib64/libpython3.6m.so.1.0
#4  0x00007fb5decd8050 in tok_get.cold () from /lib64/libpython3.6m.so.1.0
#5  0x00007fb5ded7b019 in PyTokenizer_Get () from /lib64/libpython3.6m.so.1.0
#6  0x00007fb5dee8b945 in PyParser_ParseFileObject () from /lib64/libpython3.6m.so.1.0
#7  0x00007fb5dee8d462 in PyParser_ASTFromFileObject () from /lib64/libpython3.6m.so.1.0
#8  0x00007fb5ded58c7a in PyRun_InteractiveOneObject () from /lib64/libpython3.6m.so.1.0
#9  0x00007fb5ded58eb3 in PyRun_InteractiveLoopFlags () from /lib64/libpython3.6m.so.1.0
#10 0x00007fb5dee8f885 in PyRun_AnyFileExFlags () from /lib64/libpython3.6m.so.1.0
#11 0x00007fb5ded59fd0 in Py_Main.cold.2829 () from /lib64/libpython3.6m.so.1.0
#12 0x0000000100000dd2 in main ()


Expected results:

There should be some more debug info!

Additional info:

None

Comment 1 Sam Thursfield 2017-08-23 16:51:47 UTC
If I build Python 3.6.0 from source with debug info enabled and install into a separate prefix, debug info works as expected.

Comment 2 Petr Viktorin (pviktori) 2017-08-24 09:40:10 UTC
Let me look into this.

Comment 3 Iryna Shcherbina 2017-09-05 15:55:09 UTC
This seems to be related, to the fact, that we have recently enabled lto and pgo optimizations.

The lto optimizations adds `-flto` flag during compilation, which according to gcc docs [0] does not work well with -g flag:

"Link-time optimization does not work well with generation of debugging information. Combining -flto with -g is currently experimental and expected to produce unexpected results."[0]

And without -g option, no or insufficient information for debuginfo packages is generated, thus the debugging symbols are missing.


[0] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Optimize-Options.html#Optimize-Options

Comment 4 Charalampos Stratakis 2017-09-14 15:08:39 UTC
Rawhide and f27 are fixed. I will try to backport the change to F26 sometime this or the next week.

Comment 5 Fedora Update System 2017-09-22 10:27:35 UTC
python3-3.6.2-7.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-21119b637e

Comment 6 Fedora Update System 2017-09-23 00:28:14 UTC
python3-3.6.2-7.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-2017-21119b637e

Comment 7 Fedora Update System 2017-09-25 00:52:21 UTC
python3-3.6.2-7.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.