unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63047: Can't load glib debug symbols in gdb
@ 2023-04-24  7:29 Andrew Tropin
  2023-04-24  7:54 ` Josselin Poiret via Bug reports for GNU Guix
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Tropin @ 2023-04-24  7:29 UTC (permalink / raw)
  To: 63047

[-- Attachment #1: Type: text/plain, Size: 9088 bytes --]

I try to run emacs in gdb with debug symbols for some libs available, I
succeed with gtk+, but it doesn't work for glib and glibc.  It looks
strange to me, but maybe I am doing something wrong.

Reproducer:

guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
     --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
     --no-grafts -- gdb .emacs-30.0.50-real

--8<---------------cut here---------------start------------->8---
GNU gdb (GDB) 12.1
Copyright (C) 2022 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 .emacs-30.0.50-real...
(No debugging symbols found in .emacs-30.0.50-real)
(gdb) run -q
Starting program: /gnu/store/g59lvzvhbai1dcrbckaw4qvf4amxyfa2-profile/bin/.emacs-30.0.50-real -q
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 14944]
[New LWP 14945]
[New LWP 14946]
Gdk-Message: 11:19:32.820: Unable to load sb_v_double_arrow from the cursor theme
Gdk-Message: 11:19:32.820: Unable to load sb_h_double_arrow from the cursor theme
Gdk-Message: 11:19:32.838: Unable to load hand2 from the cursor theme
Gdk-Message: 11:19:32.838: Unable to load sb_h_double_arrow from the cursor theme
Gdk-Message: 11:19:32.838: Unable to load sb_v_double_arrow from the cursor theme
[New LWP 14947]
[LWP 14947 exited]
[New LWP 14948]
[New LWP 14949]
[LWP 14948 exited]
[LWP 14949 exited]
[New LWP 14950]
[New LWP 14951]
[LWP 14950 exited]
[LWP 14951 exited]
^Z
Thread 1 ".emacs-30.0.50-" received signal SIGTSTP, Stopped (user).
0x00007ffff3def17b in pselect () from /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6
(gdb) info dll
From                To                  Syms Read   Shared Object Library
0x00007ffff7fcf050  0x00007ffff7ff15ee  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2
0x00007ffff769c070  0x00007ffff79e9936  Yes         /gnu/store/whgbkfyggc3ljkh7y9wqwvqgnsnnyf7w-gtk+-3.24.30/lib/libgtk-3.so.0
0x00007ffff7ee6190  0x00007ffff7f5efdd  Yes         /gnu/store/whgbkfyggc3ljkh7y9wqwvqgnsnnyf7w-gtk+-3.24.30/lib/libgdk-3.so.0
0x00007ffff7ea9b20  0x00007ffff7eaf8c0  Yes (*)     /gnu/store/vk23fcm4livzrnb3kzhxs6yjds8f355c-pango-1.48.10/lib/libpangocairo-1.0.so.0
0x00007ffff7e61c80  0x00007ffff7e8711e  Yes (*)     /gnu/store/vk23fcm4livzrnb3kzhxs6yjds8f355c-pango-1.48.10/lib/libpango-1.0.so.0
0x00007ffff751fec0  0x00007ffff75c462e  Yes (*)     /gnu/store/f6ibajh7x233cvr30c2p314l2absk36h-harfbuzz-2.8.2/lib/libharfbuzz.so.0
0x00007ffff7e316b0  0x00007ffff7e3ed44  Yes (*)     /gnu/store/np9pryvn0rxc00cc6g4jd7rlcxwk2mxs-atk-2.36.0/lib/libatk-1.0.so.0
0x00007ffff750d0a0  0x00007ffff750e20d  Yes (*)     /gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo-gobject.so.2
0x00007ffff73fc680  0x00007ffff74c3a97  Yes (*)     /gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo.so.2
0x00007ffff73c9b50  0x00007ffff73dccde  Yes (*)     /gnu/store/xgiz9rvzvfhwx655lb6jpjx1whc4kjg8-gdk-pixbuf-2.42.4/lib/libgdk_pixbuf-2.0.so.0
0x00007ffff721e980  0x00007ffff73267e6  Yes (*)     /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgio-2.0.so.0
0x00007ffff7191760  0x00007ffff71be826  Yes (*)     /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgobject-2.0.so.0
0x00007ffff706ed40  0x00007ffff70f4a7e  Yes (*)     /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libglib-2.0.so.0
0x00007ffff6fd5dc0  0x00007ffff7018105  Yes (*)     /gnu/store/343iqv9hvbvzp2in0hs03dvygccrcapl-libtiff-4.3.0/lib/libtiff.so.5
0x00007ffff6f39500  0x00007ffff6f8e0c5  Yes (*)     /gnu/store/g5hf1zhqlcyx9vw3q1xa52bgddaqsfm5-libjpeg-turbo-2.0.5/lib/libjpeg.so.62
0x00007ffff6f05900  0x00007ffff6f2739a  Yes (*)     /gnu/store/p7iq81hxxyk9zy7a9dngbf16zm8d4klx-libpng-1.6.37/lib/libpng16.so.16
0x00007ffff6ee52f0  0x00007ffff6ef5cc4  Yes (*)     /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1
0x00007ffff6ed9390  0x00007ffff6edd58b  Yes (*)     /gnu/store/4d0ssibbd2glk1vc93zj738awmy22xad-giflib-5.2.1/lib/libgif.so.7
0x00007ffff6e0fcc0  0x00007ffff6e93bd6  Yes (*)     /gnu/store/nfxcjvv9c2q6in9x52kkkayqv38k00ai-alsa-lib-1.2.4/lib/libasound.so.2
0x00007ffff6512070  0x00007ffff6a2df5c  Yes (*)     /gnu/store/0w390zkxhzhkmyp0sns8z97bfmzbr7gz-librsvg-2.50.7/lib/librsvg-2.so.2
0x00007ffff62cc200  0x00007ffff6362d11  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6
0x00007ffff6dd4370  0x00007ffff6dd8340  Yes (*)     /gnu/store/a38k2v29l6l0iz6pmlk4dmzwdbvl10lq-acl-2.3.1/lib/libacl.so.1
0x00007ffff6dca3f0  0x00007ffff6dcd1b1  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt.so.1
0x00007ffff626dd20  0x00007ffff62a636a  Yes (*)     /gnu/store/8zigz7afvz2rjrvrh7zq1d389qbl2684-dbus-1.12.20/lib/libdbus-1.so.3
0x00007ffff6122bd0  0x00007ffff62068ce  Yes (*)     /gnu/store/g3y6ifhm0751vgsxv90yipfw6mk189kj-libxml2-2.9.12/lib/libxml2.so.2
0x00007ffff6097cc0  0x00007ffff60d13e8  Yes (*)     /gnu/store/9rrnm5hdjw7cy96a2a9rfgh6y08wsbmf-ncurses-6.2.20210619/lib/libncursesw.so.6
0x00007ffff6052f80  0x00007ffff6071dd1  Yes (*)     /gnu/store/3hmh0srgky1a621rzaxf98qvr0p9r1dv-libselinux-3.4/lib/libselinux.so.1
0x00007ffff5fa79c0  0x00007ffff6018c0d  Yes (*)     /gnu/store/ak70pk2hjks17cx7zjdmdmzpcpiy9gpi-freetype-2.10.4/lib/libfreetype.so.6
0x00007ffff5f577a0  0x00007ffff5f7d05a  Yes (*)     /gnu/store/3r5sl1l02kjxzw3gicjpjz4kw6v4rgs9-fontconfig-minimal-2.13.94/lib/libfontconfig.so.1
0x00007ffff5f38230  0x00007ffff5f49380  Yes (*)     /gnu/store/64ic06l5pd78n7blzikqzfnnp0xp5msd-libotf-0.9.16/lib/libotf.so.1
0x00007ffff5d76940  0x00007ffff5e89670  Yes (*)     /gnu/store/zl9wf0zwq2ka9rpmayp53hnp2mn460xf-gnutls-3.7.2/lib/libgnutls.so.30
0x00007ffff5d22540  0x00007ffff5d2fba1  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0
0x00007ffff5d17200  0x00007ffff5d18301  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libanl.so.1
0x00007ffff5cc3280  0x00007ffff5cf9bfa  Yes (*)     /gnu/store/0dhvl2lvb7gsrbjf5jq5pd7hdvznsazz-lcms-2.12/lib/liblcms2.so.2
0x00007ffff5cb2130  0x00007ffff5cb2f31  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl.so.2
0x00007ffff5c1b830  0x00007ffff5c8537c  Yes (*)     /gnu/store/v3hqc5i1jqi0s04zxvi465bihrgb1sq1-elogind-246.10/lib/libelogind.so.0
0x00007ffff5bfb1f0  0x00007ffff5c02f2b  Yes (*)     /gnu/store/nprljhh7a86351vg6h23va3kfdnkwnd4-jansson-2.13.1/lib/libjansson.so.4
0x00007ffff5b6d440  0x00007ffff5bde0ab  Yes (*)     /gnu/store/fwbiihd2sbhai63y1pvvdh0f2bakfzrf-gmp-6.2.1/lib/libgmp.so.10
0x00007ffff4219c50  0x00007ffff508025e  Yes (*)     /gnu/store/lphzb1z0r4kbb453rsvnw7msrxxzp5r7-libgccjit-10.3.0/lib/libgccjit.so.0
0x00007ffff5b2e8c0  0x00007ffff5b51e83  Yes (*)     /gnu/store/cbviswij2rbqnbsc889166wm7ri5pc2r-tree-sitter-0.20.7/lib/libtree-sitter.so.0
0x00007ffff3ed5ca0  0x00007ffff3fc4c36  Yes (*)     /gnu/store/xmzx5mzv4863yw9kmr2ykndgp37p8if0-sqlite-3.36.0/lib/libsqlite3.so.0
0x00007ffff5b12310  0x00007ffff5b22b1d  Yes (*)     /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
0x00007ffff3d25330  0x00007ffff3e64389  Yes (*)     /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6
0x00007ffff5b09100  0x00007ffff5b099ec  Yes (*)     /gnu/store/6h8skg2n4gpbi0bwfmw6qyh03phic6dm-libxinerama-1.1.4/lib/libXinerama.so.1
...
(*): Shared library is missing debugging information.
--8<---------------cut here---------------end--------------->8---

My .gdbinit:
--8<---------------cut here---------------start------------->8---
# Tell GDB where to look for separate debugging files.
guile
(use-modules (gdb))
(execute (string-append "set debug-file-directory "
                        (string-join
                         (if (getenv "GDB_DEBUG_FILE_DIRECTORY")
                             (list (getenv "GDB_DEBUG_FILE_DIRECTORY"))
                             '())
                          ":")))
end

# Authorize extensions found in the store, such as the
# pretty-printers of libstdc++.
set auto-load safe-path /
# /gnu/store/*/lib
set history filename ~/.cache/gdb_history
set history save on
--8<---------------cut here---------------end--------------->8---

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63047: Can't load glib debug symbols in gdb
  2023-04-24  7:29 bug#63047: Can't load glib debug symbols in gdb Andrew Tropin
@ 2023-04-24  7:54 ` Josselin Poiret via Bug reports for GNU Guix
  2023-04-25 12:38   ` Maxim Cournoyer
  0 siblings, 1 reply; 4+ messages in thread
From: Josselin Poiret via Bug reports for GNU Guix @ 2023-04-24  7:54 UTC (permalink / raw)
  To: Andrew Tropin, 63047

[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]

Hi Andrew,

Andrew Tropin <andrew@trop.in> writes:

> I try to run emacs in gdb with debug symbols for some libs available, I
> succeed with gtk+, but it doesn't work for glib and glibc.  It looks
> strange to me, but maybe I am doing something wrong.
>
> Reproducer:
>
> guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
>      --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
>      --no-grafts -- gdb .emacs-30.0.50-real

At least for glibc, the glibc that is linked against is the one in (gnu
packages commencement), which is hidden from the user.  The one in (gnu
packages base), which you can refer to with "glibc" is different.  You
can try to find the proper debug output by looking at `guix size` of
your store path, then finding out the deriver for glibc with `guix gc
--derivers` and finally looking at the .drv to find out what the debug
output should be.

For glib, it might be similar, make sure that you're using exactly the
right store path for it.

Best,
-- 
Josselin Poiret

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63047: Can't load glib debug symbols in gdb
  2023-04-24  7:54 ` Josselin Poiret via Bug reports for GNU Guix
@ 2023-04-25 12:38   ` Maxim Cournoyer
  2023-09-13  7:54     ` Andrew Tropin
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Cournoyer @ 2023-04-25 12:38 UTC (permalink / raw)
  To: 63047; +Cc: dev, andrew

Hi Andrew,

Josselin Poiret via Bug reports for GNU Guix <bug-guix@gnu.org> writes:

> Hi Andrew,
>
> Andrew Tropin <andrew@trop.in> writes:
>
>> I try to run emacs in gdb with debug symbols for some libs available, I
>> succeed with gtk+, but it doesn't work for glib and glibc.  It looks
>> strange to me, but maybe I am doing something wrong.
>>
>> Reproducer:
>>
>> guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
>>      --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
>>      --no-grafts -- gdb .emacs-30.0.50-real
>
> At least for glibc, the glibc that is linked against is the one in (gnu
> packages commencement), which is hidden from the user.  The one in (gnu
> packages base), which you can refer to with "glibc" is different.  You
> can try to find the proper debug output by looking at `guix size` of
> your store path, then finding out the deriver for glibc with `guix gc
> --derivers` and finally looking at the .drv to find out what the debug
> output should be.
>
> For glib, it might be similar, make sure that you're using exactly the
> right store path for it.

Perhaps try on the core-updates branch, where glibc no longer has its
symbols stripped.  Another thing that can cause the debug symbols to not
be found is grafts, as described in #48907, so when debugging I'd
recommend using --no-grafts for now.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#63047: Can't load glib debug symbols in gdb
  2023-04-25 12:38   ` Maxim Cournoyer
@ 2023-09-13  7:54     ` Andrew Tropin
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Tropin @ 2023-09-13  7:54 UTC (permalink / raw)
  To: maxim.cournoyer, 63047; +Cc: 63047-done, Josselin Poiret

