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

Debugging does not work on Mac 12.0.1 with M1 (arm64) and .NET 6 #4887

Closed
skyflyer opened this issue Nov 11, 2021 · 4 comments
Closed

Debugging does not work on Mac 12.0.1 with M1 (arm64) and .NET 6 #4887

skyflyer opened this issue Nov 11, 2021 · 4 comments

Comments

@skyflyer
Copy link

The debugging fails with error Unable to attach to CoreCLR. Unknown Error: 0x80131c3c.

Interestingly, the debugger is installed for x64 and not arm64 - I'm not sure if that is by design or by mistake. I include the extension install logs below.

Environment data

VSCode version: 1.62.1
C# Extension: 1.23.16

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff

Runtime Environment:
OS Name: Mac OS X
OS Version: 12.0
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/6.0.100/

Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa

.NET SDKs installed:
6.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
bracket-pair-colorizer CoenraadS 1.0.61
code-spell-checker streetsidesoftware 2.0.12
csharp ms-dotnettools 1.23.16
dart-code Dart-Code 3.28.0
flutter Dart-Code 3.28.0
gitlens eamodio 11.6.1
go golang 0.29.0
prettier-vscode esbenp 9.0.0
python ms-python 2021.11.1422169775
rainbow-csv mechatroner 1.9.1
remote-containers ms-vscode-remote 0.205.2
remote-ssh ms-vscode-remote 0.66.1
remote-ssh-edit ms-vscode-remote 0.66.1
rest-client humao 0.24.5
rust rust-lang 0.7.8
vscode-docker ms-azuretools 1.17.0
vscode-pylance ms-python 2021.11.1
vscode-todo-highlight wayou 1.0.5
xml DotJoshJohnson 2.5.1

OmniSharp log

No logs.

Steps to reproduce

  1. dotnet new console
  2. Add a breakpoint to Console.WriteLine("Hello world")
  3. Start debugging

Expected behavior

The debugger would start and stop on the breakpoint.

Actual behavior

The debugger will exit without any logs.

As instructed, I manually started vsdbg-ui and collected logs and also reinstalled c# extension.

Extension install logs (N.B.: it installs x86_64 binaries):

Installing C# dependencies...
Platform: darwin, x86_64

