You are not logged in.

#1 2023-03-27 06:46:37

NetSysFire
Wiki Maintainer
Registered: 2020-10-12
Posts: 22

[SOLVED] gdb hangs, eating up all available RAM while reading symbols

Title says it all.

I need to debug a crash of an application (cataclysm-tiles in this case, package is community/cataclysm-dda-tiles), downloaded and installed https://geo.mirror.pkgbuild.com/communi … kg.tar.zst and it eats an insane amount of memory.
I am no expert on gdb, but I have successfully used it to obtain traces without such issues. The debugging symbols file, /usr/lib/debug/usr/bin/cataclysm-tiles.debug, is just 700 MB in size.

This is what happens when I run it:

$ gdb cataclysm-tiles
GNU gdb (GDB) 13.1
Copyright (C) 2023 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-pc-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 cataclysm-tiles...
Reading symbols from /usr/lib/debug/usr/bin/cataclysm-tiles.debug...
^C^C^C^Czsh: killed     gdb cataclysm-tiles

My ^C's did not work and it was reaped by the OOM killer shortly after. I have 8 GB of RAM, which should be perfectly fine.

The curious thing is that I have found only two other issues like that on the interwebs, both unresolved and abandoned: https://bugreports.qt.io/browse/QTCREATORBUG-20133 and https://bugzilla.redhat.com/show_bug.cgi?id=1701456, which match my issue exactly.

What is the cause of this? Is this an upstream cataclysm dda issue, a gdb bug or something with my system?

Last edited by NetSysFire (2023-03-27 22:08:54)

Offline

#2 2023-03-27 22:08:35

NetSysFire
Wiki Maintainer
Registered: 2020-10-12
Posts: 22

Re: [SOLVED] gdb hangs, eating up all available RAM while reading symbols

I managed to speak to a gdb dev. They could reproduce: It did not hang but it used more than 8 GB of RAM. They suspect LTO as the cause as it is apparently a known RAM hog.
Apparently it does get a little better with debuginfod and with gdb built freshly from master due to some newer patches but might not solve my problem entirely.

However, this massive amount of RAM usage is usually only present in big projects like Firefox. I will take it up with upstream, aka cataclysm dda, there might be things that can be optimized.

Edit: I found a pretty good source and explanation for all of this! https://sourceware.org/bugzilla/show_bu … =23710#c24

Last edited by NetSysFire (2023-03-28 02:20:32)

Offline

Board footer

Powered by FluxBB