[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]

On 2023-04-25 08:38, Maxim Cournoyer wrote:

> Hi Andrew,
>
> Josselin Poiret via Bug reports for GNU Guix <bug-guix@gnu.org> writes:
>
>> Hi Andrew,
>>
>> Andrew Tropin <andrew@trop.in> writes:
>>
>>> I try to run emacs in gdb with debug symbols for some libs available, I
>>> succeed with gtk+, but it doesn't work for glib and glibc.  It looks
>>> strange to me, but maybe I am doing something wrong.
>>>
>>> Reproducer:
>>>
>>> guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
>>>      --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
>>>      --no-grafts -- gdb .emacs-30.0.50-real
>>
>> At least for glibc, the glibc that is linked against is the one in (gnu
>> packages commencement), which is hidden from the user.  The one in (gnu
>> packages base), which you can refer to with "glibc" is different.  You
>> can try to find the proper debug output by looking at `guix size` of
>> your store path, then finding out the deriver for glibc with `guix gc
>> --derivers` and finally looking at the .drv to find out what the debug
>> output should be.
>>
>> For glib, it might be similar, make sure that you're using exactly the
>> right store path for it.
>
> Perhaps try on the core-updates branch, where glibc no longer has its
> symbols stripped.  Another thing that can cause the debug symbols to not
> be found is grafts, as described in #48907, so when debugging I'd
> recommend using --no-grafts for now.

Thank you for the tips.

For future readers: the core-updates merged, it should be fixed, however,
I didn't check if it works now.

Closing the issue, but feel free to reopen.

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-13  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24  7:29 bug#63047: Can't load glib debug symbols in gdb Andrew Tropin
2023-04-24  7:54 ` Josselin Poiret via Bug reports for GNU Guix
2023-04-25 12:38   ` Maxim Cournoyer
2023-09-13  7:54     ` Andrew Tropin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).