FS#46608 - [mono] 4.0.4.1-1 mkbundle produces faulty binaries

Attached to Project: Arch Linux
Opened by Thomas Weidner (thomas001le) - Thursday, 08 October 2015, 11:42 GMT
Last edited by Isenmann Daniel (ise) - Sunday, 27 March 2016, 18:27 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Isenmann Daniel (ise)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

mkbundle should produce stand-alone binaries from mono assemblies. In Archlinux (64bit), even a simple hello world program produces a binary which segfaults:

$ cat Hello.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}

$ dmcs Hello.cs

$ mkbundle Hello.exe
OS is: Linux
Sources: 1 Auto-dependencies: False
embedding: /home/thomas/tmp/Hello.exe
Compiling:
as -o temp.o temp.s
cc -ggdb -o a.out -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o
Done

$ ./a.out

Native stacktrace:

/usr/lib/libmonoboehm-2.0.so.1(+0xd33ca) [0x7f064c8a43ca]
/usr/lib/libmonoboehm-2.0.so.1(+0x488e0) [0x7f064c8198e0]
/usr/lib/libpthread.so.0(+0x10d60) [0x7f064bebad60]
/usr/lib/libmonoboehm-2.0.so.1(+0x243a40) [0x7f064ca14a40]
/usr/lib/libmonoboehm-2.0.so.1(+0x24bef8) [0x7f064ca1cef8]
/usr/lib/libmonoboehm-2.0.so.1(+0x244f3f) [0x7f064ca15f3f]
/usr/lib/libmonoboehm-2.0.so.1(+0x244308) [0x7f064ca15308]
/usr/lib/libmonoboehm-2.0.so.1(+0x23af68) [0x7f064ca0bf68]
/usr/lib/libmonoboehm-2.0.so.1(+0x23b851) [0x7f064ca0c851]
/usr/lib/libmonoboehm-2.0.so.1(+0x245e6a) [0x7f064ca16e6a]
/usr/lib/libmonoboehm-2.0.so.1(+0x245f8e) [0x7f064ca16f8e]
/usr/lib/libmonoboehm-2.0.so.1(+0x1fc0a1) [0x7f064c9cd0a1]
/usr/lib/libmonoboehm-2.0.so.1(+0x1d079c) [0x7f064c9a179c]
/usr/lib/libmonoboehm-2.0.so.1(+0x49be6) [0x7f064c81abe6]
/usr/lib/libmonoboehm-2.0.so.1(mono_main+0x2d9) [0x7f064c8799c9]
./a.out() [0x400bfb]
/usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7f064bb26610]
./a.out() [0x4007c9]

Debug info from gdb:

ptrace: Operation not permitted.
No threads.

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Aborted (core dumped)
This task depends upon

Closed by  Isenmann Daniel (ise)
Sunday, 27 March 2016, 18:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in newest version, thanks for the help.
Comment by Thomas Weidner (thomas001le) - Friday, 09 October 2015, 08:31 GMT
Additional note: This does not seem to be a bug in mono, people at #mono testet the example without problems.
Comment by Isenmann Daniel (ise) - Friday, 09 October 2015, 09:44 GMT
Will have a deeper look into that the next few days.
Comment by Thomas Weidner (thomas001le) - Saturday, 09 January 2016, 00:01 GMT
Are there any news on the issue? I still have this problem with mono 4.2.2.10-1.
Comment by Isenmann Daniel (ise) - Thursday, 21 January 2016, 10:42 GMT
Sorry for the delay. No news so far. At the moment I have no clue why this happen
Comment by Isenmann Daniel (ise) - Wednesday, 27 January 2016, 20:46 GMT
The newest mono release still have this issue. Have to clarify this with the mono developers upstream.
Comment by Alister Hood (Alister) - Saturday, 06 February 2016, 10:12 GMT
FWIW if I downgrade all the way to 2.10.8-2 then I don't have this problem - not sure if there's anything different about how mono was packaged back then, other than that it includes static libraries.
Comment by Isenmann Daniel (ise) - Monday, 08 February 2016, 12:31 GMT
Thanks for the hint, Alister. You're right, I have disabled the static build two or three releases before because of build failure. I will test it again with static builds, maybe this helps. Will try it tonight.
Comment by Darek (blablo) - Tuesday, 01 March 2016, 16:15 GMT
Maybe it will help
ChangeLog:
- './configure' cleanup
- '!makeflags' removed (mono build finished successfully on x86_64)
- md5sums -> sha256sums
- pkgbuild cleanup
- update pkgver=4.3.2.467

TEST:
$ dmcs Hello.cs

$ mkbundle Hello.exe
OS is: Linux
Sources: 1 Auto-dependencies: False
embedding: /home/darek/tmp/Hello.exe
AS = as (default)
[execute cmd]: as -o temp.o temp.s
Compiling:
CC = cc (default)
[execute cmd]: cc -ggdb -o a.out -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o
Done

$ ./a.out
Hello, World!

$ mono Hello.exe
Hello, World!

Loading...