Bug 2717 - [Linux PowerPC] Executable binaries, produced with mkbundle, crash on launch
Summary: [Linux PowerPC] Executable binaries, produced with mkbundle, crash on launch
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-02 21:05 UTC by Douglas Mencken
Modified: 2012-01-28 12:01 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
output, which is generated on launch of binary produced by mkbundle (256.72 KB, text/x-log)
2012-01-02 21:05 UTC, Douglas Mencken
Details


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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Douglas Mencken 2012-01-02 21:05:49 UTC
Created attachment 1117 [details]
output, which is generated on launch of binary produced by mkbundle

* What am I trying to do

I'm trying to get runnable native binary with mkbundle:

----------------------------------------
$ mkbundle -o Sysinfo Sysinfo.exe --deps
OS is: Linux
Sources: 1 Auto-dependencies: True
   embedding: /home/username/Development/sysinfo-development/sysinfo-0.7/Sysinfo/Sysinfo.exe
   embedding: /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll
 config from: /usr/lib/mono/gac/gtk-sharp/2.12.0.0__35e10195dab3c99f/gtk-sharp.dll.config
   embedding: /usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll
 config from: /usr/lib/mono/gac/glib-sharp/2.12.0.0__35e10195dab3c99f/glib-sharp.dll.config
   embedding: /usr/lib/mono/4.5/mscorlib.dll
   embedding: /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
   embedding: /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
   embedding: /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
   embedding: /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
   embedding: /usr/lib/mono/gac/System.Security/4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
   embedding: /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll
 config from: /usr/lib/mono/gac/gdk-sharp/2.12.0.0__35e10195dab3c99f/gdk-sharp.dll.config
   embedding: /usr/lib/mono/gac/Mono.Cairo/4.0.0.0__0738eb9f132ed756/Mono.Cairo.dll
   embedding: /usr/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll
 config from: /usr/lib/mono/gac/pango-sharp/2.12.0.0__35e10195dab3c99f/pango-sharp.dll.config
   embedding: /usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll
 config from: /usr/lib/mono/gac/atk-sharp/2.12.0.0__35e10195dab3c99f/atk-sharp.dll.config
   embedding: /usr/lib/mono/gac/gconf-sharp/2.24.0.0__35e10195dab3c99f/gconf-sharp.dll
 config from: /usr/lib/mono/gac/gconf-sharp/2.24.0.0__35e10195dab3c99f/gconf-sharp.dll.config
   embedding: /usr/lib/mono/gac/glade-sharp/2.12.0.0__35e10195dab3c99f/glade-sharp.dll
 config from: /usr/lib/mono/gac/glade-sharp/2.12.0.0__35e10195dab3c99f/glade-sharp.dll.config
Compiling:
as -o temp.o temp.s 
cc -ggdb -o Sysinfo -Wall temp.c `pkg-config --cflags --libs mono-2`  temp.o
temp.c: In function ‘install_dll_config_files’:
temp.c:66:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
temp.c:68:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
temp.c:70:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
temp.c:72:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
temp.c:74:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
temp.c:76:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
temp.c:78:2: warning: pointer targets in passing argument 2 of ‘mono_register_config_for_assembly’ differ in signedness [-Wpointer-sign]
/usr/lib/pkgconfig/../../include/mono-2.0/mono/metadata/assembly.h:101:15: note: expected ‘const char *’ but argument is of type ‘const unsigned char *’
Done
----------------------------------------

* What I got

The produced binary crashes at launch. The output is attached.

* Other information

My version of mono is mono-v2.1-git-24cc0ed, built from current git master.

$ mono --version
Mono JIT compiler version 2.11 (tarball Mon Jan  2 18:36:43 EST 2012)

With `mono' interpreter, .exe bytecode runs well.
Comment 1 Zoltan Varga 2012-01-04 07:40:25 UTC
Please attach the full mono --version output.
Comment 2 Douglas Mencken 2012-01-04 15:29:51 UTC
> Please attach the full mono --version output.

Here it is:

$ mono --version
Mono JIT compiler version 2.11 (tarball Mon Jan  2 18:36:43 EST 2012)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  ppc
        Disabled:      none
        Misc:          softdebug
        GC:            Included Boehm (with typed GC and Parallel Mark)
Comment 3 Zoltan Varga 2012-01-04 18:20:42 UTC
Try configuring mono with --tls=pthread
Comment 4 Douglas Mencken 2012-01-04 18:46:04 UTC
OK, building with thread local storage as in posix threads (--with-tls=pthread):

        mcs source:    mcs
        olive source:

   Engine:
        GC:            sgen and bundled Boehm GC with typed GC and parallel mark
        TLS:           pthread
        SIGALTSTACK:   yes
        Engine:        Building and using the JIT
        oprofile:      no
        BigArrays:     no
        DTrace:        no
        Parallel Mark: yes
        LLVM Back End: no (dynamically loaded: no)

    Libraries:
        Moon Profile:  no (boehm)
        MonoDroid:     no
        MonoTouch:     no
        Mobile:        no
        JNI support:   IKVM Native
        libgdiplus:    assumed to be installed
        zlib:          system zlib
Comment 5 Douglas Mencken 2012-01-05 07:44:33 UTC
Cannot build it with --with-tls=pthread.


make all-local
make[8]: Entering directory `/home/username/Development/mono/mono-master-branch/mcs/class/corlib'
MCS     [build] mscorlib.dll
Stacktrace:

  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>

(it is repeated for infinity)
Comment 6 Zoltan Varga 2012-01-05 10:06:06 UTC
Thats strange, that should work on all platforms.
Comment 7 Douglas Mencken 2012-01-06 16:55:37 UTC
Maybe it "should". But it doesn't. Maybe `make V=1' would be more informative for the team.

make[8]: Entering directory `/home/username/Development/mono/mono-master-branch/mcs/class/corlib'
/bin/sh ./../../mkinstalldirs ../../class/lib/build/tmp/
mkdir -p -- ../../class/lib/build/tmp/
touch ../../class/lib/build/tmp//.stamp
/bin/sh ./../../mkinstalldirs ../../class/lib/build/
MONO_PATH="./../../class/lib/basic:$MONO_PATH" /home/username/Development/mono/mono-master-branch/runtime/mono-wrapper  ./../../class/lib/basic/basic.exe /codepage:65001 -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC -optimize -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:./../../class/lib/build  -debug /noconfig -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 -target:library -out:../../class/lib/build/tmp/mscorlib.dll  @corlib.dll.sources
touch ../../class/lib/build//.stamp
Could not allocate 8192 bytes
Stacktrace:

  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
>>>>>>>>>>> ....
>>>>>>>>>>> a lot of the same lines are omitted (about 600000 lines)
>>>>>>>>>>> ....
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.TypeInitializationException..ctor (string,System.Exception) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at System.Environment.GetEnvironmentVariable (string) <0x00020>
  at Mono.CSharp.Driver.Main (string[]) <0x00034>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

^^^ (yep, that's an end of output of make; it looks like it just hangs here)
Comment 8 Zoltan Varga 2012-01-28 12:01:12 UTC
Fixed in HEAD/2.10 by 94b662ddb625eb1998c807af09ff82908d3eb.