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

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


Attachments

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

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