-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 IPC creation failure should not abort coreclr startup #90161
Debugger IPC creation failure should not abort coreclr startup #90161
Conversation
Tagging subscribers to this area: @tommcdon Issue DetailsOn Linux, the debugger creates 2 single-directional pipes in We found that there are two places where the runtime creates pipes/domain sockets for diagnostics:
This PR changes Debugger Port creation failure from fatal to non-fatal.
|
@@ -1939,7 +1939,8 @@ HRESULT Debugger::Startup(void) | |||
if (FAILED(hr)) | |||
{ | |||
ShutdownTransport(); | |||
ThrowHR(hr); | |||
STRESS_LOG0(LF_CORDB, LL_ERROR, "D::S: The debugger pipe failed to initialize in /tmp or $TMPDIR.\n"); | |||
return S_OK; // we do not want debugger IPC to block runtime initialization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know if we should return s_ok in those cases. Given other paths do it, maybe ok for .net 8. We should have other values to tear down the RC thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to track properly cleaning up (returning S_FALSE here and if the env var is set so the caller does the cleanup) for .NET 9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add returning S_FALSE. As Mike points out this will ensure proper cleanup:
https://github.com/tommcdon/runtime/blob/c9b4d5e7ad45de9ef4181cac45439cdc8d60033c/src/coreclr/vm/ceemain.cpp#L1833-L1843
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the change and will add the S_FALSE implementation in .NET 9
79cfeb5
to
c9b4d5e
Compare
On Linux, the debugger creates 2 single-directional pipes in
/tmp
or$TMPDIR
. Today if we fail to create these pipes, coreclr init will fail withFailed to create CoreCLR, HRESULT: 0x8007000E
as described in #86259.We found that there are two places where the runtime creates pipes/domain sockets for diagnostics:
$TMPDIR
if the env variable is set. It provides a transport for collecting memory dumps, starting an EventPipe tracing session, requesting a dump, ... It is considered non-fatal if it doesn't start.$TMPDIR
if the variable is set in Debugger::Startup. This is considered fatal if we can't create the port. This is not only related to read only file systems or non-Linux file system mounts. For example, if$TMPDIR
is set to a Windows mount in WSL2, the pipe will also fail to be created.This PR changes Debugger Port creation failure from fatal to non-fatal.