You are not logged in.
I installed the new `valgrind 3.21` from `yay` first but when I ran `valgrind ls` it was stuck for a long time.
So I uninstalled the above valgrind and then installed from source with the debug symbols. The problem was still there.
$ valgrind ls
==3362== Memcheck, a memory error detector
==3362== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==3362== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info
==3362== Command: ls
==3362==
$ gdb -p 3362
>>> bt
#0 0x0000000058055e79 in do_syscall_WRK ()
#1 0x000000005805603d in vgPlain_do_syscall (sysno=sysno@entry=0x3d, a1=a1@entry=0xd24, a2=a2@entry=0x0, a3=a3@entry=0x0, a4=a4@entry=0x0, a5=a5@entry=0x0, a6=0x0, a7=0x0, a8=0x0)
at m_syscall.c:1141
#2 0x00000000580472b6 in vgPlain_waitpid (pid=pid@entry=0xd24, status=status@entry=0x0, options=options@entry=0x0) at m_libcproc.c:352
#3 0x000000005807723c in find_debug_file_debuginfod (objpath=objpath@entry=0x100292e950 "/usr/lib/ld-linux-x86-64.so.2",
debugpath=debugpath@entry=0x597c29f8 <vgPlain_interim_stack+1053848>, buildid=buildid@entry=0x1002884c30 "5bda152cf75d0de2f24431a9ab38ef1a99cbedf9", crc=crc@entry=0xe7c35341,
rel_ok=rel_ok@entry=0x0) at m_debuginfo/readelf.c:1451
#4 0x00000000580779fd in find_debug_file (di=di@entry=0x100292f0f0, objpath=0x100292e950 "/usr/lib/ld-linux-x86-64.so.2",
buildid=buildid@entry=0x1002884c30 "5bda152cf75d0de2f24431a9ab38ef1a99cbedf9", debugname=debugname@entry=0x100291f580 "ld-linux-x86-64.so.2.debug", crc=crc@entry=0xe7c35341,
rel_ok=rel_ok@entry=0x0) at m_debuginfo/readelf.c:1600
#5 0x000000005807be6e in vgModuleLocal_read_elf_debug_info (di=di@entry=0x100292f0f0) at m_debuginfo/readelf.c:3036
#6 0x000000005806facc in di_notify_ACHIEVE_ACCEPT_STATE (di=0x100292f0f0) at m_debuginfo/debuginfo.c:969
#7 vgPlain_di_notify_mmap (a=<optimized out>, allow_SkFileV=allow_SkFileV@entry=0x1, use_fd=use_fd@entry=0xffffffff) at m_debuginfo/debuginfo.c:1436
#8 0x00000000580b51d7 in valgrind_main (argc=argc@entry=0x2, argv=argv@entry=0x7ffc1b73e5e8, envp=envp@entry=0x7ffc1b73e600) at m_main.c:1878
#9 0x00000000580b5d7a in _start_in_C_linux (pArgc=0x7ffc1b73e5e0) at m_main.c:3129
#10 0x00000000580afe11 in _start ()
$ yay -Qi debuginfod
Name : debuginfod
Version : 0.189-3
...
From the above backtrace, it seems that valgrind was stuck at `find_debug_file_debuginfod`.
I have followed this topic. Then I have updated my system by `sudo pacman -Syu` and checked the env to ensure it is right
$ uname -r
6.4.12-arch1-1
$ yay -Qu
# show nothing
$ echo $DEBUGINFOD_URLS
https://debuginfod.archlinux.org
# https://bbs.archlinux.org/viewtopic.php?pid=2107051#p2107051
$ ldd --version
ldd (GNU libc) 2.38
# https://bbs.archlinux.org/viewtopic.php?pid=21027
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20230801 (GCC)
However the problem is still there with `valgrind`.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
But based on the debuginfod wiki, `gdb` works well with the `debuginfod`
$ gdb -nx -iex 'set debuginfod enabled on' ls
Reading symbols from ls...
Reading symbols from /home/czg/.cache/debuginfod_client/34d542844982c2650c224cdebf7c8b856f361a1a/debuginfo...
(gdb)
Can anyone help me with the problem ? Thanks beforehand.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
updated:
After reading one related bug report, I tried the following:
$ strace valgrind --tool=helgrind ./main-race
...
wait4(22192, NULL, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
$ ps -Ao pid,wchan | grep 22192
22192 do_sys_poll
$ ps aux | grep 22192
czg 22192 0.1 0.0 92836 11516 pts/8 S+ 14:23 0:00 /usr/bin/debuginfod-find debuginfo 5bda152cf75d0de2f24431a9ab38ef1a99cbedf9
czg 22198 0.0 0.0 11288 3072 pts/10 S+ 14:23 0:00 grep --color=always 22192
$ strace /usr/bin/debuginfod-find debuginfo 5bda152cf75d0de2f24431a9ab38ef1a99cbedf9
...
poll([{fd=6, events=POLLIN}], 1, 741^C) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
$ echo $DEBUGINFOD_URLS
https://debuginfod.archlinux.org
$ ping debuginfod.archlinux.org
PING debuginfod.archlinux.org (168.119.240.111) 56(84) bytes of data.
64 bytes from debuginfod.archlinux.org (168.119.240.111): icmp_seq=1 ttl=43 time=263 ms
64 bytes from debuginfod.archlinux.org (168.119.240.111): icmp_seq=3 ttl=43 time=262 ms
^C64 bytes from 168.119.240.111: icmp_seq=4 ttl=43 time=262 ms
--- debuginfod.archlinux.org ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3024ms
From this SO question comment, it seems to be waiting for the data from the "debuginfod.archlinux.org" but my network seems to be fine. So what is the problem here and how to solve with it?
Last edited by czg (2023-08-31 06:38:48)
Offline
Weird, I tried using `export DEBUGINFOD_URLS="https://debuginfod.elfutils.org/"` and then all work fine.
Could someone tell me whether there are some nuances between `https://debuginfod.elfutils.org/` and `https://debuginfod.archlinux.org` which causes the above failure? Thanks beforehand.
Last edited by czg (2023-08-31 06:48:10)
Offline