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

[release/8.0-staging] Store entry assembly path for easy access for diagnostics #95045

Merged

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Nov 21, 2023

  • Add g_EntryAssemblyPath global variable holding the full path to the entry assembly
    • Set right before loading the entry assembly (so also before startup hooks are run) - NULL if there is no entry assembly
  • Ensure value is included dumps
    • For triage dumps, the dumped value is updated to only be the assembly file name instead of the full path

Port of #95027

Customer Impact

The entry assembly is currently not exposed in a way that is easy to access for diagnostics - for example, crash dumps. This means that for an application started via the dotnet executable (dotnet app.dll), there isn't a good way to determine the managed assembly from a dump - particularly so for a non-heap dump.

See #94474

Testing

Manual validation that dumps created contain expected information:

0:000> ||
.  0 User mini triage dump: C:\repos\helloworld\triage.dmp
0:000> x coreclr!g_EntryAssemblyPath
00007ffb`14f7dd58 coreclr!g_EntryAssemblyPath = 0x00000211`88016eb0 "helloworld.dll"

0:000> ||
.  0 User mini dump: C:\repos\helloworld\mini.dmp
0:000> x coreclr!g_EntryAssemblyPath
00007ffb`14f7dd58 coreclr!g_EntryAssemblyPath = 0x00000211`88016eb0 "C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll"

Risk

Low. This is a small change that adds a global variable and ensures it is enumerated for dumps.

- Add `g_EntryAssemblyPath` global variable holding the full path to the entry assembly
  - Set right before loading the entry assembly (so also before startup hooks are run) - NULL if there is no entry assembly
- Ensure value is included dumps
  - For triage dumps, the dumped value is updated to only be the assembly file name instead of the full path
@ghost
Copy link

ghost commented Nov 21, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Add g_EntryAssemblyPath global variable holding the full path to the entry assembly
    • Set right before loading the entry assembly (so also before startup hooks are run) - NULL if there is no entry assembly
  • Ensure value is included dumps
    • For triage dumps, the dumped value is updated to only be the assembly file name instead of the full path

Port of #95027

Customer Impact

The entry assembly is currently not exposed in a way that is easy to access for diagnostics - for example, crash dumps. This means that for an application started via the dotnet executable (dotnet app.dll), there isn't a good way to determine the managed assembly from a dump - particularly so for a non-heap dump.

Testing

Manual validation that dumps created contain expected information:

0:000> ||
.  0 User mini triage dump: C:\repos\helloworld\triage.dmp
0:000> x coreclr!g_EntryAssemblyPath
00007ffb`14f7dd58 coreclr!g_EntryAssemblyPath = 0x00000211`88016eb0 "helloworld.dll"

0:000> ||
.  0 User mini dump: C:\repos\helloworld\mini.dmp
0:000> x coreclr!g_EntryAssemblyPath
00007ffb`14f7dd58 coreclr!g_EntryAssemblyPath = 0x00000211`88016eb0 "C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll"

Risk

Low. This is a small change that adds a global variable and ensures it is enumerated for dumps.

Author: elinor-fung
Assignees: elinor-fung
Labels:

area-AssemblyLoader-coreclr

Milestone: -

@elinor-fung elinor-fung added the Servicing-consider Issue for next servicing release review label Nov 21, 2023
@elinor-fung elinor-fung added this to the 8.0.x milestone Nov 21, 2023
@elinor-fung
Copy link
Member Author

/backport to release/7.0-staging

Copy link
Contributor

Started backporting to release/7.0-staging: https://github.com/dotnet/runtime/actions/runs/6938037825

@elinor-fung
Copy link
Member Author

/backport to release/6.0-staging

Copy link
Contributor

Started backporting to release/6.0-staging: https://github.com/dotnet/runtime/actions/runs/6938052768

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. we will take for consideration in 8.0.x

@ghost
Copy link

ghost commented Nov 21, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Add g_EntryAssemblyPath global variable holding the full path to the entry assembly
    • Set right before loading the entry assembly (so also before startup hooks are run) - NULL if there is no entry assembly
  • Ensure value is included dumps
    • For triage dumps, the dumped value is updated to only be the assembly file name instead of the full path

Port of #95027

Customer Impact

The entry assembly is currently not exposed in a way that is easy to access for diagnostics - for example, crash dumps. This means that for an application started via the dotnet executable (dotnet app.dll), there isn't a good way to determine the managed assembly from a dump - particularly so for a non-heap dump.

See #94474

Testing

Manual validation that dumps created contain expected information:

0:000> ||
.  0 User mini triage dump: C:\repos\helloworld\triage.dmp
0:000> x coreclr!g_EntryAssemblyPath
00007ffb`14f7dd58 coreclr!g_EntryAssemblyPath = 0x00000211`88016eb0 "helloworld.dll"

0:000> ||
.  0 User mini dump: C:\repos\helloworld\mini.dmp
0:000> x coreclr!g_EntryAssemblyPath
00007ffb`14f7dd58 coreclr!g_EntryAssemblyPath = 0x00000211`88016eb0 "C:\repos\helloworld\bin\Debug\net8.0\helloworld.dll"

Risk

Low. This is a small change that adds a global variable and ensures it is enumerated for dumps.

Author: elinor-fung
Assignees: elinor-fung
Labels:

Servicing-consider, area-Host

Milestone: 8.0.x

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 21, 2023
@leecow leecow modified the milestones: 8.0.x, 8.0.2, 8.0.1 Nov 21, 2023
@jeffschwMSFT jeffschwMSFT merged commit b126b9a into dotnet:release/8.0-staging Nov 21, 2023
111 of 121 checks passed
@elinor-fung elinor-fung deleted the storeEntryAssemblyPath-8 branch November 22, 2023 22:12
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants