我尝试运行gdb
,keepassxc
但遇到了一个不熟悉的错误:
$ gdb /usr/bin/keepassxc
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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/keepassxc...Reading symbols from /usr/lib/debug/.build-id/80/9b2f2d5157a8872dcd140977ba01adfca0e7ad.debug...done.
done.
(gdb) run
Starting program: /usr/bin/keepassxc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Cannot find user-level thread for LWP 15111: generic error
(gdb) quit
GDB FAQ 给出了一些常见的错误原因,例如“无法找到 LWP 15111 的用户级线程:一般错误”(LWP 后的数字每次都不同):
9. GDB 报告“无法找到 LWP 23957 的用户级线程:一般错误”,我该如何修复?
有几种常见原因:
libthread_db.so.1
和之间不匹配libpthread.so.0
(这种情况最常发生在您安装多个 glibc 时,或者当您在远程目标上调试程序时,主机和目标具有不同的 glibc 版本)。您正在使用 64 位调试器来调试 32 位程序,而您的内核存在 32 位 ptrace 模拟错误。FIXME:添加对特定内核修复的引用。
当从 DPMI 上下文调用 DOSEMU 的信号处理程序之一时,也会发生这种情况,其中
$gs
寄存器的值与 GDB 和/或预期的值不同libthread_db.so.0
; 塞缪尔·布朗森发现运行该程序gdbserver
可以缓解该问题,至少在6.8.50.20090620-cvs
i386 版本下是这样。
https://sourceware.org/gdb/wiki/FAQ
我正在运行启用了 i386 的 64 位机器:
$ getconf LONG_BIT
64
$ dpkg --print-foreign-architectures
i386
$ dlocate libthread_db.so.1
libc6-i386: /lib32/libthread_db.so.1
libc6:i386: /lib/i386-linux-gnu/libthread_db.so.1
libc6:amd64: /lib/x86_64-linux-gnu/libthread_db.so.1
$ dlocate libpthread.so.0
libc6-i386: /lib32/libpthread.so.0
libc6:i386: /lib/i386-linux-gnu/libpthread.so.0
libc6:amd64: /lib/x86_64-linux-gnu/libpthread.so.0
并keepassxc
使用libpthread.so.0
:
$ ldd /usr/bin/keepassxc | grep thread
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f889b803000)
但同样如此texstudio
:
$ ldd /usr/bin/texstudio | grep thread
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efd2a09e000)
我可以texstudio
正常加载。
$ gdb /usr/bin/texstudio
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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/texstudio...Reading symbols from /usr/lib/debug/.build-id/8c/49a9b8c208b2b75fbd3dc0ad9d9bf009886a47.debug...done.
done.
(gdb) run
Starting program: /usr/bin/texstudio
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe915a700 (LWP 20816)]
[New Thread 0x7fffda55f700 (LWP 20822)]
[New Thread 0x7fffcb7e9700 (LWP 20823)]
[New Thread 0x7fffca2fe700 (LWP 20824)]
[New Thread 0x7fffc96d9700 (LWP 20825)]
[New Thread 0x7fffc0937700 (LWP 20826)]
[Thread 0x7fffc0937700 (LWP 20826) exited]
[Thread 0x7fffc96d9700 (LWP 20825) exited]
[Thread 0x7fffca2fe700 (LWP 20824) exited]
[Thread 0x7fffe915a700 (LWP 20816) exited]
[Thread 0x7fffcb7e9700 (LWP 20823) exited]
[Thread 0x7fffda55f700 (LWP 20822) exited]
[Inferior 1 (process 20796) exited normally]
(gdb) quit
此外,keepassxc
还有一个 64 位可执行文件:
$ file /usr/bin/keepassxc
/usr/bin/keepassxc: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=809b2f2d5157a8872dcd140977ba01adfca0e7ad, stripped
我能找到的最接近现有信息的是这个错误,所有者在重新启动后无法重现(不管怎样,我可以在重新启动后重现):
段错误:Ubuntu MATE 16.04 2.0.2 版本中的新问题
应用程序因总线错误而发生段错误/退出,有时候是在启动时,有时候是在稍后。
这是更新至 2.0.2 版本后的新进展。
尝试使用 GDB 启动会产生:
Starting program: /usr/bin/keepassx [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Cannot find user-level thread for LWP 5299: generic error
https://bugs.launchpad.net/ubuntu/+source/keepassx/+bug/1752353
这实际上是 中的一个错误keepassx
,而不是keepassxc
,但我在两者中都遇到了相同的行为。
$ gdb /usr/bin/keepassx
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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/keepassx...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/keepassx
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Cannot find user-level thread for LWP 14893: generic error
我发现一个调试策略是在运行可执行文件之前使用set verbose on
。以下是输出,以防万一:
Starting program: /usr/bin/keepassxc
Using PIE (Position Independent Executable) displacement 0x555555554000 for "/usr/bin/keepassxc".
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.27.so...done.
done.
Reading symbols from system-supplied DSO at 0x7ffff7ffa000...(no debugging symbols found)...done.
Reading in symbols for rtld.c...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libsodium.so.23...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Network.so.5...Reading symbols from /usr/lib/debug/.build-id/46/2cebeefa58e5ccff5415b007f6a24425f29ada.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5...Reading symbols from /usr/lib/debug/.build-id/f2/5f1c8a72b396ac28a985f7297d3ba0ed6cd567.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5...Reading symbols from /usr/lib/debug/.build-id/d2/9dfc2cdd3a3ae0e1110f0c87c2778c8998efbe.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libykpers-1.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libzxcvbn.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libargon2.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libgcrypt.so.20...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5...Reading symbols from /usr/lib/debug/.build-id/06/31cf3ce1c914e12696428ca4ed84951f588f6e.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5...Reading symbols from /usr/lib/debug/.build-id/fb/710113d79e6ddae5d5495d0721dfe1b70d5e82.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libstdc++.so.6...Reading symbols from /usr/lib/debug/.build-id/57/0bf32e8698fce3bfacc4a8b010827f842d1dd6.debug...done.
done.
Registering libstdc++-v6 pretty-printer for /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Registering xmethod matcher '%s' with %s' ...
Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libm-2.27.so...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.27.so...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug/.build-id/28/c6aade70b2d40d1f0f3d0a1a0cad1ab816448f.debug...done.
done.
Registering glibc-pthread-locks pretty-printer for /lib/x86_64-linux-gnu/libpthread.so.0 ...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from /usr/lib/x86_64-linux-gnu/libGL.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libpng16.so.16...Reading symbols from /usr/lib/debug/.build-id/d5/32f2230c3c84289a0833fc0c1352aaac5892c6.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1...Reading symbols from /usr/lib/debug/.build-id/41/bdc55c07d5e5b1d8ab38e2c19b1f535855e084.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libnghttp2.so.14...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libidn2.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/librtmp.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libpsl.so.5...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libnettle.so.6...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libgnutls.so.30...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libyubikey.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libusb-1.0.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libjson-c.so.3...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libgpg-error.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libdbus-1.so.3...Reading symbols from /usr/lib/debug/.build-id/c1/63c9bb03410c4c05458a989a804ff527d4f63f.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libicui18n.so.60...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libicuuc.so.60...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.27.so...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0...Reading symbols from /usr/lib/debug/.build-id/75/81e089260b8198caa28c2e16bd2353e7a62225.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libGLX.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libfreetype.so.6...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libgraphite2.so.3...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libunistring.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libhogweed.so.4...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libgmp.so.10...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libp11-kit.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libtasn1.so.6...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libkrb5.so.3...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libk5crypto.so.3...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libcom_err.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libkrb5support.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libresolv.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libresolv-2.27.so...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libsasl2.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libgssapi.so.3...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libudev.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libsystemd.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libicudata.so.60...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libpcre.so.3...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libX11.so.6...Reading symbols from /usr/lib/debug/.build-id/44/1896d78103c8cf264ba06687cd49c700a2c5b5.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libffi.so.6...Reading symbols from /usr/lib/debug/.build-id/35/55b5f599c9787dfddbf9e8df6f706b9044d985.debug...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libkeyutils.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libheimntlm.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libkrb5.so.26...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libasn1.so.8...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libhcrypto.so.4...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libroken.so.18...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/librt.so.1...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/librt-2.27.so...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/liblzma.so.5...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/liblz4.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libxcb.so.1...Reading symbols from /usr/lib/debug/.build-id/3d/49ac024ca8f7e36f5296a7d0d7f083ab1c8a62.debug...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libwind.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libheimbase.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libhx509.so.5...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libcrypt.so.1...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libcrypt-2.27.so...done.
done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libXau.so.6...(no debugging symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libXdmcp.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libbsd.so.0...(no debugging symbols found)...done.
Cannot find user-level thread for LWP 17450: generic error
Current language: auto
The current source language is "auto; currently c".
版本信息:
$ apt-cache policy keepassx keepassxc gdb
keepassx:
Installed: 2.0.3-1
Candidate: 2.0.3-1
Version table:
*** 2.0.3-1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
100 /var/lib/dpkg/status
keepassxc:
Installed: 2.3.1+dfsg.1-1
Candidate: 2.3.1+dfsg.1-1
Version table:
*** 2.3.1+dfsg.1-1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
100 /var/lib/dpkg/status
gdb:
Installed: 8.1-0ubuntu3
Candidate: 8.1-0ubuntu3
Version table:
*** 8.1-0ubuntu3 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
我的问题是:
这可以在其他机器和 Ubuntu 版本上重现吗?
如果是这样,这是 中的错误、和
gdb
中的错误、 中的错误,还是其他地方的错误?keepassx
keepassxc
libc-dbg