[Mono-dev] dlopen(libSystem.Data.dll, 9): image not found

Jonathan Mitchell lists at mugginsoft.com
Wed Mar 1 20:52:23 UTC 2017


The Built in Diagnostics class is defined as internal static partial <https://referencesource.microsoft.com/System.Data/P/c29d053268a5b146.html> class Bid <https://referencesource.microsoft.com/System.Data/R/c29d053268a5b146.html>
Searching the source shows a lot of usage in System.Data

Bid.ScopeEnter(out hscp, "<ds.DataSet.EnableConstraints|INFO> %d#\n", ObjectID);

Which is indeed imported from System.Data.dll

private const string dllName = "System.Data.dll”;

        [DllImport(dllName, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Cdecl, EntryPoint="DllBidTraceCW")] extern
        internal static void Trace (IntPtr hID, UIntPtr src, UIntPtr info, string fmtPrintfW, System.Int32 a1, System.Int32 a2, System.String a3, System.String a4, System.Int32 a5);

So it might be easier to ifdef out the imports and provide stubs.
The BID functionality might even prove useful if plumbed in.

Jonathan 


> On 1 Mar 2017, at 20:39, Alexander Köplinger via Mono-devel-list <mono-devel-list at lists.dot.net> wrote:
> 
> Yep, it does indeed come from referencesource: https://github.com/mono/mono/blob/d01c819b05550d430d3c1bf0cc6842a2e8a47a0d/mcs/class/referencesource/System.Data/System/Data/Common/System.Data_BID.cs#L70
> 
> This should be harmless as I don't think any code on Mono reaches this (otherwise you'd get a crash).
> We can probably just ifdef this out on Mono.
> 
> - Alex
> 
>> On 01 Mar 2017, at 19:56, Robert Jordan <robertj at gmx.net> wrote:
>> 
>> On 01.03.2017 15:54, Jonathan Mitchell wrote:
>>> While fixing a Dll import issue on MacOS I noticed the following:
>>> 
>>> Mono: DllImport error loading library 'libSystem.Data.dll.so': 'dlopen(libSystem.Data.dll.so, 9): image not found'.
>>> Mono: DllImport error loading library 'libSystem.Data.dll.bundle': 'dlopen(libSystem.Data.dll.bundle, 9): image not found'.
>>> Mono: DllImport error loading library 'libSystem.Data.dll': 'dlopen(libSystem.Data.dll, 9): image not found'.
>>> Mono: DllImport unable to load library 'dlopen(libSystem.Data.dll, 9): image not found'.
>>> Mono: DllImport attempting to load: 'System.Data.dll’.
>>> 
>>> By the time my app launches  dlopen() has attempted to load libSystem.Data.dll.whatever 1600 times.
>>> My MacOS app launches and exceutes okay.
>>> 
>>> Is this normal behaviour on 4.8.0?
>> 
>> It happens on 4.6.x as well, and it seems to be caused by actual
>> DllImports of 'System.Data.dll':
>> 
>> 
>> 
>> $ monodis System.Data.dll | grep pinvoke | grep System
>> 
>> .method assembly static hidebysig pinvokeimpl ("System.Data.dll" as "DllBidTraceCW" unicode cdecl )
>>   .method assembly static hidebysig pinvokeimpl ("System.Data.dll" as "DllBidTraceCW" unicode cdecl )
>> ...
>> 
>> 
>> These look to me like some MS Reference Source artifacts. Maybe
>> there is a native System.Data.dll under MS.NET which is providing
>> these exports :) No idea what it is.
>> 
>> See also
>> 
>> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freferencesource.microsoft.com%2F%23System.Data%2FSystem%2FData%2FCommon%2FSystem.Data_BID.cs&data=02%7C01%7Calkpli%40microsoft.com%7C95701d1e99b348f34a6308d460d4afe7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636239913989378069&sdata=RYFPq%2F7PJb2xlR%2BWG7%2FVhWGzoVrmLa4MuWqV4QkUnPg%3D&reserved=0
>> 
>> 
>> Robert
>> 
>> 
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.dot.net
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.dot.net%2Fmailman%2Flistinfo%2Fmono-devel-list&data=02%7C01%7Calkpli%40microsoft.com%7C95701d1e99b348f34a6308d460d4afe7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636239913989378069&sdata=mUIjQGYdRfyJXN%2BM%2FLHeDrPKfcx9f3jRyNrwAtXOxd0%3D&reserved=0
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.dot.net
> http://lists.dot.net/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-devel-list/attachments/20170301/0f9a1389/attachment-0001.html>


More information about the Mono-devel-list mailing list