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

DOTNET_ vs COMPlus_ env var prefix for creating dumps #58924

Closed
ManickaP opened this issue Sep 10, 2021 · 5 comments · Fixed by #59513
Closed

DOTNET_ vs COMPlus_ env var prefix for creating dumps #58924

ManickaP opened this issue Sep 10, 2021 · 5 comments · Fixed by #59513
Assignees
Milestone

Comments

@ManickaP
Copy link
Member

Based on this docs: https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dumps the environment variable DOTNET_DbgEnableMiniDump should work the same way as COMPlus_DbgEnableMiniDump.
However, the former (DOTNET_...) didn't work for me and the latter (COMPlus_) did. Is the documentation wrong or is this a bug/missing feature?

Running in mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim docker image:

.NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.1.21457.2
 Commit:    1aefb20570

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.100-rc.1.21457.2/

Host (useful for support):
  Version: 6.0.0-rc.1.21451.13
  Commit:  d7619cd4b1

.NET SDKs installed:
  6.0.100-rc.1.21457.2 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Sep 10, 2021
@ghost
Copy link

ghost commented Sep 10, 2021

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Based on this docs: https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dumps the environment variable DOTNET_DbgEnableMiniDump should work the same way as COMPlus_DbgEnableMiniDump.
However, the former (DOTNET_...) didn't work for me and the latter (COMPlus_) did. Is the documentation wrong or is this a bug/missing feature?

Running in mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim docker image:

.NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.1.21457.2
 Commit:    1aefb20570

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.100-rc.1.21457.2/

Host (useful for support):
  Version: 6.0.0-rc.1.21451.13
  Commit:  d7619cd4b1

.NET SDKs installed:
  6.0.100-rc.1.21457.2 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Author: ManickaP
Assignees: -
Labels:

area-Diagnostics-coreclr, untriaged

Milestone: -

@hoyosjs
Copy link
Member

hoyosjs commented Sep 10, 2021

This should've started working with #50507, not sure why it didn't. Regardless we should amend the public docs to at least state this is only a 6.0+ feature.

@hoyosjs
Copy link
Member

hoyosjs commented Sep 10, 2021

Turns our this is handled in the procabort handler which is in the PAL. Such layer doesn't have the CLR's config facility, so we do a hard manual check:

PROCAbortInitialize()
{
char* enabled = getenv("COMPlus_DbgEnableMiniDump");
if (enabled != nullptr && _stricmp(enabled, "1") == 0)
{
char* dumpName = getenv("COMPlus_DbgMiniDumpName");
char* dumpType = getenv("COMPlus_DbgMiniDumpType");
char* diagStr = getenv("COMPlus_CreateDumpDiagnostics");
BOOL diag = diagStr != nullptr && strcmp(diagStr, "1") == 0;
char* crashReportStr = getenv("COMPlus_EnableCrashReport");
BOOL crashReport = crashReportStr != nullptr && strcmp(crashReportStr, "1") == 0;
char* program = nullptr;
char* pidarg = nullptr;
if (!PROCBuildCreateDumpCommandLine(g_argvCreateDump, &program, &pidarg, dumpName, dumpType, diag, crashReport))
{
return FALSE;
}
}
return TRUE;

Affected variables:

  • COMPlus_EnableAlternateStackCheck
  • COMPlus_EnableAssertDialog
  • COMPlus_DefaultStackSize
  • COMPlus_UseDefaultBaseAddr
  • COMPlus_CodeHeapReserveForJumpStubs (
  • COMPlus_LTTng
  • COMPlus_DbgEnableMiniDump
  • COMPlus_DbgMiniDumpName
  • COMPlus_DbgMiniDumpType
  • COMPlus_CreateDumpDiagnostics
  • COMPlus_EnableCrashReport

cc: @AaronRobinsonMSFT

@hoyosjs hoyosjs removed the untriaged New issue has not been triaged by the area owner label Sep 10, 2021
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.0 milestone Sep 10, 2021
@AaronRobinsonMSFT
Copy link
Member

Regardless we should amend the public docs to at least state this is only a 6.0+ feature.

That is documented. Unfortunately it seems some of the official variables do their own thing – this is unfortunate. This isn't a .NET 6 issue really so we can move this to .NET 7 for now.

@AaronRobinsonMSFT AaronRobinsonMSFT self-assigned this Sep 10, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 23, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 24, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants