Linphone symbolic link for liblinphone hampers debugging

  • Open
  • quality assurance status badge
Details
One participant
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 3 Sep 2021 20:09
(name . bug-guix)(address . bug-guix@gnu.org)
87ilzhbkfj.fsf@gmail.com
Hello,

I was trying to get a good backtrace for a segfault in linphone-desktop
(see http://issues.guix.gnu.org/47641). So I added a debug output for
liblinphone, and did the following:

Toggle snippet (4 lines)
./pre-inst-env guix environment --ad-hoc linphone-desktop \
linphone-desktop:debug liblinphone liblinphone:debug --no-grafts

The --no-grafts is to workaround http://issues.guix.gnu.org/48907.

Then I did the usual dance to get the GDB symbols resolved:

Toggle snippet (35 lines)
export GDB_DEBUG_FILE_DIRECTORY=$GUIX_ENVIRONMENT/lib/debug

[env]$ cat $GUIX_ENVIRONMENT/bin/linphone
#!/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash
export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}/gnu/store/jlzdmlrmsrgxqj9yw1i1zy4lrf3r9d1n-linphone-desktop-4.2.5/share:/gnu/store/k4vz4pk664fz4mf1amdzvd7w7315wwr6-liblinphone-4.4.34/share"
export QT_PLUGIN_PATH="/gnu/store/b90sxi7aphibx6amwqx2nqljjv0yp5wg-qtbase-5.15.2/lib/qt5/plugins:/gnu/store/5s66rhnjys6qq8hdff9sy3dzy40fgxji-qtdeclarative-5.15.2/lib/qt5/plugins:/gnu/store/11vb2q2kbi8aym0fx52h5inish61mzp6-qtsvg-5.15.2/lib/qt5/plugins${QT_PLUGIN_PATH:+:}$QT_PLUGIN_PATH"
export QML2_IMPORT_PATH="/gnu/store/5s66rhnjys6qq8hdff9sy3dzy40fgxji-qtdeclarative-5.15.2/lib/qt5/qml:/gnu/store/r8rpn1jclizv7a6s7c3ngblanmn9v52i-qtgraphicaleffects-5.15.2/lib/qt5/qml:/gnu/store/3rasi4dmffay6mkxhmy2xwdl1pr46wvr-qtquickcontrols-5.15.2/lib/qt5/qml:/gnu/store/baanczaq0s2yqdq7812ydkjmvnk7jl1z-qtquickcontrols2-5.15.2/lib/qt5/qml${QML2_IMPORT_PATH:+:}$QML2_IMPORT_PATH"
exec -a "$0" "/gnu/store/jlzdmlrmsrgxqj9yw1i1zy4lrf3r9d1n-linphone-desktop-4.2.5/bin/.linphone-real" "$@"

# Copying the exports
[env]$ export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}/gnu/store/jlzdmlrmsrgxqj9yw1i1zy4lrf3r9d1n-linphone-desktop-4.2.5/share:/gnu/store/k4vz4pk664fz4mf1amdzvd7w7315wwr6-liblinphone-4.4.34/share"
export QT_PLUGIN_PATH="/gnu/store/b90sxi7aphibx6amwqx2nqljjv0yp5wg-qtbase-5.15.2/lib/qt5/plugins:/gnu/store/5s66rhnjys6qq8hdff9sy3dzy40fgxji-qtdeclarative-5.15.2/lib/qt5/plugins:/gnu/store/11vb2q2kbi8aym0fx52h5inish61mzp6-qtsvg-5.15.2/lib/qt5/plugins${QT_PLUGIN_PATH:+:}$QT_PLUGIN_PATH"
export QML2_IMPORT_PATH="/gnu/store/5s66rhnjys6qq8hdff9sy3dzy40fgxji-qtdeclarative-5.15.2/lib/qt5/qml:/gnu/store/r8rpn1jclizv7a6s7c3ngblanmn9v52i-qtgraphicaleffects-5.15.2/lib/qt5/qml:/gnu/store/3rasi4dmffay6mkxhmy2xwdl1pr46wvr-qtquickcontrols-5.15.2/lib/qt5/qml:/gnu/store/baanczaq0s2yqdq7812ydkjmvnk7jl1z-qtquickcontrols2-5.15.2/lib/qt5/qml${QML2_IMPORT_PATH:+:}$QML2_IMPORT_PATH"

# Then invoking the actual binary
[env]$ gdb --args $GUIX_ENVIRONMENT/bin/.linphone-real --verbose
GNU gdb (GDB) 10.2
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-unknown-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 /gnu/store/hmgy2vk1g1qjd7r0r5hk2m4csyj97ybx-profile/bin/.linphone-real...
Reading symbols from /gnu/store/hmgy2vk1g1qjd7r0r5hk2m4csyj97ybx-profile/lib/debug//gnu/store/jlzdmlrmsrgxqj9yw1i1zy4lrf3r9d1n-linphone-desktop-4.2.5/bin/.linphone-real.debug...

But the liblinphone.so symbol table was not found.

This is due to linphone-desktop symlinking the lib/ directory of
liblinphone directly under its own, to workaround some FHS bogus
assumption. GDB only knows the shared library from that location (it
doesn't dereference symlink) and fails to find the symbols.

Thanks,

Maxim
?