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 (show other bugs)
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Alexis Christoforides
URL:
Depends on:
Blocks:
 
Reported: 2015-06-10 13:50 UTC by obadz
Modified: 2016-03-24 19:53 UTC (History)
4 users (show)

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


Attachments

Description obadz 2015-06-10 13:50:46 UTC
Using F# compiler 3.1.1.32 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

Stacktrace:

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

Aborted
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

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