Downloading package 'OmniSharp for OSX' (40339 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for OSX'

Downloading package '.NET Core Debugger (macOS / x64)' (45945 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (macOS / x64)'

Downloading package 'Razor Language Server (macOS / x64)' (61258 KB).................... Done!
Installing package 'Razor Language Server (macOS / x64)'

Finished

The output of vsdbg-ui:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-gb","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"name":".NET Core Launch (console)","type":"coreclr","request":"launch","preLaunchTask":"build","program":"/Users/miha/tmp/net6/bin/Debug/net6.0/net6.dll","args":[],"cwd":"/Users/miha/tmp/net6","console":"internalConsole","stopAtEntry":true,"logging":{"engineLogging":false},"debugServer":4711,"__configurationTarget":5,"internalConsoleOptions":"openOnSessionStart","__sessionId":"c289e805-6e10-41cf-893b-5c8cd0f8531f"},"type":"request","seq":2}
<- (E) {"seq":4,"type":"event","event":"output","body":{"category":"console","output":"-------------------------------------------------------------------\nYou may only use the Microsoft .NET Core Debugger (vsdbg) with\nVisual Studio Code, Visual Studio or Visual Studio for Mac software\nto help you develop and test your applications.\n-------------------------------------------------------------------\n","severity":"ok"}}
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
<- (R) {"seq":5,"type":"response","request_seq":2,"success":true,"command":"launch"}
<- (E) {"seq":6,"type":"event","event":"initialized","body":{}}
-> (C) {"command":"setBreakpoints","arguments":{"source":{"name":"Program.cs","path":"/Users/miha/tmp/net6/Program.cs","checksums":[{"algorithm":"SHA1","checksum":"9e404d5e8b1eaba8a8a14e5bf2f7f501bcf1b6f3"},{"algorithm":"SHA256","checksum":"00cff05f5d1caeeb6a8a5e9ccafe909a85a5b80f26f355910d435b63aff65d5d"},{"algorithm":"SHA1","checksum":"df3275f19f162ae7d23e83e6a2acd764aa8a76c1"},{"algorithm":"SHA256","checksum":"9fcefc4e7071dfe06448a0a7c8e5ff53e8d2dae1edeac4410386af6df0bbb2c2"}]},"lines":[1,3],"breakpoints":[{"line":1},{"line":3}],"sourceModified":false},"type":"request","seq":3}
<- (R) {"seq":7,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":false,"message":"The breakpoint is pending and will be resolved when debugging starts.","line":1},{"id":2,"verified":false,"message":"The breakpoint is pending and will be resolved when debugging starts.","line":3}]}}
-> (C) {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
<- (R) {"seq":8,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
-> (C) {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[{"filterId":"user-unhandled"}]},"type":"request","seq":5}
<- (R) {"seq":9,"type":"response","request_seq":5,"success":true,"command":"setExceptionBreakpoints","body":{"breakpoints":[{"verified":true}]}}
-> (C) {"command":"configurationDone","type":"request","seq":6}
<- (E) {"seq":10,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/ProcessCreate","data":{"VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"21.1.0","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"Darwin","VS.Diagnostics.Debugger.vsdbg.Version":"17.0.10712.2 commit:70a83505117741ba30f92c713a4bb0d0395c3197","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Darwin"}}}
<- (E) {"seq":11,"type":"event","event":"process","body":{"name":"/Users/miha/tmp/net6/bin/Debug/net6.0/net6.dll","systemProcessId":49523,"isLocalProcess":true,"startMethod":"launch"}}
<- (E) {"seq":12,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":false,"message":"No symbols have been loaded for this document.","line":1}}}
<- (E) {"seq":13,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":2,"verified":false,"message":"No symbols have been loaded for this document.","line":3}}}
<- (E) {"seq":14,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/Launch","data":{"VS.Diagnostics.Debugger.vsdbg.Launch.Duration":1022,"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.SourceFileMappings":0,"VS.Diagnostics.Debugger.vsdbg.Distribution.Version":"21.1.0","VS.Diagnostics.Debugger.vsdbg.Distribution.Name":"Darwin","VS.Diagnostics.Debugger.vsdbg.TargetType":"Live","VS.Diagnostics.Debugger.vsdbg.OSFamily":"Darwin","VS.Diagnostics.Debugger.vsdbg.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.vsdbg.Version":"17.0.10712.2 commit:70a83505117741ba30f92c713a4bb0d0395c3197"}}}
<- (R) {"seq":15,"type":"response","request_seq":6,"success":true,"command":"configurationDone"}
-> (C) {"command":"threads","type":"request","seq":7}
<- (R) {"seq":16,"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[]}}
<- (E) {"seq":17,"type":"event","event":"output","body":{"category":"stderr","output":"Unable to attach to CoreCLR. Unknown Error: 0x80131c3c","severity":"error"}}
Unable to attach to CoreCLR. Unknown Error: 0x80131c3c
@skyflyer skyflyer changed the title Debugging does not work on Mac 12.0.1 with M1 (arm64) Debugging does not work on Mac 12.0.1 with M1 (arm64) and .NET 6 Nov 11, 2021
@gregg-miskelly
Copy link
Contributor

Are you using x64 VS Code? I believe what is going on is that the C# extension process is running in x64 node, so it thinks it is on an x64 machine.

@skyflyer
Copy link
Author

@gregg-miskelly, you're absolutely right. For posterity: I downloaded VS Code for Apple silicon and debugger now works.

Thank you!
/close

@EthanSK
Copy link

EthanSK commented Nov 15, 2021

I'm having the same issue, but my VScode is running in Apple silicon mode. The logs still say Starting OmniSharp on MacOS 12.0.1 (x64)

Trying to use azure functions
The c# extension even says its running under darwin, arm64
Even tried reinstalling everything and restarting laptop.

@gregg-miskelly
Copy link
Contributor

@EthanSK please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants