Bug 30979 - Ungraceful mono crash when running F# exe file and missing FSharp.Core.dll
Summary: Ungraceful mono crash when running F# exe file and missing FSharp.Core.dll
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Alexis Christoforides
Depends on:
Reported: 2015-06-10 13:50 UTC by obadz
Modified: 2016-03-24 19:53 UTC (History)
4 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 30979 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 obadz 2015-06-10 13:50:46 UTC
Using F# compiler and Mono 4.0.1 (on Linux / NixOS).

FSharp.Core.dll is not in the GAC (or equivalently, assume the F# compiler is not installed on this host).

Would expect DllNotFound exception clearly stating which DLL is missing.

Instead, getting this error:

$ mono ./blah.exe
Can't find custom attr constructor image: blah.exe mtoken: 0x0a00000e
* Assertion at class.c:283, condition `!mono_loader_get_last_error ()' not met


Native stacktrace:
    mono() [0x4b76c8]
    /nix/store/c2zjp7bqmp5wvpkrpl7p7sfhxbdyfryy-glibc-2.21/lib/libpthread.so.0(+0x103e0) [0x7f05ab0c93e0]
    /nix/store/c2zjp7bqmp5wvpkrpl7p7sfhxbdyfryy-glibc-2.21/lib/libc.so.6(gsignal+0x37) [0x7f05aab363e7]
    /nix/store/c2zjp7bqmp5wvpkrpl7p7sfhxbdyfryy-glibc-2.21/lib/libc.so.6(abort+0x16a) [0x7f05aab377ea]
    mono() [0x628ae9]
    mono() [0x628cef]
    mono() [0x628e36]
    mono(mono_class_from_typeref+0) [0x5295a0]
    mono() [0x527c05]
    mono() [0x527e49]
    mono() [0x527bed]
    mono() [0x54e9ed]
    mono() [0x551866]
    mono() [0x42bb15]
    mono(mono_runtime_invoke+0x3d) [0x5aac0d]
    mono(mono_runtime_exec_main+0xe5) [0x5ac585]
    mono(mono_main+0x11bc) [0x48ce4c]
    /nix/store/c2zjp7bqmp5wvpkrpl7p7sfhxbdyfryy-glibc-2.21/lib/libc.so.6(__libc_start_main+0xf5) [0x7f05aab23995]
    mono() [0x41fc79]

Debug info from gdb:

Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.

Workaround: Make FSharp.Core a Private reference in your build file so that it gets copied along with your output.

Also posed in F# compiler issues: https://github.com/fsharp/fsharp/issues/419