Bug 41910 - IsolatedStorage breaks on el capitan due to SpecialFolder.CommonApplicationData location
Summary: IsolatedStorage breaks on el capitan due to SpecialFolder.CommonApplicationDa...
Status: CONFIRMED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: master
Hardware: PC Mac OS
: --- major
Target Milestone: Future Release
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-16 19:31 UTC by Alexander Kyte
Modified: 2018-04-10 08:55 UTC (History)
11 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 41910 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Alexander Kyte 2016-06-16 19:31:53 UTC
The project

https://github.com/clancey/Rosie

breaks with the concurrent collector due to trying to write to 

“/usr/share/.isolated-storage".

This is handled by `mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs` which hasn’t been touched since January 2015. I think that Environment.UnixGetFolderPath might be broken by one of the changes related to the concurrent collector.
Comment 1 James Clancey 2016-06-16 21:26:53 UTC
Here is the crash output: https://gist.github.com/Clancey/e5dca2e4888eab449f23c3d564a28dd3
Comment 2 James Clancey 2016-08-16 06:17:43 UTC
This has now hit the stable channels
Comment 3 James Clancey 2016-08-16 07:44:25 UTC
I did a little debugging, and its Environment.SpecialFolder.CommonApplicationData. This is wrong for OSX
https://github.com/mono/mono/blob/f1eb362a7760e018f899c027ca3842929a11daf8/mcs/class/corlib/System/Environment.cs#L738-L739
Comment 4 Bernhard Urban 2016-09-05 19:49:19 UTC
I've troubles to see how this can be caused by the GC.

Does that problem still occur if you turn off the concurrent collector? You can do that by setting MONO_GC_PARAMS=major=marksweep

Also, can you give instructions on how to reproduce it exactly? (how to call Rosie and what to do in order to trigger that crash).
Comment 5 Kristofer Linnestjerna 2016-11-17 21:24:42 UTC
Hi guys this probably caused by the El Capitain feature System Integrity Protection https://support.apple.com/en-us/HT204899

Mono resolves the CommonApplicationData folder as /usr/share and in El Capitain and later with SIP turned on this path will not be writable, not even by root

if you want a mono version that works use https://download.mono-project.com/archive/4.4.0/macos-10-universal/MonoFramework-MDK-4.4.0.182.macos10.xamarin.universal.pkg

it has a patch for this specific macOS problem, but it has been reverted.
Comment 6 Kristofer Linnestjerna 2016-11-17 21:25:37 UTC
Hi guys this probably caused by the El Capitain feature System Integrity Protection https://support.apple.com/en-us/HT204899

Mono resolves the CommonApplicationData folder as /usr/share and in El Capitain and later with SIP turned on this path will not be writable, not even by root

if you want a mono version that works use https://download.mono-project.com/archive/4.4.0/macos-10-universal/MonoFramework-MDK-4.4.0.182.macos10.xamarin.universal.pkg

it has a patch for this specific macOS problem, but it has been reverted.
Comment 7 Rodrigo Kumpera 2017-10-11 17:43:06 UTC
Moving to class libraries as it needs to be handled there.
Comment 8 Mike 2017-12-07 17:19:16 UTC
I ran into this while trying to import SSL certificates on a build server. The mono installation is configured with prefix "/srv/local". However, mozroots and cert-sync were trying to write certificates to "/usr/share/.mono" instead of "/srv/local/share/.mono".
Comment 9 Egorbo 2018-02-14 01:59:27 UTC
(In reply to Mike from comment #8)
> I ran into this while trying to import SSL certificates on a build server.
> The mono installation is configured with prefix "/srv/local". However,
> mozroots and cert-sync were trying to write certificates to
> "/usr/share/.mono" instead of "/srv/local/share/.mono".

You can use --user flag with cert-sync which will avoid the /usr/share folder as a workaround
Comment 10 Marek Safar 2018-04-10 08:50:57 UTC
We need to coordinate with https://github.com/dotnet/corefx/issues/12628 which code we'll ultimately use so we don't duplicate the effort or choose different solution