Bug 6019 - Problematic dynamic library loading with 2.11.2 official package
Summary: Problematic dynamic library loading with 2.11.2 official package
Alias: None
Product: Runtime
Classification: Mono
Component: packaging ()
Version: unspecified
Hardware: Macintosh Mac OS
: High major
Target Milestone: ---
Assignee: Duncan Mak
Depends on:
Reported: 2012-07-06 14:54 UTC by stefanor
Modified: 2012-10-09 13:39 UTC (History)
5 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 on GitHub or Developer Community 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.

Related Links:

Description stefanor 2012-07-06 14:54:44 UTC
May be related to bug 797.  This is with a clean install of 2.11.2 from 
MonoFramework-MDK-2.11.2.macos10.xamarin.x86.dmg from go-mono.com.

Mac OS X 10.7.4

Stefans-MacBook-Air:2.11.2 sorear$ csharp /r:Mono.Posix
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> Mono.Unix.Native.Syscall.system("date"); 
System.TypeInitializationException: An exception was thrown by the type initializer for Mono.Unix.Native.Stdlib ---> System.DllNotFoundException: libMonoPosixHelper.dylib
  at (wrapper managed-to-native) Mono.Unix.Native.Stdlib:GetDefaultSignal ()
  at Mono.Unix.Native.Stdlib..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at <InteractiveExpressionClass>.Host (System.Object& $retval) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) [0x00000] in <filename unknown>:0 
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in <filename unknown>:0 

Stefans-MacBook-Air:2.11.2 sorear$ LD_LIBRARY_PATH=/Library/Frameworks/Mono.framework/Versions/2.11.2/lib csharp /r:Mono.Posix
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> Mono.Unix.Native.Syscall.system("date"); 
Fri Jul  6 10:28:28 PDT 2012

Stefans-MacBook-Air:2.11.2 sorear$
Comment 1 Miguel de Icaza [MSFT] 2012-09-02 13:10:26 UTC

Do we have a system in the office running 2.11.3 that we can use to debug these issues?

Can you please try to replicate this?
Comment 2 Jeremiah Boyle 2012-10-04 01:08:23 UTC
i'm getting the same DllNotFoundException for libMonoPosixHelper.dylib with 2.11.4.

i worked around it, for the time being, by editing MonoPosixHelper dllmap statement in /Library/Frameworks/Mono.framework/Versions/2.11.4/etc/mono/config to include the full path to the library.
Comment 3 Brian Luczkiewicz 2012-10-04 01:32:29 UTC
I am seeing this too on 2.11.4.

Jeremiah's workaround got me going again, but it would be good to get the packages into a state where they work out-of-the-box.
Comment 4 Duncan Mak 2012-10-09 13:39:56 UTC
This has already been fixed in 2.11.5. The pre-release builds are available in Wrench.


duncan@dynamic-022:~$ more /Library/Frameworks/Mono.framework/Versions/2.11.5/etc/mono/config 
        <dllmap dll="i:cygwin1.dll" target="libc.dylib" os="!windows" />
        <dllmap dll="libc" target="libc.dylib" os="!windows"/>
        <dllmap dll="intl" target="libintl.dylib" os="!windows"/>
        <dllmap dll="intl" name="bind_textdomain_codeset" target="libc.dylib" os="solaris"/>
        <dllmap dll="libintl" name="bind_textdomain_codeset" target="libc.dylib" os="solaris"/>
        <dllmap dll="libintl" target="libintl.dylib" os="!windows"/>
        <dllmap dll="i:libxslt.dll" target="libxslt.dylib" os="!windows"/>
        <dllmap dll="i:odbc32.dll" target="libodbc.dylib" os="!windows"/>
        <dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
        <dllmap dll="oci" target="libclntsh.dylib" os="!windows"/>
        <dllmap dll="db2cli" target="libdb2_36.dylib" os="!windows"/>
        <dllmap dll="MonoPosixHelper" target="/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/libMonoPosixHelper.dylib" os="!windows" />
        <dllmap dll="i:msvcrt" target="libc.dylib" os="!windows"/>
        <dllmap dll="i:msvcrt.dll" target="libc.dylib" os="!windows"/>
        <dllmap dll="sqlite" target="libsqlite.0.dylib" os="!windows"/>
        <dllmap dll="sqlite3" target="libsqlite3.0.dylib" os="!windows"/>
        <dllmap dll="libX11" target="libX11.dylib" os="!windows" />
        <dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
        <dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
        <dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
        <dllmap dll="libcups" target="libcups.dylib" os="osx"/>
        <dllmap dll="i:kernel32.dll">
                <dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
                <dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
                <dllentry dll="__Internal" name="MoveMemory" target="mono_win32_compat_MoveMemory"/>
                <dllentry dll="__Internal" name="ZeroMemory" target="mono_win32_compat_ZeroMemory"/>
        <dllmap dll="gdiplus" target="/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/libgdiplus.dylib" />
        <dllmap dll="gdiplus.dll" target="/Library/Frameworks/Mono.framework/Versions/2.11.5/lib/libgdiplus.dylib" />