microsoft / microsoft/vscode-cpptools

M3 Mac debug shared_ptr<vector<>> object exited unexpectedly with exit code 132 (0x84)

Open
#11,966 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger help wanted
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: macOS 14.1 (23B2073)
  • VS Code: Version: 1.85.2 (Universal)
  • C/C++ extension: C/C++ v1.19.3 Pre-Release
  • OS and version of remote machine (if applicable): no remote machine, local machine uses Apple M3 Max
  • GDB / LLDB version:
    • LLDB: lldb-1500.0.200.58 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
    • GDB: not installed
Bug Summary and Steps to Reproduce

Bug Summary:
I try to debug cpp code with std::shared_ptr<std::vector<int>> object, but when running debug, debugger exit immediately with following log printed in DEBUG CONSOLE:

Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=library-unloaded,id="/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test",target-name="/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test",host-name="/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test"
Loaded '/usr/lib/dyld'. Symbols loaded.
Loaded '/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test'. Symbols loaded.
=library-unloaded,id="/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test",target-name="/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test",host-name="/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test"
Loaded '/usr/lib/libc++.1.dylib'. Symbols loaded.
Loaded '/usr/lib/libSystem.B.dylib'. Symbols loaded.
Loaded '/usr/lib/libc++abi.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libcache.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libcommonCrypto.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libcompiler_rt.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libcopyfile.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libcorecrypto.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libdispatch.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libdyld.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libkeymgr.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libmacho.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libquarantine.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libremovefile.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_asl.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_blocks.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_c.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_collections.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_configuration.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_containermanager.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_coreservices.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_darwin.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_darwindirectory.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_dnssd.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_featureflags.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_info.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_m.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_malloc.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_networkextension.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_notify.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_sandbox.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_secinit.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_kernel.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_platform.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_pthread.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_symptoms.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libsystem_trace.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libunwind.dylib'. Symbols loaded.
Loaded '/usr/lib/system/libxpc.dylib'. Symbols loaded.
Loaded '/usr/lib/libobjc.A.dylib'. Symbols loaded.
Loaded '/usr/lib/liboah.dylib'. Symbols loaded.
=thread-selected,id="1"
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
ERROR: LLDB exited unexpectedly with exit code 132 (0x84). Debugging will now abort.
The program '/Users/intro/Spaces/TestSpace/CMake_Test/build/debug_test' has exited with code -1 (0xffffffff).

When I try to debug with CMake Tools, it has the same issue.

Steps to reproduce:

  1. Create main.cpp file with following code:
#include <iostream>
#include <memory>
#include <string>
#include <vector>

int main() {
  std::shared_ptr<std::vector<int>> vec_ptr;
  std::string msg = "can I debug here?\n";
  std::cout << msg;
  return 0;
}
  1. Create CMakeLists.txt file:
cmake_minimum_required(VERSION 3.23.2)

set(CMAKE_CXX_STANDARD 17)

project(debug_test)

add_executable(debug_test main.cpp)
  1. Run CMake: Configure in VSCode Command Panel
  2. Set breakpoint at std::shared_ptr<std::vector<int>> vec_ptr;
  3. Debug with CMake Tools or Cpp extension
Debugger Configurations

tasks.json:

{
  "tasks": [
    {
      "type": "cppbuild",
      "label": "C/C++: clang++ build active file",
      "command": "/usr/bin/clang++",
      "args": [
        "-fcolor-diagnostics",
        "-fansi-escape-codes",
        "-g",
        "${file}",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "${fileDirname}"
      },
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "detail": "Task generated by Debugger."
    }
  ],
  "version": "2.0.0"
}

launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch",
      "type": "lldb",
      "request": "launch",
      "program": "${fileDirname}/${fileBasenameNoExtension}",
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]
}
Debugger Logs
loggingLevel: Debug
loggingLevel has changed to: Debug
LSP: (invoked) cpptools/didChangeCppProperties (id: 1079)
LSP: Sending response (id: 1079)
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Intellisense update pending for: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp
LSP: (received) cpptools/didChangeActiveEditor: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp
LSP: (received) cpptools/getCodeActions: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp (id: 1080)
LSP: (invoked) cpptools/didChangeActiveEditor: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp
LSP: (received) cpptools/didChangeTextEditorSelection
LSP: (invoked) cpptools/getCodeActions: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp (id: 1080)
LSP: Sending response (id: 1080)
LSP: (invoked) cpptools/didChangeTextEditorSelection
IntelliSense update scheduled and TU acquisition started for: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp
Update IntelliSense time (sec): 0.004
LSP: (received) cpptools/getFoldingRanges: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp (id: 1081)
LSP: (invoked) cpptools/getFoldingRanges: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp (id: 1081)
LSP: Sending response (id: 1081)
LSP: (received) cpptools/pauseCodeAnalysis
LSP: (invoked) cpptools/pauseCodeAnalysis
LSP: (received) cpptools/resumeCodeAnalysis
LSP: (invoked) cpptools/resumeCodeAnalysis
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
LSP: (received) cpptools/didChangeActiveEditor: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp
LSP: (invoked) cpptools/didChangeActiveEditor: file:///Users/intro/Spaces/TestSpace/CMake_Test/main.cpp
LSP: (received) cpptools/didChangeVisibleTextEditors
LSP: (invoked) cpptools/didChangeVisibleTextEditors
Other Extensions
  1. CMake v0.0.17
  2. CMake Tools v1.17.15
  3. CodeLLDB v1.10.0
Additional Information

After deleting std::shared_ptr<std::vector<int>> vec_ptr;, I can debug normally.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the minimal main.cpp, CMakeLists.txt, tasks.json, and launch.json configurations on macOS with the listed LLDB setup. Compare debugging with and without the std::shared_ptr<std::vector> declaration; done means the program no longer causes LLDB to exit unexpectedly and debugging reaches the breakpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.