[.NET 9] Potential (~9% chance) AccessViolationException in ReadyToRun executable targeting RID osx-arm64 when running a child process for the first time, and both standard output and standard error are redirected #112167
Labels
area-ReadyToRun-coreclr
tenet-reliability
Reliability/stability related issue (stress, load problems, etc.)
untriaged
New issue has not been triaged by the area owner
Description
#88288 is still an issue in .NET 9, but I can not re-open that issue as it is now locked. The only difference between .NET 8 and .NET 9 is that the crash call stack is now different.
Redirecting standard output and standard error of child processes for a ReadyToRun executable on macOS M1 can result in:
Some important notes about this bug:
PublishReadyToRun
. If ReadyToRun is turned off, this crash won't happen./usr/bin/git init <path>
,/usr/bin/git --version
, and/bin/bash -c true
I managed to reproduce this issue on the following system:
I could also reproduce it on a second system with identical OS version and hardware configuration (building the binary again, rather than copying the built binary), so it is not specific to a single machine or environment.
Reproduction Steps
Create
Program.cs
with this content:Create the
procrepo.csproj
project with this content:Build the project with:
Run the process in a loop with to reproduce the crash:
Reproduction rate
When I ran the program with this Bash command:
the results were that this crash happens 9% of the time.
Expected behavior
The .NET process should not crash with AccessViolationException.
Actual behavior
A crash with a callstack that looks similar to one of the following. It's not consistent, and I have seen callstacks that differ from the ones below, but these are the most common:
Regression?
No response
Known Workarounds
Turn off
PublishReadyToRun
in the project file when targeting macOS.Configuration
.NET 9.0
Other information
No response
The text was updated successfully, but these errors were encountered: