Often, I get a seg fault when switching between TUI and regular mode while debugging. I will try and update this report with more details -- when I have a debug build of GDB. To reproduce: In certain circumstances (yet to be determined :)) toggling from TUI view back to the regular view causes the GPF. I am using the keyboard shortcut (ctrl-x then a). This always works (no GPF) when no program file is loaded. The crash occurs only sometimes when a program file is loaded and is being debugged. When attempting to reproduce the bug I was debugging I can reliably reproduce the GPF by getting the inferior process to the same point and toggling TUI mode off. This bug therefore appears to be reliant on the inferior process and its state. I will add more details as I find them. (gdb) bt #0 0x00007f0d3f7034a5 in __GI__IO_fwrite (buf=0x55a300ac7030, size=1, count=6, fp=0x0) at iofwrite.c:35 #1 0x00007f0d40327a78 in ?? () from /lib/x86_64-linux-gnu/libreadline.so.8 #2 0x00007f0d403297e0 in rl_redisplay () from /lib/x86_64-linux-gnu/libreadline.so.8 #3 0x00007f0d403130f7 in readline_internal_setup () from /lib/x86_64-linux-gnu/libreadline.so.8 #4 0x00007f0d4032e769 in ?? () from /lib/x86_64-linux-gnu/libreadline.so.8 #5 0x000055a2fec6e75e in ?? () #6 0x000055a2fec6f3df in ?? () #7 0x000055a2fec6f1cc in ?? () #8 0x00007f0d4032ebde in rl_callback_read_char () from /lib/x86_64-linux-gnu/libreadline.so.8 #9 0x000055a2fec6e466 in ?? () #10 0x000055a2fec6f085 in ?? () #11 0x000055a2fec6e388 in ?? () #12 0x000055a2fec6d036 in ?? () #13 0x000055a2fec6d51c in ?? () #14 0x000055a2fec6d62e in ?? () #15 0x000055a2fed1cb4b in ?? () #16 0x000055a2fed1ecb5 in ?? () #17 0x000055a2feb38a80 in ?? () #18 0x00007f0d3f6a40b3 in __libc_start_main (main=0x55a2feb38a40, argc=10, argv=0x7ffcf30697c8, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7ffcf30697b8) at ../csu/libc-start.c:308 #19 0x000055a2feb3e41e in ?? () $ gdb --version GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 $ gcc -v Using built-in specs. COLLECT_GCC=/usr/bin/gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-6ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.5.0 (Ubuntu 7.5.0-6ubuntu2) $ uname -a Linux druscoe-mint 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Appears simple to reproduce once I unpacked how my scripts were invoking gdb. To reproduce: - Run gdb with TUI from the command line gdb --tui - Switch TUI mode off using keyboard shortcut. ctrl-x then a - GPF $ gdb --tui Aborted (core dumped)
Have you tried this with gdb 10 or 11?
Hi Christian, So, Ive built 9.2 branch from git and I can reproduce the problem on that build. I have also build the current master and the bug is no longer reproducible. It looks like this bug has already been fixed and I need to wait for my distro to update binutils. Thanks for your help. Damien
Thanks for checking! FWIW, even though binutils and gdb are in the same repository, most distributions ship gdb in a separate package. (so uninstalling gdb and installing the one you built yourself should not be as burdensome as doing that for your entire binutils)