-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Compiler crashes when failing to release Mutex #53420
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Is the exception that it failed with written in some log? |
Tagging subscribers to this area: @cston Issue Details
Configuration: cc @jkotas @jaredpar @stephentoub
|
Doesn't appear to be, this is all we have in the binlog https://artprodcus3.artifacts.visualstudio.com/Ab55de4ed-4b5a-4215-a8e4-0a0a5f71e7d8/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2RuY2VuZy9wcm9qZWN0SWQvOWVlNmQ0NzgtZDI4OC00N2Y3LWFhY2MtZjZlNmQwODJhZTZkL2J1aWxkSWQvMTE2MTE0Ni9hcnRpZmFjdE5hbWUvQnVpbGRMb2dzX0NvcmVDTFJfTGludXhfYXJtNjRfcmVsZWFzZQ2/content?format=file&subPath=%2FRelease%2FBuild.binlog Essentially the same two lines Viktor shared. |
So far I can only find that one instance: https://runfo.azurewebsites.net/search/timelines/?q=started%3A%7E7+definition%3Aruntime+message%3A%22%5EReleaseMutex+failed.%22 |
That crash is coming from this line https://sourceroslyn.io/#Microsoft.Build.Tasks.CodeAnalysis/BuildServerConnection.cs,239 When communicating between MSBuild nodes and the Compiler server we use a Our code considers this fatal because the docs say that What other circumstances can cause an |
Could the |
In our case unlikely. This The one issue to keep in mind is that we have an abstraction over public void Dispose()
{
if (IsDisposed)
return;
IsDisposed = true;
try
{
if (IsLocked)
Mutex.ReleaseMutex();
}
finally
{
Mutex.Dispose();
IsLocked = false;
}
} One possibility is we are incorrectly setting |
Failed again in #53590 . I think it is most likely Linux arm64 specific bug in CoreCLR PAL. |
Current runfo query shows a hit on x64 too, so it is not arm64 specific. |
Again, but in Mono Android Arm64 release build, using 3.1.
|
@jaredpar I would like to look into this issue - is there a reasonable way to repro it locally? |
It's probably from here: runtime/src/libraries/System.Private.CoreLib/src/System/Threading/Mutex.Windows.cs Line 92 in dfbae37
After getting an exception here:
|
Hm, original report was for Linux arm64, so I was tracing Unix partials (which calls into the waitsubsystem). |
|
this is an old issue, is this something which needs to be looked at ? |
Closing for now, as there haven't been recent reports and there isn't sufficient info available to diagnose the issue. Issue #89090 covers adding more info about system call errors to named mutex exceptions. |
I see that this was just hit on my validation build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=407963&view=logs&j=1131d339-d842-59c0-dcc0-73e7a31acc11&t=9c8d0f40-0c4c-53c5-f33c-9e8e40de8387 Also noticed that MSBuild is tracking this here: dotnet/msbuild#7601 |
Hey, this just hit on my ci/cd, (macos) https://github.com/Somfic/vla/actions/runs/7751958359/job/21140666679?pr=74 |
From @Somfic log
Confirms that the calls are indeed happening on the same thread id. |
I'm seeing this while building on my macOS M2. |
There should be better diagnostic info in .NET 9 including info from system call errors (#92603). Can you share more details about the failure? |
@kouvel Not really. The error message was basically the same as this issue. Let me see if I can reproduce it. |
Ah right I forgot the extra info is not tracked for ReleaseMutex. I'll also try to repro. |
Assume this is a long standing issue and not specific to 9. @kouvel, can we move to 10? |
Error Message
Fill the error message using step by step known issues guidance.
Example error:
Build: https://dev.azure.com/dnceng/public/_build/results?buildId=1161146&view=logs&j=1a1e7658-955a-5bfe-8410-74fa4a1a1fbf&t=9528cbd6-a8dd-5006-9c48-38938c12a3af
Configuration:
CoreCLR Product Build Linux arm64 release
cc @jkotas @jaredpar @stephentoub
Known issue validation
Build: 🔎⚠️ Provided build not found. Provide a valid build in the "Build: 🔎" line.
Result validation:
Validation performed at: 9/15/2023 5:21:46 PM UTC
Report
Summary
The text was updated successfully, but these errors were encountered: