[Mono-devel-list] [patch]Patch DllNotFoundException triggered for missing unmanaged libraries

Peter Dennis Bartok peter at novonyx.com
Wed Jun 2 09:42:48 EDT 2004


Denis,

I was under the impression that we already print the detailed error why a
module could not be loaded if MONO_DEBUG is set. Gonzalo put that in for me
quite a while ago. Did I miss something?

Peter

-----Original Message-----
From: "Denis Gervalle" <Denis.Gervalle at softec.st>
To: <mono-devel-list at ximian.com>
Cc: <lupus at ximian.com>; <tauberer at for.net>
Date: Wednesday, 02 June, 2004 04:18
Subject: [Mono-devel-list] [patch]Patch DllNotFoundException triggered for
missing unmanaged libraries


>Here is an updated patch against Beta2 to introduce a better error
>reporting when loading unmanaged libraries. It needs MONO_DEBUG to be
>define.
>
>Hope we will get checked-in this time or at least receive some comments
>on why we are not.
>
>For those who have missed the full story, here is a summuary:
>We have written this patch (and enhance it latter) after seaching hard
>in the dark why a dynamic library next to our mono assembly is
>presumably not found (DllNotFoundException) by mono.
>The attached patch (based on the beta release) modify the triggered
>exception when MONO_DEBUG is defined to provide a larger error message
>corresponding to the joined error message of all tries done using
>g_module_open(). Here is a sample:
>
>Unhandled Exception: System.DllNotFoundException: Trying libsample.so:
>libsample.so: cannot open shared object file: No such file or directory
>==> Trying ./libsample.so: ./libsample.so: cannot open shared object
>file: No such file or directory ==> Trying sample.so:
>libdependancy.so.0: cannot open shared object file: No such file or
>directory
>
>This patch also provide a detailled error report of missing entry points
>in unmanaged library using the same technique.
>This patch takes care of mint issues and mono pinvoke-wrapper issues.
>For the latter, each exception messages are allocated permanently on the
>heap since the exception is triggered by the wrapper code for each call
>to a function from the missing library (and not during the loading
>phase). This is why MONO_DEBUG is required to activate the code, since
>it could leak memory if a lot of missing library are tried.
>
>
>Denis Gervalle
>SOFTEC sa
>http://www.softec.st
>_______________________________________________
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>




More information about the Mono-devel-list mailing list