Bug 59128 - dllmap entries in dll.config in payload attached at end of main is not processed.
Summary: dllmap entries in dll.config in payload attached at end of main is not proce...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: Interop ()
Version: 4.8.0 (C9)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-08-30 21:54 UTC by Hin-Tak Leung
Modified: 2017-09-16 00:47 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 59128 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 Hin-Tak Leung 2017-08-30 21:54:21 UTC
I am experimenting with the --simple option of mkbundle (which attaches everything to the end of the main mono executable, introduced recently). One of my dll.config has this:

<?xml version="1.0" encoding="utf-8" ?>
	<dllmap dll="freetype6">
		<dllentry os="linux" dll="libfreetype.so.6" />
		<dllentry os="osx" dll="libfreetype.6.dylib" />
		<dllentry os="freebsd" target="libfreetype.so.6" />

When I ran MONO_LOG_MASK=dll MONO_LOG_LEVEL=debug, I found that mono never looks for the so.6 entry, i.e. the dllmap is simply ignored.
This is first seen on Mac OS X but I replicated the problem on linux too.

I can work around this problem by doing "--library freetype6,..." directly on the mkbundle invocation, but it seems quite confusing when the mkbundle --simple option is embedding the config but ignoring it (instead of simply not embedding).

This is mono 4.8.0 - I see there are some further changes after, so apologies if this is fixed in later releases.

Although this mostly concerns new functionality in mkbundle and how it should work in the runtime, the relevant code for registering and and lookup native library is part of the run time and is in mono/mini/main.c ( https://github.com/mono/mono/commit/2f1e6655e2c9a9dd28c0a8b14f26d3d6b1c720bd )
Comment 1 Ludovic Henry 2017-09-16 00:47:06 UTC
Alexander, this seems related to mkbundle, could you please take a look? Thank you.