Skip to content

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

@MichaelMaio

Description

@MichaelMaio

We’re collecting mini dumps for our .NET Core app as described here: Collect Dumps on Crash - .NET | Microsoft Learn. We’re setting DOTNET_DbgMiniDumpName to <some_folder>%e.%d.dmp.

On Windows, everything works fine. For example, when I crash an app named DotNetCoreConsoleApp.exe, I get a dump named DotNetCoreConsoleApp.exe..dmp.

On Linux, however, the exe file name (the %e) is getting truncated to 15 characters. For example, I get a dump named DotNetCoreConso..dmp.

I've pasted a discussion this below with more information:

From: Juan Sebastian Hoyos Ayala [email protected]
Sent: Tuesday, March 14, 2023 11:52 AM
To: Michael Maio [email protected]; Mike McLaughlin [email protected]; Lee Culver [email protected]
Subject: RE: exe file name gets truncated in .NET core mini dump name

Or rather, on the systems that truncate it, it’s 16 chars. There’s other nodes in procfs too, but they lie easily about the proc name.

From: Juan Sebastian Hoyos Ayala
Sent: Tuesday, March 14, 2023 11:51 AM
To: Michael Maio <[email protected]>; Mike McLaughlin <[email protected]>; Lee Culver <[email protected]>
Subject: RE: exe file name gets truncated in .NET core mini dump name

Sure, feel free to. It’s always truncated to 15 chars (the buffer they use internally is 16 chars).

From: Michael Maio <[email protected]>
Sent: Tuesday, March 14, 2023 11:42 AM
To: Juan Sebastian Hoyos Ayala <[email protected]>; Mike McLaughlin <[email protected]>; Lee Culver <[email protected]>
Subject: RE: exe file name gets truncated in .NET core mini dump name

Should I log a bug on this? If so, where?

For now I guess we can work around it by truncating the name of the process when we look for its dump.

Thanks,

michma

From: Juan Sebastian Hoyos Ayala <[email protected]>
Sent: Tuesday, March 14, 2023 10:19 AM
To: Mike McLaughlin <[email protected]>; Lee Culver <[email protected]>; Michael Maio <[email protected]>
Subject: Re: exe file name gets truncated in .NET core mini dump name

Given this has to be out of process, we should try to check for /proc/pod/exe. There's getauxval(AT_EXECFN), but likely can only be called in proc. There's also an aux file in proc with a pointer to the string, but that requires a remote read of a string. I feel the exe with fallback to status might be a better idea.

Juan


From: Mike McLaughlin <[email protected]>
Sent: Tuesday, March 14, 2023 9:42:15 AM
To: Lee Culver <[email protected]>; Michael Maio <[email protected]>
Cc: Juan Sebastian Hoyos Ayala <[email protected]>
Subject: RE: exe file name gets truncated in .NET core mini dump name

Createdump gets the app name for %e on Linux from the /proc//status file. It parses the “Name: “ field. The name isn’t truncated by createdump so the limitation is status file’s Name field. If there is a better way to get the program name, we can change createdump to do that.

mikem

From: Lee Culver <[email protected]>
Sent: Monday, March 13, 2023 9:25 PM
To: Michael Maio <[email protected]>; Mike McLaughlin <[email protected]>
Subject: RE: exe file name gets truncated in .NET core mini dump name

Mike was OOF today, I’m sure he’ll respond when he’s back this week.

-Lee

From: Michael Maio <[email protected]>
Sent: Monday, March 13, 2023 8:34 PM
To: Lee Culver <[email protected]>; Mike McLaughlin <[email protected]>
Subject: RE: exe file name gets truncated in .NET core mini dump name

@Mike McLaughlin, do you know if this is a known issue in .NET core dump generation?

Thanks,

michma

From: Lee Culver <[email protected]>
Sent: Saturday, March 11, 2023 9:28 AM
To: Michael Maio <[email protected]>; NET Core Discussion <[email protected]>; Mike McLaughlin <[email protected]>
Subject: RE: exe file name gets truncated in .NET core mini dump name

@Mike McLaughlin would be the expert here.

Thanks,
-Lee Culver
CLR Technical Insights

From: Michael Maio <[email protected]>
Sent: Friday, March 10, 2023 9:01 PM
To: NET Core Discussion <[email protected]>
Subject: exe file name gets truncated in .NET core mini dump name

We’re collecting mini dumps for our .NET Core app as described here: Collect Dumps on Crash - .NET | Microsoft Learn. We’re setting DOTNET_DbgMiniDumpName to <some_folder>%e.%d.dmp.

On Windows, everything works fine. For example, when I crash an app named DotNetCoreConsoleApp.exe, I get a dump named DotNetCoreConsoleApp.exe..dmp.

On Linux, however, the exe file name (the %e) is getting truncated to 15 characters. For example, I get a dump named DotNetCoreConso..dmp.

Is this a known bug? Any work-arounds? We’re using .NET Core 7. I haven’t checked if it also repros on Mac yet.

Thanks,

michma

Metadata

Metadata

Assignees

Labels

area-Diagnostics-coreclrbugin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions