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

CLRDBG exited unexpectedly with exit code 137 (0x89) #755

Open
mayconbeserra opened this issue Sep 11, 2016 · 11 comments
Open

CLRDBG exited unexpectedly with exit code 137 (0x89) #755

mayconbeserra opened this issue Sep 11, 2016 · 11 comments

Comments

@mayconbeserra
Copy link

Hi there, it's happening something weird while debugging my app with vscode and .net core inside a docker container.
After 30sec - 1 minutes, the clrdbg terminates my debugging.

I have tried 2 different approaches:

  1. Just start the debugging and wait for the exception. The result is the same (exited unexpectedly with exit code 137)
  2. Start the debugging and make some calls for my rest api. The result is the same after some time. Just for making sure, my initial requests are received.

Note: The controller is receiving the initial calls correctly, but the debugging is terminated without reason. Or it isn't clear for me at the moment.

Environment data

dotnet --info output:
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64

VS Code version: 1.5.1
C# Extension version: 1.4.1

Docker Version:

Docker version 1.12.0, build 8eab29e

Steps to reproduce

  1. put a breakpoint inside my controller
  2. Start debugging

Expected behavior

CLRDBG doesn't exit

Actual behavior

ERROR: CLRDBG exited unexpectedly with exit code 137 (0x89). Debugging will now abort.

Logs

E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/MIEngine/DebuggerAborted","data":{"VS.Diagnostics.Debugger.MIEngine.DebuggerName":"CLRDBG","VS.Diagnostics.Debugger.MIEngine.LastSentCommandName":"-exec-continue","VS.Diagnostics.Debugger.MIEngine.DebuggerExitCode":"137 (0x89)","VS.Diagnostics.Debugger.clrdbg.Version":"14.0.25520.0 built by: CLRDBG","VS.Diagnostics.Debugger.clrdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.clrdbg.KernelRelease":"4.4.15-moby","VS.Diagnostics.Debugger.clrdbg.LinuxDistroVersion":"Linux version 4.4.15-moby (root@ca9015dc6bb1) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #1 SMP Thu Jul 28 22:03:07 UTC 2016"},"type":"output"}
E output: {"category":"stderr","output":"ERROR: CLRDBG exited unexpectedly with exit code 137 (0x89). Debugging will now abort.\n","data":null,"type":"output"}
ERROR: CLRDBG exited unexpectedly with exit code 137 (0x89). Debugging will now abort.
E output: {"category":"console","output":"The program '/app/server/host/bin/Debug/netcoreapp1.0/publish/host.dll' has exited with code -1 (0xffffffff).\r\n\n","data":null,"type":"output"}
The program '/app/server/host/bin/Debug/netcoreapp1.0/publish/host.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"}
C disconnect: {"restart":false}
R: {"success":true,"message":null,"request_seq":23,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}

@mayconbeserra mayconbeserra changed the title Can't debug for more than 30 seconds in a docker container CLRDBG exited unexpectedly with exit code 137 (0x89) Sep 11, 2016
@gregg-miskelly
Copy link
Contributor

So if I understand Linux exit codes correctly, 137 is 128+9, where 9 is the signal number for SIGKILL. Not quite sure what would be killing clrdbg.

@mayconbeserra just to make sure I understand, if you debug the app locally (not in the container) you do NOT see the problem, correct?

@mayconbeserra
Copy link
Author

mayconbeserra commented Sep 12, 2016

Hi @gregg-miskelly, no, I don't because I can debug finely.

Another detail which I forgot to mention is - The clrdbg terminates the process but the container still works fine and accept the requests.

@mayconbeserra
Copy link
Author

@gregg-miskelly , just adding more details for the log stating the api is accepting the requests.

