[Mono-list] Mono crashes on PowerPC (cross compiled)

PRINGLE Chris chris.pringle at miranda.com
Fri Feb 4 07:21:16 EST 2011


Hello All,

I'm trying to get Mono to work on a PowerPC with an e500v2 core. I have a fully (custom) cross compiled distribution working without any issues, however I am unable to get Mono to work properly.

I cross compiled mono with the following command:
./configure --host=${TOOLCHAIN_NAME} --with-tls=pthread --with-sigaltstack=no --disable-mcs-build --prefix=/mono --with-pic --with-glib=embedded mono_cv_uscore=no 

The flags are pretty standard for cross compiling (nostdinc, include dirs, lib dirs etc); the only additional option I had to add was:
"-D__ppc__ -Xcompiler -regnames". This prevents it winging about not having some architecture specific defines set up, and also stops it from moaning about not being able to use the r1 register. 


Mono compiles fine, and it appears to run okay at first glance:
# mono -V 
Mono JIT compiler version 2.8.2 (tarball Thu Feb  3 13:51:40 GMT 2011)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
     TLS:           normal
     SIGSEGV:       normal
     Notifications: epoll
     Architecture:  ppc
     Disabled:      none
     Misc:          softdebug 
     GC:            Included Boehm (with typed GC and Parallel Mark)

However, if you attempt to execute anything (even if it doesn't exist) you get:

# mono someexe.exe   
Cannot open assembly 'someexe.exe': No such file or directory.
Segmentation fault

With more detail, we get:
# mono -v someexe.exe 
converting method System.OutOfMemoryException:.ctor (string)
Method System.OutOfMemoryException:.ctor (string) emitted at 0x48b04b68 to 0x48b04bb4 (code length 76) [someexe.exe]
converting method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr) emitted at 0x48b04bd0 to 0x48b04cd0 (code length 256) [someexe.exe]
converting method System.SystemException:.ctor (string)
Method System.SystemException:.ctor (string) emitted at 0x48b04cd0 to 0x48b04d1c (code length 76) [someexe.exe]
converting method System.Exception:.ctor (string)
Method System.Exception:.ctor (string) emitted at 0x48b04d28 to 0x48b04d64 (code length 60) [someexe.exe]
converting method System.NullReferenceException:.ctor (string)
Method System.NullReferenceException:.ctor (string) emitted at 0x48b04d68 to 0x48b04db4 (code length 76) [someexe.exe]
converting method System.StackOverflowException:.Cannot open assembly 'someexe.exe': No such file or directory.
ctor (string)
Method System.StackOverflowException:.ctor (string) emitted at 0x48b04db8 to 0x48b04df4 (code length 60) [someexe.exe]
converting method (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) emitted at 0x48b04df8 to 0x48b04ef8 (code length 256) [someexe.exe]
converting method System.Threading.Thread:.cctor ()
Method System.Threading.Thread:.cctor () emitted at 0x48b04f08 to 0x48b04f74 (code length 108) [someexe.exe]
converting method (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) emitted at 0x48b04f78 to 0x48b05060 (code length 232) [someexe.exe]
converting method (wrapper managed-to-native) object:__icall_wrapper_mono_object_new_ptrfree (intptr)
Method (wrapper managed-to-native) object:__icall_wrapper_mono_object_new_ptrfree (intptr) emitted at 0x48b05070 to 0x48b051b8 (code length 328) [someexe.exe]
converting method System.NullReferenceException:.ctor ()
Method System.NullReferenceException:.ctor () emitted at 0x48b051b8 to 0x48b05204 (code length 76) [someexe.exe]
converting method (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) emitted at 0x48b05208 to 0x48b052f8 (code length 240) [someexe.exe]
converting method System.TypeInitializationException:.ctor (string,System.Exception)
Method System.TypeInitializationException:.ctor (string,System.Exception) emitted at 0x48b052f8 to 0x48b05364 (code length 108) [someexe.exe]
converting method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object_object (object,intptr,intptr,intptr)
Method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object_object (object,intptr,intptr,intptr) emitted at 0x48b05380 to 0x48b05490 (code length 272) [someexe.exe]
converting method string:Concat (string,string)
converting method string:.cctor ()
Method string:.cctor () emitted at 0x48b054a0 to 0x48b05550 (code length 176) [someexe.exe]
converting method (wrapper managed-to-native) string:GetLOSLimit ()
Method (wrapper managed-to-native) string:GetLOSLimit () emitted at 0x48b05568 to 0x48b056a8 (code length 320) [someexe.exe]
converting method string:Concat (string,string)
converting method string:Concat (string,string)

// SNIP - THIS CONTINUES SEVERAL HUNDRED TIMES!

converting method string:Concat (string,string)
converting method string:Concat (str
Segmentation fault

I have tried playing with the configure options but am getting nowhere. GDB and strace don't provide much useful information (ignoring SIGPWR etc). It looks like the stack is overflowing (which is consistent with the repeated messages of "converting method string:Concat (string,string)". If I enable sigaltstack, it doesn't segfault, but does show a stack overflow.

What I cannot work out, is whether this is a side effect of running mono under PowerPC, or whether it's related to the cross compile. I have no native compilers for my target, and a native compiler is going to be a pain to generate. Does anyone have any ideas as to what might be going wrong? Any suggestions as to configuration options to change, or compiler options maybe?

Any help would be much appreciated!

Regards,
Chris Pringle

____________________________

Miranda Technologies Limited
Registered in England and Wales CN 02017053
Registered Office: James House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1FJ



More information about the Mono-list mailing list