Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible M1 incompatibility with macOS Monterey (12.0 Beta) #465

Open
QuietRocket opened this issue Jun 21, 2021 · 10 comments
Open

Possible M1 incompatibility with macOS Monterey (12.0 Beta) #465

QuietRocket opened this issue Jun 21, 2021 · 10 comments
Labels
platform:macos-arm64 The issue is specific to arm64 MacOS.

Comments

@QuietRocket
Copy link

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] <-- {"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"rust_panic","label":"Rust: on panic"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}
[2021-06-21T17:13:54.411Z 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] <-- {"type":"event","seq":1,"event":"capabilities","body":{"capabilities":{"exceptionBreakpointFilters":[{"default":true,"filter":"rust_panic","label":"Rust: on panic"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}}
[2021-06-21T17:13:54.424Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":2,"event":"initialized"}
[2021-06-21T17:13:54.424Z DEBUG codelldb::dap_codec] <-- {"type":"request","seq":3,"command":"runInTerminal","arguments":{"args":["/Users/quietrocket/.vscode/extensions/vadimcn.vscode-lldb-1.6.4/adapter/codelldb","terminal-agent","--port=60581"],"cwd":"","kind":"integrated","title":"run hello"}}
[2021-06-21T17:13:54.426Z DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
[2021-06-21T17:13:54.426Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
[2021-06-21T17:13:54.429Z DEBUG codelldb::dap_codec] --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
[2021-06-21T17:13:54.430Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":4,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]}}
[2021-06-21T17:13:54.433Z 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] <-- {"type":"response","request_seq":5,"success":true,"command":"setExceptionBreakpoints"}
[2021-06-21T17:13:54.450Z DEBUG codelldb::dap_codec] --> {"command":"configurationDone","type":"request","seq":7}
[2021-06-21T17:13:54.450Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":7,"success":true,"command":"configurationDone"}
[2021-06-21T17:13:54.452Z DEBUG codelldb::dap_codec] --> {"command":"threads","type":"request","seq":8}
[2021-06-21T17:13:54.452Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":8,"success":true,"command":"threads","body":{"threads":[]}}
[2021-06-21T17:13:54.456Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":4,"event":"output","body":{"output":"Launching: /Users/quietrocket/Stuff/Coding/Rust/hello/target/debug/hello\n"}}
[2021-06-21T17:13:55.006Z ERROR codelldb::debug_session] process exited with status -1 (debugserver died with signal SIGTRAP)
[2021-06-21T17:13:55.006Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":2,"success":false,"message":"process exited with status -1 (debugserver died with signal SIGTRAP)","show_user":true}
[2021-06-21T17:13:55.030Z DEBUG codelldb::dap_codec] --> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":9}
[2021-06-21T17:13:55.030Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":9,"success":true,"command":"disconnect"}
[2021-06-21T17:13:55.512Z DEBUG codelldb::dap_session] Client has disconnected
[2021-06-21T17:13:55.514Z DEBUG codelldb::debug_session] End of the requests stream
[2021-06-21T17:13:55.514Z DEBUG codelldb::debug_session] DebugSession::drop()
[2021-06-21T17:13:55.515Z DEBUG codelldb] Session has ended
[2021-06-21T17:13:55.525Z DEBUG codelldb] Exiting
Debug adapter exit code=0, signal=null.
@vadimcn
Copy link
Owner

vadimcn commented Jun 21, 2021

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

@QuietRocket
Copy link
Author

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).

@fi6
Copy link

fi6 commented Oct 26, 2021

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

@DongqiShen
Copy link

fantastic! That works for me!

@vadimcn
Copy link
Owner

vadimcn commented Oct 29, 2021

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

@sh-cho
Copy link

sh-cho commented Oct 30, 2021

@vadimcn It's working now with that 👍

image

image

@nelsonjchen
Copy link

nelsonjchen commented Oct 31, 2021

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

@iAbadia
Copy link

iAbadia commented Feb 3, 2022

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.

@johanostensson
Copy link

@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?

@iAbadia
Copy link

iAbadia commented Feb 8, 2022

Thank you @johanostensson ! That worked for me too

@vadimcn vadimcn added the platform:macos-arm64 The issue is specific to arm64 MacOS. label Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:macos-arm64 The issue is specific to arm64 MacOS.
Projects
None yet
Development

No branches or pull requests

8 participants