========LOG =====================
1: (70928) ->~"Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 30426.0495ms 200 application/json; charset=utf-8\n"
E output: {"category":"stdout","output":"Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 30426.0495ms 200 application/json; charset=utf-8\n","data":null,"type":"output"}
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 30426.0495ms 200 application/json; charset=utf-8
1: (99967) ->=thread-exited,id="96"
1: (100976) ->=thread-exited,id="106"
1: (101986) ->=thread-exited,id="100"
1: (102996) ->=thread-exited,id="98"
1: (136328) "/bin/bash" exited with code 137 (0x89).
1: (136332) <-logout
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/MIEngine/DebuggerAborted","data":{"VS.Diagnostics.Debugger.MIEngine.DebuggerName":"CLRDBG","VS.Diagnostics.Debugger.MIEngine.LastSentCommandName":"-exec-continue","VS.Diagnostics.Debugger.MIEngine.DebuggerExitCode":"137 (0x89)","VS.Diagnostics.Debugger.clrdbg.Version":"14.0.25520.0 built by: CLRDBG","VS.Diagnostics.Debugger.clrdbg.OSFamily":"Linux","VS.Diagnostics.Debugger.clrdbg.KernelRelease":"4.4.15-moby","VS.Diagnostics.Debugger.clrdbg.LinuxDistroVersion":"Linux version 4.4.15-moby (root@ca9015dc6bb1) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #1 SMP Thu Jul 28 22:03:07 UTC 2016"},"type":"output"}
E output: {"category":"stderr","output":"ERROR: CLRDBG exited unexpectedly with exit code 137 (0x89). Debugging will now abort.\n","data":null,"type":"output"}
ERROR: CLRDBG exited unexpectedly with exit code 137 (0x89). Debugging will now abort.
E output: {"category":"console","output":"The program '/app/server/host/bin/Debug/netcoreapp1.0/publish/host.dll' has exited with code -1 (0xffffffff).\r\n\n","data":null,"type":"output"}
The program '/app/server/host/bin/Debug/netcoreapp1.0/publish/host.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":5},"type":"output"}
C disconnect: {"restart":false}
R: {"success":true,"message":null,"request_seq":43,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}

@gregg-miskelly
Copy link
Contributor

@mayconbeserra are you following the instructions on https://github.com/Microsoft/generator-docker#generator-docker to setup your container and modify your launch.json to support Docker?

@mayconbeserra
Copy link
Author

@gregg-miskelly , yes, I am.

this is my launch.json:

{ "version": "0.2.0", "configurations": [ { "name": ".NET Core Launch (web)", "type": "coreclr", "request": "launch", "preLaunchTask": "composeForDebug", "program": "/app/server/host/bin/Debug/netcoreapp1.0/publish/host.dll", "args": [], "cwd": "/app", "launchBrowser": { "enabled": false, "args": "${auto-detect-url}", "windows": { "command": "cmd.exe", "args": "/C start ${auto-detect-url}" }, "osx": { "command": "open" }, "linux": { "command": "xdg-open" } }, "logging": { "exceptions": true, "trace": true, "engineLogging": true, "traceResponse": true, "programOutput": true, "moduleLoad": true }, "pipeTransport": { "pipeProgram": "/bin/bash", "pipeCwd": "${workspaceRoot}", "pipeArgs": [ "-c", "./dockerTask.sh startDebugging" ], "windows": { "pipeProgram": "${env.windir}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "pipeCwd": "${workspaceRoot}", "pipeArgs": [ ".\\dockerTask.ps1", "-StartDebugging" ] } } } ] }

@gregg-miskelly
Copy link
Contributor

@mayconbeserra we have tried to reproduce this on our end but unfortunately we haven't had any success.

Can you reproduce this problem with a 'hello world' project? Or only with your own real-world project?

My guess is that we are going to need to find a way to get gdb to attach to clrdbg in the container to try and understand what is raising the signal. Do you have much experience with GDB? (I am asking so we know how detailed our troubleshooting steps need to be)

@mayconbeserra
Copy link
Author

@gregg-miskelly only with a real-world project, and no, I don't have experience with GDB, but I'm happy to follow the instructions and understand more.

@mayconbeserra
Copy link
Author

Hi @gregg-miskelly , any news about it?

@gregg-miskelly
Copy link
Contributor

@mayconbeserra sorry, I haven't had time to come up with a set of instructions for trying to troubleshoot this issue. I am pretty heads down on other things for the next week, but I hope to get back to this after that.

@mayconbeserra
Copy link
Author

Hi @gregg-miskelly , is there any book or source available about clrdbg? I'm using mac and sometimes windows, as far as I know the debugging process for both platform are different

@gregg-miskelly
Copy link
Contributor

@mayconbeserra clrdbg itself is a closed source project, though it does use some open source components (.NET Core, parts of Roslyn).

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

No branches or pull requests

3 participants