[BUG] Stop caused by cpptools’ own -exec-interrupt (to insert a breakpoint while running) shows ‘Exception has occurred. Signal 0’ and doesn’t resume.

Đang mở
#14,869 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
devtools

Hướng nghiên cứu

Start by tracing how cppdbg handles GDB MI stop events with reason="signal-received" and how signal-name="0" is surfaced as an exception. The issue provides reproduction steps and debugger logs, but names no source files or tests; first reproduce with a 64-bit GDB debugging a 32-bit WOW64 process while inserting a breakpoint. Done means dynamic breakpoint insertion no longer shows a blocking false error for this stop.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

debugger
Environment

Environment:

  • OS and Version: Windows 10 x64
  • VS Code Version: 1.146.0
  • C/C++ Extension Version: v1.32.2
  • Debugger: GDB (both x86_64-w64-mingw32-gdb 18.1 and gdb-multiarch 18.1 from MSYS2)
  • Target: 32-bit (i386) executable running under WOW64.
Bug Summary and Steps to Reproduce

When debugging a 32-bit (WOW64) process with a 64-bit GDB, the debugger halts and displays an "Exception has occurred. Signal 0" message. This happens when VS Code's cppdbg extension sends an -exec-interrupt command to pause the running process, typically to insert a new breakpoint.

The stop is reported by GDB with reason="signal-received" and signal-name="0" (an unknown signal), which the extension then surfaces as a blocking error dialog. The call stack is irrelevant to the cause; the program counter is simply wherever the thread happened to be (e.g., in a system or library function like SDL_LogCritical). This prevents adding breakpoints during an active debug session, as the user must manually click "Continue" to dismiss the false alarm every time.

To Reproduce:

  1. On Windows x64, configure launch.json to use a 64-bit GDB (e.g., C:/msys64/ucrt64/bin/gdb-multiarch.exe) to debug a 32-bit (i386) executable.
  2. Start the debug session and let the program run.
  3. While the program is running, add a new breakpoint in a source file via the editor gutter.
  4. VS Code sends -exec-interrupt to pause the process. GDB responds with *stopped,reason="signal-received",signal-name="0".
  5. The extension displays the "Exception has occurred. Signal 0" error.

Expected behavior:

The -exec-interrupt command should result in a normal, silent stop (e.g., reason="signal-received",signal-name="SIGINT"). The extension should not surface this as an exception or error to the user. The debugger should be ready for the subsequent -break-insert command without a blocking dialog.

Actual behavior:

The extension interprets GDB's signal-name="0" as a fatal error and surfaces an "Exception has occurred" dialog, halting the user's workflow.

Debugger Logs (engineLogging: true):

The log clearly shows the sequence: VS Code sends -exec-interrupt in response to a setBreakpoints request, and GDB replies with the spurious signal.

<-- C (setBreakpoints-12): {"command":"setBreakpoints","arguments":{"source":{"name":"Model.cpp",...},"lines":[174],...},"type":"request","seq":12}
1: (6400) <-1027-exec-interrupt
1: (6410) ->~"\nThread 1 stopped.\n"
1: (6415) ->*stopped,reason="signal-received",signal-name="0",signal-meaning="Signal 0",frame={addr="0x6c7be23f",func="SDL_LogCritical",from="...SDL2.dll",arch="i386"},thread-id="1",stopped-threads="all"

Additional context:

  • The issue is not related to a specific C++ exception (a catch throw catchpoint has times="0").
  • The issue is not related to SDL's thread-naming exception (0x406D1388), as setting SDL_WINDOWS_DISABLE_THREAD_NAMING=1 does not change the symptom.
  • The root cause is a known GDB bug where its Windows WOW64 support fails to correctly associate its own internal DebugBreakProcess call with the resulting STATUS_BREAKPOINT exception, misreporting it as Signal 0.
  • This behavior is reproducible with both gdb and gdb-multiarch from MSYS2.
  • A workaround is to set all breakpoints before starting the debug session, which avoids the -exec-interrupt. However, this is not a fix for dynamic breakpoint insertion.
  • Relevant launch.json configuration used:
    {
      "type": "cppdbg",
      "request": "launch",
      "MIMode": "gdb",
      "miDebuggerPath": "C:/msys64/ucrt64/bin/gdb-multiarch.exe",
      "logging": { "engineLogging": true, "trace": true },
      "setupCommands": [ ... ]
    }
    
  • An ignoreFailures or a "continue on signal 0" option in the extension could serve as a potential workaround for users unable to change their GDB version.
Debugger Configurations
see above
Debugger Logs
see above
Other Extensions

No response

Additional Information

No response

Ngôn ngữ chính
TypeScript
Star
6.2k
Fork
1.7k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/vscode-cpptools

Tất cả issue của microsoft/vscode-cpptools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.