I have setup a fedora-34 VM. I want to build the python2.7 binary debuginfo rpm from the python2.7 srpm. This has value to me in its own right but I am also using this to learn about rpm packaging tools in depth.
I can see that I have this version of python2.7 installed:
rpm -q python2.7
python2.7-2.7.18-21.fc34.x86_64
and I downloaded the SRPM like this:
dnf download --source python2.7
and then kicked off a build via mock like this:
mock -r fedora-34-x86_64 python2.7-2.7.18-21.fc34.src.rpm
this seemed to work, and produced these results:
ls -la /var/lib/mock/fedora-34-x86_64/result/
total 36368
drwxrwsr-x. 2 em7admin mock 4096 Aug 6 12:28 .
drwxrwsr-x. 4 root mock 54 Aug 6 12:28 ..
-rw-rw-r--. 1 em7admin mock 5081696 Aug 6 12:28 build.log
-rw-rw-r--. 1 em7admin mock 2537 Aug 6 12:03 hw_info.log
-rw-rw-r--. 1 em7admin mock 31609 Aug 6 12:04 installed_pkgs.log
-rw-r--r--. 1 em7admin mock 13551113 Aug 6 12:03 python2.7-2.7.18-21.fc34.src.rpm
-rw-r--r--. 1 em7admin mock 13162772 Aug 6 12:28 python2.7-2.7.18-21.fc34.x86_64.rpm
-rw-r--r--. 1 em7admin mock 3152974 Aug 6 12:27 python2.7-debuginfo-2.7.18-21.fc34.x86_64.rpm
-rw-r--r--. 1 em7admin mock 2036041 Aug 6 12:27 python2.7-debugsource-2.7.18-21.fc34.x86_64.rpm
-rw-rw-r--. 1 em7admin mock 197064 Aug 6 12:28 root.log
-rw-rw-r--. 1 em7admin mock 841 Aug 6 12:28 state.log
However, when I try to use gdb to debug a core file generated from a simple python program I wrote to specifically dump a core file so I could test this, it seems that the debuginfo package I compiled does not match the one already installed in fc-34:
type or paste code here
gdb /usr/bin/python2.7 core
GNU gdb (GDB) Fedora 11.1-5.fc34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/python2.7...
warning: the debug information found in "/usr/lib/debug//usr/bin/python2.7-2.7.18-21.fc34.x86_64.debug" does not match "/usr/bin/python2.7" (CRC mismatch).
Missing separate debuginfo for /usr/bin/python2.7
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/47/f710d3b0f56f0c36686069e8deb2a22060fdfa.debug
Reading symbols from .gnu_debugdata for /usr/bin/python2.7...
(No debugging symbols found in .gnu_debugdata for /usr/bin/python2.7)
[New LWP 132167]
warning: the debug information found in "/usr/lib/debug//lib64/libpython2.7.so.1.0-2.7.18-21.fc34.x86_64.debug" does not match "/lib64/libpython2.7.so.1.0" (CRC mismatch).
Missing separate debuginfo for /lib64/libpython2.7.so.1.0
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/ef/e5ee82c6c149599eee3eb2f44f2ad6120a9e02.debug
warning: the debug information found in "/usr/lib/debug//usr/lib64/python2.7/lib-dynload/_localemodule.so-2.7.18-21.fc34.x86_64.debug" does not match "/usr/lib64/python2.7/lib-dynload/_localemodule.so" (CRC mismatch).
Missing separate debuginfo for /usr/lib64/python2.7/lib-dynload/_localemodule.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/6a/48e70ee821577eabd23e7ebb1f8fb2ae22baae.debug
warning: the debug information found in "/usr/lib/debug//usr/lib64/python2.7/lib-dynload/readline.so-2.7.18-21.fc34.x86_64.debug" does not match "/usr/lib64/python2.7/lib-dynload/readline.so" (CRC mismatch).
Missing separate debuginfo for /usr/lib64/python2.7/lib-dynload/readline.so
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/11/bc9cdd27f2fe1f5fa5e951fb28d9a10b4c211a.debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `python2'.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f34e7a81292 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.33-5.fc34.x86_64 ncurses-libs-6.2-4.20200222.fc34.x86_64 readline-8.1-2.fc34.x86_64
I take it the key lines of output here are:
warning: the debug information found in "/usr/lib/debug//usr/bin/python2.7-2.7.18-21.fc34.x86_64.debug" does not match "/usr/bin/python2.7" (CRC mismatch).
When I install the debuginfo package from fedora’s repos with:
dnf install python2.7-debuginfo --enablerepo='*debug*'
I have no problem analyzing the core file with gdb. My ultimate goal here is to understand how to recreate binary builds so that, if all I have is a RPM derived distribution where the source package is available but the debuginfos package is not, I can produce the binary RPM myself and analyze core dumps.