Skip to content

DOTNET_ vs COMPlus_ env var prefix for creating dumps #58924

Closed

Description

@ManickaP

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]

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Sep 10, 2021
  2. hoyosjs commented on Sep 10, 2021

    @hoyosjs
    Member

    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.

  3. hoyosjs commented on Sep 10, 2021

    @hoyosjs
    Member

    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

  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Sep 10, 2021
  5. added this to the 7.0.0 milestone on Sep 10, 2021
  6. AaronRobinsonMSFT commented on Sep 10, 2021

    @AaronRobinsonMSFT
    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.

  7. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 23, 2021
  8. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 24, 2021
  9. ghost locked as resolved and limited conversation to collaborators on Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions