Skip to content

Conversation

kouvel
Copy link
Contributor

@kouvel kouvel commented Dec 14, 2021

Customer Impact

Some apps involving multiple processes may have x64 and arm64 .NET process components during transition, where the processes may try to share a named mutex for synchronization. Currently this is not possible, as the second process that tries to open an existing named mutex fails with an exception.

Regression?

No

Testing

Verified with a test case that a named mutex can be shared for synchronization between arm64 and emulated x64 .NET processes. Also verified backward compatibility between processes of the same arch.

Risk

Low, with a small caveat

  • There is a case where this is not 100% compatible with an unfixed runtime when processes of different archs are trying to share the same mutex (in a scenario where it wouldn't have worked before the fix anyway). The fix allows an arm64 process to increase the shared memory file size to its page size such that it can be mapped. So for example, if an unfixed x64 process creates a named mutex, then a fixed arm64 process opens it (and increases the shared memory file size), then if an unfixed x64 process tries to open a new instance of the mutex it would throw an exception. It's expected that both runtimes are updated with the fix in order to interoperate successfully with named mutexes.

…sses

- The page size is different between arm64 processes and emulated x64 processes
- The shared memory file size is set to the page size and there was a strict check on the file size, leading to an exception from the second process of a different arch that tries to share the same mutex
- Made the file size check less strict, and allowed an arch to increase but not decrease the file size such that it can be mapped at page size granularity
- Fix for #62140 in main
@kouvel kouvel added this to the 6.0.x milestone Dec 14, 2021
@kouvel kouvel self-assigned this Dec 14, 2021
@ghost
Copy link

ghost commented Dec 14, 2021

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details
Author: kouvel
Assignees: kouvel
Labels:

area-System.Threading

Milestone: 6.0.x

@kouvel kouvel requested a review from mangod9 December 14, 2021 19:32
@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Dec 15, 2021
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 should consider for 6.0.x

@safern
Copy link
Member

safern commented Dec 15, 2021

@jeffschwMSFT this still has servicing-consider is that an overlook, can I merge?

@jeffschwMSFT
Copy link
Member

Not approved by tactics yet

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 4, 2022
@leecow leecow modified the milestones: 6.0.x, 6.0.2 Jan 4, 2022
@jeffschwMSFT jeffschwMSFT merged commit 4f01ff5 into dotnet:release/6.0 Jan 6, 2022
@kouvel kouvel deleted the MutexFix6 branch January 6, 2022 19:40
@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Threading Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants