简体   繁体   English

如何防止GDB在具有完整磁盘的计算机上启动缓慢

[英]How to prevent gdb being slow to start on machine with full disk

In a docker container with disk full gdb takes a while starting. 在磁盘已满的docker容器中,gdb需要一段时间才能启动。 It takes a very long while starting for large binary & large core dumps. 开始大型二进制和大型核心转储需要长时间。

It is emitting errors like "error: db5 error(28) from dbenv->open: No space left on device". 它发出诸如“错误:来自dbenv-> open的db5 error(28)错误:设备上没有剩余空间”之类的错误。 Grepping the internet shows that error is associated with yum/rpm. 上网查询表明错误与yum / rpm有关。

I just want a quick backtrace from the core dump initially. 我只想最初从核心转储中快速回溯。

How can I prevent gdb doing whatever initialisation it is doing? 如何防止gdb进行初始化? (presumably loading debug symbols for shared/linked libraries). (大概是为共享/链接库加载调试符号)。

Note that while it is loading / being slow Ctrl-C doesn't work. 请注意,在加载/缓慢时,Ctrl-C无效。 Ctrl-Z (suspend) does work so you can always suspend and kill the command if it is taking too long. Ctrl-Z(挂起)确实可以工作,因此如果花费的时间太长,您可以始终挂起并终止该命令。

[root@XXX]# gdb -c core.XXX bin/XXX
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7
Copyright (C) 2013 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".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from bin/XXX...
done.
[New LWP 19938]
[New LWP 20044]
.
.
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages index using db5 - No space left on device (28)
error: cannot open Packages database in 
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages database in 
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages database in 
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages database in 
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages database in 
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages database in 
Missing separate debuginfo for /lib64/libm.so.6
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/72/1c7cc9488efa25f83b48af713ab27dbe48ef3e.debug
error: db5 error(28) from dbenv->open: No space left on device
error: cannot open Packages database in 
.
.

Possibly related but . 可能相关但是。 . .
Tell gdb to skip standard files 告诉gdb跳过标准文件

These errors don't come from gdb itself, but rather from some library coming from RPM. 这些错误不是来自gdb本身,而是来自RPM的某些库。 Some distros, like Fedora, patch gdb to have it look up which libraries might have separate debuginfo that has not been installed. 一些发行版(例如Fedora)对gdb进行了修补,以使其查找哪些库可能具有尚未安装的单独的debuginfo。

There's no way to disable this in the gdb you already have. 无法在已有的gdb中禁用此功能。 However, you could build your own gdb that does not have this patch applied. 但是,您可以构建自己的不应用此补丁程序的gdb。 This would solve the problem you are seeing. 这样可以解决您遇到的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM