Bug 59239 - [mono2017-06]FileTest.SymLinkLoop failed on tvOS device
Summary: [mono2017-06]FileTest.SymLinkLoop failed on tvOS device
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: 15.6
Depends on:
Reported: 2017-09-05 19:58 UTC by
Modified: 2017-11-28 16:44 UTC (History)

7 users (edit)

(never email me about this bug)
Is this bug a regression?: Yes
Last known good build: d15-4 xamarin.ios-, 416f778f

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.


Description 2017-09-05 19:58:38 UTC
## Steps to reproduce

Update System to Xamarin.iOS mono2017-06 build, mtouch (mono-2017-06: 0235820b).
Execute mscorlib test on tvOS device.

## Actual Behaviour:
[FAIL] FileTest.SymLinkLoop :   File.Exists must return true for path1 symlink loop
  Expected: True
  But was:  False

		  at MonoTests.System.IO.FileTest.SymLinkLoop () [0x0005d] in /data/jenkins/workspace/XI/tvosunittests-d15-5/xamarin-macios/external/mono/mcs/class/corlib/Test/System.IO/FileTest.cs:2709 
		  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
		  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 

## Logs: 
Test Log: https://gist.github.com/GouriKumari/496987e9d0b821df50d840808bc73a9f

## Test Env:
mtouch (mono-2017-06: 0235820b).
Comment 1 2017-09-18 15:32:20 UTC
Rodrigo, the test you added with https://github.com/mono/mono/pull/4872 seems to be failing on tvOS, would you mind taking a look? Thank you
Comment 2 2017-09-25 19:55:24 UTC
This looks like a bug worth investigating.
Comment 3 2017-09-25 19:55:55 UTC
Please find someone to look at it. I have neither the platform or the device at hand.
Comment 4 2017-10-05 15:46:49 UTC
Bumping to 15.6 since I don't think this is an issue on tvOS, because it's not common at all to use symlinks on tvOS.
Comment 5 2017-10-27 18:56:11 UTC
PRs to disable the test until the issue is investigated and fixed:

https://github.com/mono/mono/pull/5889 (master)
https://github.com/mono/mono/pull/5890 (2017-10)
Comment 6 2017-11-28 16:44:54 UTC
tvOS is a bit special since there's no guaranteed storage for user data.

The call to `symlink` returns -1, errno = 1 (EPERM) which is often used for sandbox restrictions and...

Nov 28 11:29:15 Apple-TV kernel(Sandbox)[0] <Notice>: Sandbox: mscorlibtests(413) deny(1) file-write-create /private/var/mobile/Containers/Data/Application/F9D1F6ED-102F-4555-B75F-AA33B5D256C5/Library/Caches/Documents/uetnvso1.x0m

^ it's what the device logs are showing.

Other API behave the same on tvOS, e.g. http://www.openradar.me/22860545 and http://www.openradar.me/23165157

Now why some API works and others don't is afaik undocumented by Apple. However there's nothing we can (or should) do wrt sandbox restrictions.