-
Notifications
You must be signed in to change notification settings - Fork 675
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
Debugger silently fails to connect to target process on Arch #3775
Comments
I realize this is similar to issue #3773. There are differences:
Also did try this: https://github.com/OmniSharp/omnisharp-vscode/wiki/Enabling-C%23-debugger-logging#full-method Here's the output: <- (R) {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","message":"","body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"exceptionBreakpointFilters":[{"filter":"all","label":"All Exceptions","default":false},{"filter":"user-unhandled","label":"User-Unhandled Exceptions","default":true}],"supportsSetVariable":true,"supportsGotoTargetsRequest":true,"supportsModulesRequest":true,"additionalModuleColumns":[],"supportedChecksumAlgorithms":["MD5","SHA1","SHA256"],"supportsExceptionOptions":true,"supportsValueFormattingOptions":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":true,"supportsSetExpression":true,"supportsReadMemoryRequest":true,"supportsExceptionConditions":true,"supportsLoadSymbolsRequest":true,"supportsModuleSymbolSearchLog":true,"supportsDebuggerProperties":true,"supportsSetSymbolOptions":true}} -> (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-us","supportsProgressReporting":true},"type":"request","seq":1} <- (R) {"seq":4,"type":"response","request_seq":1,"success":true,"command":"initialize","message":"","body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"exceptionBreakpointFilters":[{"filter":"all","label":"All Exceptions","default":false},{"filter":"user-unhandled","label":"User-Unhandled Exceptions","default":true}],"supportsSetVariable":true,"supportsGotoTargetsRequest":true,"supportsModulesRequest":true,"additionalModuleColumns":[],"supportedChecksumAlgorithms":["MD5","SHA1","SHA256"],"supportsExceptionOptions":true,"supportsValueFormattingOptions":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":true,"supportsSetExpression":true,"supportsReadMemoryRequest":true,"supportsExceptionConditions":true,"supportsLoadSymbolsRequest":true,"supportsModuleSymbolSearchLog":true,"supportsDebuggerProperties":true,"supportsSetSymbolOptions":true}} -> (C) {"command":"launch","arguments":{"name":".NET Core Launch (web)","type":"coreclr","request":"launch","preLaunchTask":"build","program":"/[path]/[to]/[project]/demo/bin/Debug/netcoreapp3.1/demo.dll","args":[],"cwd":"/[path]/[to]/[project]/demo","stopAtEntry":false,"serverReadyAction":{"action":"openExternally","pattern":"^\s*Now listening on:\s+(https?://\S+)"},"env":{"ASPNETCORE_ENVIRONMENT":"Development","ASPNETCORE_URLS":"https://localhost:5001;http://localhost:5000"},"sourceFileMap":{"/Views":"/[path]/[to]/[project]/demo/Views"},"logging":{"engineLogging":false},"debugServer":4711,"noDebug":true,"internalConsoleOptions":"openOnSessionStart","__sessionId":"178c63ed-f3f3-49df-b5ee-1f1f92221172"},"type":"request","seq":2} -> (C) {"seq":7,"type":"request","command":"handshake","arguments":{"value":"1wnOLCxVzYltSow7yPp8gXLiSMgWFPQDZ83+w2PqBn0="}} You may only use the Microsoft .NET Core Debugger (vsdbg) with
|
The |
@bDarbonne Is that the end of your debug log? It is strangely truncated, maybe because vsdbg-ui crashed? You might get more info using the 'full method'. |
Hi All, I have the same issue. Here is my debug log using the "full method" described here: [https://github.com/OmniSharp/omnisharp-vscode/wiki/Enabling-C%23-debugger-logging#full-method]. Is there any workaround for this? Waiting for communication on port 4711...
|
@paulsebeikin: your issue is actually different. Your problem is that you installed the OSS version of Visual Studio Code, but the debugger is only licensed to work in official Microsoft products. Unfortunately due to both a bug in the debugger, and a bug in VS Code, that error message doesn't come up. You can fix the issue by installing the official version of VS Code from Microsoft. More info: https://github.com/OmniSharp/omnisharp-vscode/wiki/Microsoft-.NET-Core-Debugger-licensing-and-Microsoft-Visual-Studio-Code |
@gregg-miskelly Yes. That's the end of the debug log. The output was actually from Here is the output from Waiting for communication on port 4711...
Is this what you were referring to as the 'full method'? |
Thanks. That makes way more sense. What I believe is going on is that inter process communications between the .NET Debugging services (which run in the debugger process) and the .NET Runtime (which runs in your app) is silently failing. So the result is that the debugger is never told that the .NET Runtime loaded, and nothing will work. Unfortunately, since the failure is silent, there is nothing in the log to explain what is going on. One thing you could try -- try attaching to an already running process, and see if we get an error that way. You will probably need to check the logs as VS Code has a bug (that was just fixed in Insiders) where they weren't displaying errors from the |
Ok. I ran the project and attached to the process to begin debugging. Nothing seemed to stand out. Here's what I have: |
Interesting. So in case it isn't obvious what happened there: everything worked just fine when you attached. This means either:
To try and differentiate the two, if you look at a trace when you do the launch, you will see a {"seq":8,"type":"event","event":"process","body":{"name":"/[path]/[to]/[project]/demo/bin/Debug/netcoreapp3.1/demo.dll","systemProcessId":4951,"isLocalProcess":true,"startMethod":null}} Does the process id reported from that event match the process where your code is loaded? |
The process id does match. |
Hmm... unfortunately the .NET Runtime code isn't the easiest to troubleshoot. If you feel up for it, I can tell you what repo to build, |
Sure! |
Okay, so here is the interesting code that gets loaded into the debugger's process: libdbgshim.so!PAL_RuntimeStartupHelper::Register If you want to debug into this, you should be able to by:
And then copy the libdbgshim.so that you built into the C# extension's debugger directory. Now you can launch vsdbg-ui under a native debugger (ex: use the VS Code C++ extension, or GDB by hand) in server mode (the same thing you did for logging) and be able to debug things. After the target process starts, it should attempt to open that semaphore and signal it. Debugging that code is a bit harder. But if you want to read it look at PAL_NotifyRuntimeStarted. That code will be in libcoreclr.so. |
thanks @gregg-miskelly your advice resolved my issue. |
Thank you @gregg-miskelly! Funny thing happened. I followed your instructions. Ran the project with |
Issue Description
Breakpoints do not work when running either a console or web application...most of the time.
On occasion, it will randomly begin running correctly. Even when stopping and immediately starting the project again.
Steps to Reproduce
or
Expected Behavior
Program to stop execution on breakpoints selected
Actual Behavior
console -> Program runs to end of execution (this was a new console project)
mvc -> Breakpoint is grayed out and never hit
// hovering over the grayed out breakpoint gives the message: 'The breakpoint is pending and will be resolved when debugging starts.'
Logs
NOTE: These logs were from running a new mvc project
OmniSharp log
Starting OmniSharp server at 5/11/2020, 8:34:56 AM
Target: /[path]/[to]/[project]/demo
OmniSharp server started with Mono 6.4.0.
Path: /home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/OmniSharp.exe
PID: 4375
Starting OmniSharp on arch 0.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[warn]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
It looks like you have Mono 6.4.0 or greater installed but MSBuild could not be found.
Try installing MSBuild into Mono (e.g. 'sudo apt-get install msbuild') to enable better MSBuild support, or upgrade to latest Mono: https://www.mono-project.com/download/stable/.
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.4 - "/home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.4 - "/home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/[user]/.vscode/extensions/ms-dotnettools.csharp-1.21.18/.omnisharp/1.35.1/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/[path]/[to]/[project]/demo'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/[path]/[to]/[project]/demo'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/[path]/[to]/[project]/demo/demo.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/[path]/[to]/[project]/demo'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.MSBuild.ProjectManager
Loading project: /[path]/[to]/[project]/demo/demo.csproj
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/[path]/[to]/[project]/demo' on host 4176.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/[path]/[to]/[project]/demo/demo.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/[path]/[to]/[project]/demo/demo.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: demo
C# log
Environment information
VSCode version: 1.45.0
C# Extension: 1.21.18
Mono Information
OmniSharp using global mono :6.4.0Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.103 Commit: 6f74c4a1ddRuntime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/3.1.103/
Host (useful for support):
Version: 3.1.3
Commit: ed88943d24
.NET Core SDKs installed:
3.1.103 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: