Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Named mutex: Use flock instead of pthread process-shared mutex in som…#6015

Merged
kouvel merged 1 commit intodotnet:masterfrom
kouvel:NamedMutexMoreFlockCases
Jul 6, 2016
Merged

Named mutex: Use flock instead of pthread process-shared mutex in som…#6015
kouvel merged 1 commit intodotnet:masterfrom
kouvel:NamedMutexMoreFlockCases

Conversation

@kouvel
Copy link

@kouvel kouvel commented Jun 27, 2016

…e more cases

Workaround for #5456:

  • Sometimes, a timed wait operation is not getting released, causing a hang
  • Due to the hang, it is not possible to detect this issue with code
  • Temporarily disabled the use of pthread process-shared mutexes on ARM/ARM64. File locks will be used instead.

Workaround for #5872:

  • On Alpine Linux, a pthread process-shared robust mutex is detecting the case where a process abandons the mutex when it exits while holding the lock, but is putting the mutex into an unrecoverable state (ENOTRECOVERABLE) instead of assigning lock ownership to the next thread that is released from a wait for a lock and notifying of abandonment (EOWNERDEAD).
  • Added a test case to detect this issue, to have it use file locks instead

Close #5456

@kouvel
Copy link
Author

kouvel commented Jun 27, 2016

@janvorli

@richfelker
Copy link

I've got a fix for the robust mutex bug in musl that's about to go upstream and which Alpine will hopefully be adopting soon.

@richfelker
Copy link

@kouvel
Copy link
Author

kouvel commented Jun 27, 2016

@dotnet-bot test this please

1 similar comment
@kouvel
Copy link
Author

kouvel commented Jun 28, 2016

@dotnet-bot test this please

@kouvel
Copy link
Author

kouvel commented Jun 28, 2016

@adityamandaleeka

@kouvel
Copy link
Author

kouvel commented Jun 28, 2016

@dotnet-bot test this please

@kouvel
Copy link
Author

kouvel commented Jul 5, 2016

@janvorli & @adityamandaleeka, could one of you please take a look?

int result = DoTest();
if (result < 0)
return 0;
return result >= 0 ? result : 0;
Copy link
Member

Choose a reason for hiding this comment

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

Not important, but you could get rid of the check above since this does the same thing right?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, will remove that

@adityamandaleeka
Copy link
Member

Left some minor comments. LGTM otherwise.

…e more cases

Workaround for #5456:
- Sometimes, a timed wait operation is not getting released, causing a hang
- Due to the hang, it is not possible to detect this issue with code
- Temporarily disabled the use of pthread process-shared mutexes on ARM/ARM64. File locks will be used instead.

Workaround for #5872:
- On Alpine Linux, a pthread process-shared robust mutex is detecting the case where a process abandons the mutex when it exits while holding the lock, but is putting the mutex into an unrecoverable state (ENOTRECOVERABLE) instead of assigning lock ownership to the next thread that is released from a wait for a lock and notifying of abandonment (EOWNERDEAD).
- Added a test case to detect this issue, to have it use file locks instead

Close #5456
@kouvel kouvel merged commit 66b6219 into dotnet:master Jul 6, 2016
@kouvel kouvel deleted the NamedMutexMoreFlockCases branch July 6, 2016 16:50
dotnet-maestro-bot pushed a commit to dotnet-maestro-bot/coreclr that referenced this pull request Jun 26, 2018
jkotas pushed a commit that referenced this pull request Jun 27, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…kCases

Named mutex: Use flock instead of pthread process-shared mutex in som…

Commit migrated from dotnet/coreclr@66b6219
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Fixes dotnet/coreclr#6016.
Resolves dotnet/coreclr#6015.

Signed-off-by: dotnet-bot <[email protected]>


Commit migrated from dotnet/coreclr@bcabe11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants