Bug 59076 - mkbundle --cross mono-5.2.0-*.zip --library broken because of mis-built 5.2.0 targets.
Summary: mkbundle --cross mono-5.2.0-*.zip --library broken because of mis-built 5.2.0...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: Build ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-27 23:34 UTC by Hin-Tak Leung
Modified: 2017-10-27 11:18 UTC (History)
6 users (show)

Tags:
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 59076 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:
Status:
NEW

Description Hin-Tak Leung 2017-08-27 23:34:46 UTC
It appears that at least 4 of the cross 5.2.0 targets are mis-built:

$ find ~/.mono/targets/* | grep bin/mono | xargs grep -l 'Function not supported'
/home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-i386.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x86.zip/bin/mono

This line comes from mono/eglib/gfile-unix.c 
(see also https://github.com/mono/mono/pull/5459/files )
It should be dead-code, and not compiled in for most modern platforms. And indeed, the older 8 targets I have seem to be correct:

$ find ~/.mono/targets/* | grep bin/mono 
/home/Hin-Tak/.mono/targets/mono-4.8.0-osx-10.7-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-4.8.0-osx-10.7-x86.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-4.8.0-ubuntu-12.04-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-4.8.0-ubuntu-12.04-x86.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.0.1-osx-10.7-i386.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.0.1-osx-10.7-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.0.1-ubuntu-12.04-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.0.1-ubuntu-12.04-x86.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-i386.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x64.zip/bin/mono
/home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x86.zip/bin/mono

A user saw 'Function not supported' when testing one of my cross-built binary
( http://lists.nongnu.org/archive/html/freetype-devel/2017-08/msg00143.html ) - and the stacktrace points specifically to g_mkdtemp(). I manage to get the same crash with the ubuntu 5.2.0 cross target on fedora also.

Building against the 4.8 target is fine.
(Yes, I made a mistake with targeting 5.2 with a 4.8 tool chain... so in fact I do not really need cross 5.2 target to work...)

I am recording the broken one's md5sum and time-stamps here so that I can check for updates.

$ find ~/.mono/targets/* | grep bin/mono | xargs grep -l 'Function not supported' | xargs md5sum
0799c5b375fa05e9df18e4d13f2962a8  /home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-i386.zip/bin/mono
92440e05650825bb1256c4a8df6232ba  /home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-x64.zip/bin/mono
c6f533e4a55a4287981fb5cd54512cca  /home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x64.zip/bin/mono
d835005183054f252adb3e304674606d  /home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x86.zip/bin/mono
$ find ~/.mono/targets/* | grep bin/mono | xargs grep -l 'Function not supported' | xargs ls -l
-rw-rw-r--. 1 Hin-Tak Hin-Tak 4054812 Aug 14 20:54 /home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-i386.zip/bin/mono
-rw-rw-r--. 1 Hin-Tak Hin-Tak 4240940 Aug 14 20:55 /home/Hin-Tak/.mono/targets/mono-5.2.0-osx-10.7-x64.zip/bin/mono
-rw-rw-r--. 1 Hin-Tak Hin-Tak 3797736 Aug 14 16:23 /home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x64.zip/bin/mono
-rw-rw-r--. 1 Hin-Tak Hin-Tak 3820824 Aug 14 16:22 /home/Hin-Tak/.mono/targets/mono-5.2.0-ubuntu-12.04-x86.zip/bin/mono
Comment 1 Jens Eckervogt 2017-10-21 13:18:31 UTC
Hello is it broken? NO ONLY MONO 5.2.0 and 5.4.0 have bugs. but any cross zip files are ok. Since I tested with Mono 4.8.0

If you don't know how do you --cross "ubuntu16-x86" or ubuntu16-x64 as name folder of %USERPROFILE%\Documents\.mono\target\<operating system and architecture>

And download safe zips from mono-raw url and copy 3 directories into <operating system and architecture>\ than you type command line
mkbundle --cross <operating system and architecture> --deps --static -o ( output.exe for Windows, output-osx for Mac OS X and output for Linux / Ubuntu ) -v
and result:
C:\Users\Jens\source\repos\Example\Example\bin\Debug>mkbundle --cross osx-10-7-x64 --deps --static -o Output-osx Example.exe -v
From: C:\Users\Jens\Documents\.mono\targets\osx-10-7-x64
OS is: Windows
Sources: 1 Auto-dependencies: True
Using runtime: C:\Users\Jens\Documents\.mono\targets\osx-10-7-x64\bin\mono
At 0 with input 5697652
At 570000 with input 5632
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\Example.exe
At 572000 with input 161
       Config: C:\Users\Jens\Documents\.mono\targets\osx-10-7-x64\bin\mono
At 573000 with input 3819008
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\mscorlib.dll
At 918000 with input 1478656
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\gtk-sharp.dll
At a82000 with input 99840
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\glib-sharp.dll
At a9b000 with input 2563584
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\System.dll
At d0d000 with input 334848
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\Mono.Security.dll
At d5f000 with input 129536
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\System.Configuration.dll
At d7f000 with input 3339776
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\System.Xml.dll
At 10af000 with input 133120
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\System.Security.dll
At 10d0000 with input 950784
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\System.Core.dll
At 11b9000 with input 181248
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\Mono.Posix.dll
At 11e6000 with input 188928
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\atk-sharp.dll
At 1215000 with input 247808
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\gdk-sharp.dll
At 1252000 with input 99328
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\pango-sharp.dll
At 126b000 with input 60928
     Assembly: C:\Program Files (x86)\Mono\lib\mono\4.5\Mono.Cairo.dll
At 127a000 with input 71168
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\I18N.West.dll
At 128c000 with input 39936
     Assembly: C:\Users\Jens\source\repos\Example\Example\bin\Debug\I18N.dll
assembly:Example.exe at (5701632, 5632)
config:Example.exe at (5709824, 161)
assembly:mscorlib.dll at (5713920, 3819008)
assembly:gtk-sharp.dll at (9535488, 1478656)
assembly:glib-sharp.dll at (11018240, 99840)
assembly:System.dll at (11120640, 2563584)
assembly:Mono.Security.dll at (13684736, 334848)
assembly:System.Configuration.dll at (14020608, 129536)
assembly:System.Xml.dll at (14151680, 3339776)
assembly:System.Security.dll at (17494016, 133120)
assembly:System.Core.dll at (17629184, 950784)
assembly:Mono.Posix.dll at (18583552, 181248)
assembly:atk-sharp.dll at (18767872, 188928)
assembly:gdk-sharp.dll at (18960384, 247808)
assembly:pango-sharp.dll at (19210240, 99328)
assembly:Mono.Cairo.dll at (19312640, 60928)
assembly:I18N.West.dll at (19374080, 71168)
assembly:I18N.dll at (19447808, 39936)
Generated Output-osx for example

I hope you use Mono 4.8.1 better I knew Mono 5.0 to 5.4 are bad and have issues and bugs... If you are not sure for Linux Mono Please make sure "-version 4.8.1" If you use Software package like any more debs or name find "Mono 4.8.1" than mark and install ( PS do not upgrade Mono just ignore upgrade version.

And for Mac OS X: Download disk image Mono 4.8.1

Thanks resolving problem.
Comment 2 Hin-Tak Leung 2017-10-21 19:19:17 UTC
I don't think you understand my report message. I clearly stated that I tried 4.8.0, 5.0.1, 5.2.0 for both osX and ubuntu, for both 32-bit and 64-bit - i.e. a total of 12 combinations. 8 of the 12 combinatios are okay, the 4 combinations of 5.2.0 are not.

5.0.1 was fine as far as this issue goes.

I did not try 5.4.0 so cannot confirm or deny that it works or not.