2

I'm using VSCode version 1.71.0 784b0177c56c607789f9638da7b6bf3230d47a8c x64 on Ubuntu Linux version 22.04.1 LTS. I'm compiling with GCC version 11.2.0 but the same problem occurs when the application is compiled with Clang 14.0.0 and Clang 16.0.0. My version of GDB is 12.0.90. I'm using C/C++ v.1.12.4 and CMake Tools v1.12.26 plugins for VSCode. I start debugging session with the CMake: Debug command by default assigned to the F5 shortcut. For some time the application I'm debugging started to crash when a breakpoint is hit. The exact message is the following:

Aborted (core dumped)
[1] + Aborted (core dumped)      "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-ifoflcfq.xvl" 1>"/tmp/Microsoft-MIEngine-Out-h4yklwfm.ghy"

The same problem does not occur when I'm using GDB from the command line and for that reason, I assume that the problem is related to the integration of GDB with VSCode. I cannot reproduce the problem with a small program. For a small test application, it works fine. At the beginning of debugging session, the following warning is displayed for a small amount of time before the terminal is cleared and the logs of the debugged application started to appear.

warning: GDB: Failed to set controlling terminal: Operation not permitted

I'm not sure whether it is somehow related to the problem.

bobeff
  • 3,543
  • 3
  • 34
  • 62
  • https://stackoverflow.com/a/8306805/1587755 – Taekahn Sep 08 '22 at 14:33
  • 1
    I'm having the exact same problem since couple of days. I have an identical system & toolset & IDE extensions (all at the same version). And I also get a core dump from gdb with a SIGABRT. Not sure if it's related to the integration of GDB in with CMakeTools extensions, (but I think I also tried with a `launch.json` configuration with the exact same results). Which let me thinks, it might be related to how vscode invokes GDB in mi-mode. I'll check if there's a similar issue at https://github.com/microsoft/vscode-cpptools, – Julien Villemure-Fréchette Sep 09 '22 at 01:31
  • 1
    It looks like the two `Aborted` messages are from a shell, rather than GDB itself. Usually, when GDB exists with SIGABRT this is because an internal assertion triggered, which should have printed an error somewhere - though if GDB is being run from inside VSCode, I assume that application is consuming the error. IF a core file has been created you could try `gdb -q -ex 'bt' /usr/bin/gdb -c ` and see if the backtrace includes useful symbols (might need to install debug symbols package for GDB first), then add the backtrace to this question. – Andrew Sep 09 '22 at 08:09
  • It can also happen when compiler optimization remains switched on for the debug build. It's worth checking that `-O0` is set. – Szellem Oct 17 '22 at 07:32
  • @bobeff Did you solve the problem? I'm having the exact same problem. – John Nov 11 '22 at 03:01
  • @JulienVillemure-Fréchette Better to upate the link. No direct issue is seen. – John Nov 11 '22 at 03:25

1 Answers1

1

This appears to be an issue with version GDB 12.09 and VS Code upgrading GDB to 12.1 by building from source resolved this issue for me as per this

https://github.com/microsoft/vscode-cpptools/issues/103#issuecomment-1151217772

JohnP
  • 11
  • 2