Omnisharp-vscode: Debug adapter process has terminated unexpectedly on Linux kernel >= 4.6

Created on 25 Oct 2016  路  12Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64

VS Code version:
Version 1.6.1

C# Extension version:
Version: 1.5.0-beta4

Steps to reproduce

When creating a new project and try to debug, after a few seconds the following error is triggered by VS Code: 'Debug adapter process has terminated unexpectedly' and the application is closed.

Expected behavior

It is expected able to view and analyze the variables

Actual behavior

The application was terminated immediately

Debugger Resolved-Fixed

All 12 comments

@luyzfernando we are going to need a more information to try and track this down. My first hope is that we are sending some telemetry to tell us what went wrong. Can you try enabling logging and see if you get anything interesting?

Follows two strange things:

1 - Debug pause a line earlier than expected
image

2 - Warning when debugging is stopped
image

Note: The images are of different projects

I hope this helps.
If you need me to do anything else, please let me know.
Thank you.

@luyzfernando that warning is weird, and I am not sure what is causing it, but I don't think it is connected with the problem. Second idea - lets see if we can get a coredump of the issue:

  1. Open a command prompt
  2. cd ~/.vscode/extensions/ms-vscode.csharp-1.4.1/coreclr-debug/debugAdapters
  3. ulimit -c unlimited
  4. ./OpenDebugAD7 --server=4711
  5. Go back to VS Code and open launch.json
  6. At the top of the file, add a 'debugServer' value like below and save the file
  7. Start debugging as normal
  8. See if you get either a stack trace written to the console, or a coredump created. If you have a coredump, see if GDB or LLDB can give you a stack trace
{
    "debugServer": 4711,
    "version": "0.2.0",
    "configurations": [
        {
...
}

I do not know if it helps, but the only thing that appeared was this error:

image

Image of VS Code:
image

some more error logs

E output: {"category":"console","output":"The program '/_path_/Servi莽o/Company.CoO.Revolution/Company.CoO.Service.TransportLoad/bin/Debug/netcoreapp1.0/Company.CoO.Service.TransportLoad.dll' has exited with code -1 (0xffffffff).\r\n\n","data":null,"type":"output"}
The program '/_path_/Servi莽o/Company.CoO.Revolution/Company.CoO.Service.TransportLoad/bin/Debug/netcoreapp1.0/Company.CoO.Service.TransportLoad.dll' has exited with code -1 (0xffffffff).
E exited: {"exitCode":-1,"type":"exited"}
E terminated: {"type":"terminated"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.30822.1","VS.Diagnostics.Debugger.HostVersion":"1.0.20822.1","VS.Diagnostics.Debugger.AdapterId":"coreclr","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":1},"type":"output"}
R: {"success":false,"message":"Unable to evaluate expression. The debug engine threw an exception.","request_seq":16,"command":"evaluate","body":{"error":{"id":1104,"format":"Unable to evaluate expression. The debug engine threw an exception.","variables":null}},"running":false,"refs":null,"seq":0,"type":"response"}
C evaluate: {"expression":"fields","frameId":1000,"context":"hover"}
R: {"success":false,"message":"Unable to evaluate expression. The debug engine threw an exception.","request_seq":17,"command":"evaluate","body":{"error":{"id":1104,"format":"Unable to evaluate expression. The debug engine threw an exception.","variables":null}},"running":false,"refs":null,"seq":0,"type":"response"}
C next: {"threadId":25888}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/NonFatalError","data":{"VS.Diagnostics.Debugger.NonFatalError.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.NonFatalError.ExceptionType":"System.NullReferenceException","VS.Diagnostics.Debugger.NonFatalError.ExceptionStack":" at Microsoft.MIDebugEngine.AD7Engine.Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)\n at OpenDebugAD7.AD7DebugSession.StepInternal(Int32 threadId, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit, String errorMessage)\n at OpenDebug.DebugSession.Dispatch(String command, Object args)\n at OpenDebug.Program.<>c__DisplayClass6_0.b__2(String command, Object args, IResponder responder)","VS.Diagnostics.Debugger.NonFatalError.HResult":-2147467261,"VS.Diagnostics.Debugger.EngineVersion":"14.0.30822.1","VS.Diagnostics.Debugger.AdapterId":"coreclr","VS.Diagnostics.Debugger.HostVersion":"1.0.20822.1"},"type":"output"}
EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.MIDebugEngine.AD7Engine.Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)
at OpenDebugAD7.AD7DebugSession.StepInternal(Int32 threadId, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit, String errorMessage)
at OpenDebug.DebugSession.Dispatch(String command, Object args)
at OpenDebug.Program.<>c__DisplayClass6_0.b__2(String command, Object args, IResponder responder)
R: {"success":false,"message":"error while processing request 'next' (exception: Internal error in OpenDebugAD7. Exception of type 'System.NullReferenceException' was thrown.\r\n\r\n at Microsoft.MIDebugEngine.AD7Engine.Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)\n at OpenDebugAD7.AD7DebugSession.StepInternal(Int32 threadId, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit, String errorMessage)\n at OpenDebug.DebugSession.Dispatch(String command, Object args)\n at OpenDebug.Program.<>c__DisplayClass6_0.b__2(String command, Object args, IResponder responder))","request_seq":18,"command":"next","body":{"error":{"id":1104,"format":"error while processing request '{_request}' (exception: {_exception})","variables":{"_request":"next","_exception":"Internal error in OpenDebugAD7. Exception of type 'System.NullReferenceException' was thrown.\r\n\r\n at Microsoft.MIDebugEngine.AD7Engine.Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)\n at OpenDebugAD7.AD7DebugSession.StepInternal(Int32 threadId, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit, String errorMessage)\n at OpenDebug.DebugSession.Dispatch(String command, Object args)\n at OpenDebug.Program.<>c__DisplayClass6_0.b__2(String command, Object args, IResponder responder)"}}},"running":false,"refs":null,"seq":0,"type":"response"}
C disconnect: {"restart":false}
R: {"success":true,"message":null,"request_seq":19,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}

I think I found the problem, at least in my case.

The problem is in the kernel version.

I was using Ubuntu 16.04 LTS with Kernel 4.6.0-040600rc7 and the error occurred.
I upgraded to Kernel 4.8.6 and the error persisted.

I returned to the "original" version 4.4.0.45.66 and the problem was solved.

I hope this helps you.

Thank you for your support.

=)

@luyzfernando Thanks for investigating! I think the issue is that we haven't moved our CoreCLR to 1.0.1, and coreclr crashing on >= 4.6 kernels (see dotnet/coreclr#7345). Though we have our own issues as well. I will update the title.

Do you have any plans when to do this update?

We are actively working on it now. So I would expect sometime in the next few weeks.

@luyzfernando I've created a v1.6-beta3 release of the C# extension that should address this. See this page for information on installing beta releases.

@gregg-miskelly I can debug again! (Fedora24) Thanks! 馃榿

@seijikun excellent!

Was this page helpful?
0 / 5 - 0 ratings