Bug 56252 - ELOOP causes SIGSEGV
Summary: ELOOP causes SIGSEGV
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-05-11 21:43 UTC by Jonathan Pryor
Modified: 2017-08-25 13:38 UTC (History)
3 users (show)

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 56252 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:

Description Jonathan Pryor 2017-05-11 21:43:44 UTC
System.IO.File operations on a "bad" symlink which results in ELOOP when accessing the file will cause mono to abort.

The setup:

  ln -s badlink badlink

The punch:

  $ csharp
  csharp> using System.IO
  csharp> File.Exists ("badlink");

The result:

> Stacktrace:
>   at <unknown> <0xffffffff>
>   at (wrapper managed-to-native) System.IO.MonoIO.GetFileAttributes (string,System.IO.MonoIOError&) <0x00012>
>   at System.IO.MonoIO.ExistsFile (string,System.IO.MonoIOError&) [0x00000] in <b697cffb61b74023aa9c587e6c49beb3>:0
>   at System.IO.File.Exists (string) [0x00021] in <b697cffb61b74023aa9c587e6c49beb3>:0
Comment 1 floriang 2017-08-25 13:38:58 UTC
Similar bug here, but with a symlink pointing to a directory that is not mounted yet.
I don't see ELOOP in my case but stacktrace is the same.
Problem is we need to mount the directory after our application start, but our app needs to try doing file accesses on this unmounted directory.

Any idea or workaround???

Note: we don't have the issue if we use Xamarin.Android 6.0

01-01 16:41:48.370  3628  3628 E mono-rt : Stacktrace:
01-01 16:41:48.370  3628  3628 E mono-rt : 
01-01 16:41:48.370  3628  3628 E mono-rt :   at <unknown> <0xffffffff>
01-01 16:41:48.370  3628  3628 E mono-rt :   at (wrapper managed-to-native) System.IO.MonoIO.GetFileAttributes (string,System.IO.MonoIOError&) <0x0003b>
01-01 16:41:48.370  3628  3628 E mono-rt :   at System.IO.MonoIO.ExistsFile (string,System.IO.MonoIOError&) [0x00000] in <36b76ff753854638aa375a3bfa558fd9>:0
01-01 16:41:48.370  3628  3628 E mono-rt :   at System.IO.File.Exists (string) [0x00021] in <36b76ff753854638aa375a3bfa558fd9>:0