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: 2017-12-07 17:19 UTC (History)
10 users (show)

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


Attachments

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".

Note You need to log in before you can comment on or make changes to this bug.