codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

Possible M1 incompatibility with macOS Monterey (12.0 Beta)

Open QuietRocket opened this issue 4 years ago • 10 comments

OS: macOS Monterey 12.0 Beta VSCode version: 1.57.1 Extension version: 1.6.4 Compiler: rustc 1.53.0 (53cb7b09b 2021-06-17) Build target: stable-aarch64-apple-darwin

Hi. I'm trying to debug a simple Rust hello world with the following simplified (non-"cargo") debug configuration:

{
    "type": "lldb",
    "request": "launch",
    "name": "Debug executable 'hello'",
    "program": "${workspaceFolder}/target/debug/hello",
    "args": [],
    "cwd": "${workspaceFolder}"
}

Note: I can confirm that there is indeed an executable in the program path. I'll add a preLaunchTask to automatically build later.

I'm getting the error process exited with status -1 (debugserver died with signal SIGTRAP). I've seen multiple issues such as #414 which was marked as a duplicate of #397. Everyone else seems to be running the debugger fine on M1. Might it be because I am on a beta version of the operating system? Thank you.

Debug log
configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'run hello',
  program: '${workspaceFolder}/target/debug/hello',
  args: [],
  cwd: '${workspaceFolder}',
  sourceMap: {},
  sourceLanguages: [ 'rust' ],
  env: {
    RUST_BACKTRACE: 'short',
    ELECTRON_RUN_AS_NODE: '1',
    USER: 'quietrocket',
    __CFBundleIdentifier: 'com.microsoft.VSCode',
    COMMAND_MODE: 'unix2003',
    LOGNAME: 'quietrocket',
    PATH: '/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/quietrocket/.cargo/bin',
    SSH_AUTH_SOCK: '/private/tmp/com.apple.launchd.umlvcwbKwQ/Listeners',
    SHELL: '/bin/zsh',
    HOME: '/Users/quietrocket',
    __CF_USER_TEXT_ENCODING: '0x1F5:0x0:0x0',
    TMPDIR: '/var/folders/5n/nb7xpgh54rq4ys7t4n1__qz80000gn/T/',
    XPC_SERVICE_NAME: 'application.com.microsoft.VSCode.1698296.1698302',
    XPC_FLAGS: '0x0',
    ORIGINAL_XDG_CURRENT_DESKTOP: 'undefined',
    VSCODE_CWD: '/',
    VSCODE_NLS_CONFIG: '{"locale":"en-us","availableLanguages":{},"_languagePackSupport":true}',
    VSCODE_NODE_CACHED_DATA_DIR: '/Users/quietrocket/Library/Application Support/Code/CachedData/507ce72a4466fbb27b715c3722558bb15afa9f48',
    VSCODE_IPC_HOOK: '/Users/quietrocket/Library/Application Support/Code/1.57.1-main.sock',
    VSCODE_PID: '59174',
    SHLVL: '0',
    PWD: '/',
    OLDPWD: '/',
    HOMEBREW_PREFIX: '/opt/homebrew',
    HOMEBREW_CELLAR: '/opt/homebrew/Cellar',
    HOMEBREW_REPOSITORY: '/opt/homebrew',
    MANPATH: '/opt/homebrew/share/man::',
    INFOPATH: '/opt/homebrew/share/info:',
    _: '/Applications/Visual Studio Code.app/Contents/MacOS/Electron',
    VSCODE_AMD_ENTRYPOINT: 'vs/workbench/services/extensions/node/extensionHostProcess',
    VSCODE_PIPE_LOGGING: 'true',
    VSCODE_VERBOSE_LOGGING: 'true',
    VSCODE_LOG_NATIVE: 'false',
    VSCODE_IPC_HOOK_EXTHOST: '/var/folders/5n/nb7xpgh54rq4ys7t4n1__qz80000gn/T/vscode-ipc-3021fd44-acf7-40a5-a6d7-9588743d1b72.sock',
    VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true',
    VSCODE_LOG_STACK: 'false',
    APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL: 'true'
  },
  relativePathBase: '/Users/quietrocket/Stuff/Coding/Rust/hello'
}
liblldb: /Users/quietrocket/.vscode/extensions/vadimcn.vscode-lldb-1.6.4/lldb/lib/liblldb.dylib
environment: {}
params: {
  evaluateForHovers: true,
  commandCompletions: true,
  sourceLanguages: [ 'rust' ]
}
Listening on port 60579
[2021-06-21T17:13:54.189Z DEBUG codelldb] New debug session
INFO(Python) 10:13:54 formatters: Initializing
INFO(Python) 10:13:54 formatters.rust: Initializing
[2021-06-21T17:13:54.403Z DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true,"supportsInvalidatedEvent":true},"type":"request","seq":1}
[2021-06-21T17:13:54.405Z DEBUG codelldb::dap_codec]  {"command":"launch","arguments":{"type":"lldb","request":"launch","name":"run hello","program":"/Users/quietrocket/Stuff/Coding/Rust/hello/target/debug/hello","args":[],"cwd":"/Users/quietrocket/Stuff/Coding/Rust/hello","sourceMap":{},"sourceLanguages":["rust"],"env":{"RUST_BACKTRACE":"short","ELECTRON_RUN_AS_NODE":"1","USER":"quietrocket","__CFBundleIdentifier":"com.microsoft.VSCode","COMMAND_MODE":"unix2003","LOGNAME":"quietrocket","PATH":"/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/quietrocket/.cargo/bin","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.umlvcwbKwQ/Listeners","SHELL":"/bin/zsh","HOME":"/Users/quietrocket","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","TMPDIR":"/var/folders/5n/nb7xpgh54rq4ys7t4n1__qz80000gn/T/","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.1698296.1698302","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","VSCODE_CWD":"/","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_NODE_CACHED_DATA_DIR":"/Users/quietrocket/Library/Application Support/Code/CachedData/507ce72a4466fbb27b715c3722558bb15afa9f48","VSCODE_IPC_HOOK":"/Users/quietrocket/Library/Application Support/Code/1.57.1-main.sock","VSCODE_PID":"59174","SHLVL":"0","PWD":"/","OLDPWD":"/","HOMEBREW_PREFIX":"/opt/homebrew","HOMEBREW_CELLAR":"/opt/homebrew/Cellar","HOMEBREW_REPOSITORY":"/opt/homebrew","MANPATH":"/opt/homebrew/share/man::","INFOPATH":"/opt/homebrew/share/info:","_":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","VSCODE_AMD_ENTRYPOINT":"vs/workbench/services/extensions/node/extensionHostProcess","VSCODE_PIPE_LOGGING":"true","VSCODE_VERBOSE_LOGGING":"true","VSCODE_LOG_NATIVE":"false","VSCODE_IPC_HOOK_EXTHOST":"/var/folders/5n/nb7xpgh54rq4ys7t4n1__qz80000gn/T/vscode-ipc-3021fd44-acf7-40a5-a6d7-9588743d1b72.sock","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_LOG_STACK":"false","APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL":"true"},"relativePathBase":"/Users/quietrocket/Stuff/Coding/Rust/hello","_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true},"__sessionId":"0579c3ad-fa2b-4468-ba71-8c56f484d170"},"type":"request","seq":2}
[2021-06-21T17:13:54.411Z DEBUG codelldb::dap_codec]  {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
[2021-06-21T17:13:54.426Z DEBUG codelldb::dap_codec]  {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
[2021-06-21T17:13:54.430Z DEBUG codelldb::dap_codec]  {"command":"setExceptionBreakpoints","arguments":{"filters":["rust_panic"]},"type":"request","seq":5}
[2021-06-21T17:13:54.442Z DEBUG codelldb::dap_codec] --> {"type":"response","seq":6,"command":"runInTerminal","request_seq":3,"success":true,"body":{"shellProcessId":70830}}
[2021-06-21T17:13:54.448Z DEBUG codelldb::dap_codec]  {"command":"configurationDone","type":"request","seq":7}
[2021-06-21T17:13:54.450Z DEBUG codelldb::dap_codec]  {"command":"threads","type":"request","seq":8}
[2021-06-21T17:13:54.452Z DEBUG codelldb::dap_codec]  {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":9}
[2021-06-21T17:13:55.030Z DEBUG codelldb::dap_codec] 

QuietRocket avatar Jun 21 '21 17:06 QuietRocket

Yeah, something's broken on osx 12.0. Please see this thread: #456.

vadimcn avatar Jun 21 '21 17:06 vadimcn

Just to update, I did the proposed fix mentioned in the thread: "delete debugserver executable in the /lldb/bin folder".

It worked like a charm. Thanks! I don't know if this issue should be kept open or a separate issue should track stable Monterey support (since I titled this one specifically 12.0 beta).

QuietRocket avatar Jun 22 '21 06:06 QuietRocket

Installed osx 12.0, same error for me(delete still works).

fi6 avatar Oct 26 '21 07:10 fi6

fantastic! That works for me!

DongqiShen avatar Oct 27 '21 15:10 DongqiShen

I don't own an M1 mac, so would appreciate if someone could test this build for me: https://github.com/vadimcn/vscode-lldb/releases/download/v1.6.9-dev.2110291651/codelldb-bootstrap.vsix

vadimcn avatar Oct 29 '21 17:10 vadimcn

@vadimcn It's working now with that 👍

image

image

sh-cho avatar Oct 30 '21 05:10 sh-cho

@vadimcn That build works for me as well. macOS Monterey 12.0.1 on a MacBook with M1 Pro.

nelsonjchen avatar Oct 31 '21 16:10 nelsonjchen

I tried that version and also the one from the extension marketplace (1.6.10) and launching the debugger is crashing.

configuration: {
  name: 'Debug',
  type: 'lldb',
  request: 'launch',
  program: '${workspaceFolder}/build/arm64/dbg/bin/program',
  args: [ "arg1"  ],
  stopAtEntry: true,
  cwd: '${workspaceFolder}',
  environment: [],
  targetArchitecture: 'arm64',
  externalConsole: false,
  MIMode: 'lldb',
  __configurationTarget: 5,
  relativePathBase: '/Users/user0/test'
}
Listening on port 52282
Received signal: SIGSEGV
   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: codelldb::hook_crashes::handler
   3: _platform_task_attach

Debug adapter exit code=255, signal=null.

iAbadia avatar Feb 03 '22 15:02 iAbadia

@iAbadia: Same thing here. macOS Monterey on M1X. It worked perfectly fine for a few weeks and then I got that SIGSEV. Removing the binaries in extension/bin as mentioned in #456 did not work. However, running the command "LLDB: Use Alternative Backend" and inputting /usr/bin/lldb seems to do the trick for me. I guess something updated in vscode and broke things?

johanostensson avatar Feb 05 '22 21:02 johanostensson

Thank you @johanostensson ! That worked for me too

iAbadia avatar Feb 08 '22 11:02 iAbadia