Skip to content
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

Need better error message when it fails to create a Mutex due to no-write permission to the '/tmp' folder on macOS or Linux #36823

Closed
daxian-dbw opened this issue May 21, 2020 · 1 comment
Assignees
Labels
area-System.Threading os-linux Linux OS (any supported distro)
Milestone

Comments

@daxian-dbw
Copy link
Contributor

We consistently get issue reports in PSReadLine about an IOException when creating a Mutex object on macOS:

System.IO.IOException: The system cannot open the device or file specified. : 'PSReadLineHistoryFile_1525368525'
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

I worked with a user on that issue and it turned out it was because the /tmp folder (mapped to /private/tmp) on the user's mac shows 755 for the permissions, namely no write permission for a non-root user. The user thought the permission change could be caused by Homebrew, and Mutex creation works fine after changing the permission to 777, see PowerShell/PSReadLine#1464 (comment)

The error message is not helpful to get to the root of the problem. Given it's a permission issue, it could be great if the error message could indicate the permission issue.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Threading untriaged New issue has not been triaged by the area owner labels May 21, 2020
@jkotas jkotas added the os-linux Linux OS (any supported distro) label May 21, 2020
@mangod9 mangod9 self-assigned this Jul 6, 2020
@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Jul 6, 2020
@mangod9 mangod9 added this to the 5.0.0 milestone Jul 6, 2020
@mangod9 mangod9 modified the milestones: 5.0.0, 6.0.0 Jul 21, 2020
@mangod9 mangod9 modified the milestones: 6.0.0, 7.0.0 Jul 21, 2021
@mangod9 mangod9 assigned eduardo-vp and unassigned mangod9 Jul 27, 2022
@mangod9 mangod9 modified the milestones: 7.0.0, 8.0.0 Jul 27, 2022
@kouvel kouvel modified the milestones: 8.0.0, 9.0.0 Aug 10, 2023
@kouvel
Copy link
Member

kouvel commented Aug 10, 2023

Consolidating into #89090

@kouvel kouvel closed this as completed Aug 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Threading os-linux Linux OS (any supported distro)
Projects
None yet
Development

No branches or pull requests

6 participants