Skip to content

Fix truncated exe file name in .NET core mini dump file name#123192

Merged
barosiak merged 6 commits intodotnet:mainfrom
barosiak:issue-83419
Jan 21, 2026
Merged

Fix truncated exe file name in .NET core mini dump file name#123192
barosiak merged 6 commits intodotnet:mainfrom
barosiak:issue-83419

Conversation

@barosiak
Copy link
Member

@barosiak barosiak commented Jan 14, 2026

When creating mini dumps on Linux with the DOTNET_DbgMiniDumpName set to %e.dmp, the exe file name (%e) gets truncated to 15 characters as it's read from /proc/<pid>/status, which stores it in a 16-byte buffer.
This PR changes it, so that the executable name is read from /proc/<pid>/exe, with no length limit, and if that fails, then it fallbacks to reading from /proc/<pid>/status.

Tested locally by a local single-file test in the diagnostics repo, which will be added after these changes flow into the diagnostics repo.

Fix #83419

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 14, 2026
@barosiak barosiak added bug area-Diagnostics-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 14, 2026
@barosiak barosiak marked this pull request as ready for review January 14, 2026 20:10
Copilot AI review requested due to automatic review settings January 14, 2026 20:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the truncated executable file name issue in mini dump file names on Linux. When DOTNET_DbgMiniDumpName is set to %e.dmp, the executable name was being truncated to 15 characters because it was read from /proc/<pid>/status which uses a 16-byte buffer. The fix changes the code to first attempt reading the full executable path from /proc/<pid>/exe symlink (which has no length limit), falling back to the original /proc/<pid>/status method if that fails.

Changes:

  • Add logic to read executable name from /proc/<pid>/exe symlink before falling back to /proc/<pid>/status
  • Extract basename from the full path obtained via readlink
  • Maintain backward compatibility by keeping the original status-based method as fallback

@barosiak barosiak marked this pull request as draft January 14, 2026 20:25
@barosiak barosiak marked this pull request as ready for review January 20, 2026 19:57
Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

LGTM!

@steveisok
Copy link
Member

/ba-g Known issue #123260 closed. No need to run another round of CI

@barosiak barosiak merged commit 7529fa5 into dotnet:main Jan 21, 2026
91 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exe file name gets truncated in .NET core mini dump name

3 participants