-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Disable saving source texts to memory mapped files on non-Windows platforms #73628
Conversation
@dibarbet ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be really handled by the storage service itself, i.e.:
roslyn/src/Workspaces/Core/Portable/TemporaryStorage/TemporaryStorageService.Factory.cs
Lines 26 to 31 in ea35f7c
// MemoryMapped files which are used by the TemporaryStorageService are present in .NET Framework (including Mono) | |
// and .NET Core Windows. For non-Windows .NET Core scenarios, we can return the TrivialTemporaryStorageService | |
// until https://github.com/dotnet/runtime/issues/30878 is fixed. | |
return PlatformInformation.IsWindows || PlatformInformation.IsRunningOnMono | |
? new TemporaryStorageService(workspaceThreadingService, textFactory) | |
: TrivialTemporaryStorageService.Instance; |
Why is this reaching an AccessViolationException, as opposed to a PlatformNotSupportedException/NotSupportedException/NotImplementedException somewhere before that? |
Mmfs are supported. The issue is that you can literally run out of space with them on Linux. This is happening within a container where the total amount of mmf space is limited (to like 32mb). So it's more like it's a scarce resource there, not that it isn't supported. |
In that case, it should be an IOException, but the point still holds. Something is assuming a pointer is valid when it is not. |
@sharwell The call to create the MMF succeeds. But writing it fails on linux when it actually tries to write to the portion of the mapped file that exceeds the allowed size of the environment. |
Any update on this? We are working around this by increasing the shared mem limit as described here (dotnet/vscode-csharp#7119 (comment)), but would prefer not to do that. |
Had to take a slightly different approach - the new version of the fix is here - #74339 |
Closing out in favor of David's solution. |
Resolves dotnet/vscode-csharp#7119