Bug 40778 - AOT compiler crashes with C# with all Optimizations activated (-O=all)
Summary: AOT compiler crashes with C# with all Optimizations activated (-O=all)
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 4.2.0 (C6)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-29 13:07 UTC by alexandernaumann
Modified: 2016-05-09 07:54 UTC (History)
3 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 40778 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 alexandernaumann 2016-04-29 13:07:56 UTC
On Jessie with mono 4.2.3.4:

localhost:~# mono-sgen --aot -O=all <Program>
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
Mono Ahead of Time compiler - compiling assembly <Program>
* Assertion at mini-x86.c:3167, condition `ins->dreg == MONO_ARCH_GOT_REG' not met



no Ahead of Time compiler - compiling assembly <Program>
* Assertion at mini-x86.c:3167, condition `ins->dreg == MONO_ARCH_GOT_REG' not met

Stacktrace:


Native stacktrace:

	mono() [0x80eec33]
	linux-gate.so.1(__kernel_rt_sigreturn+0) [0xf76f7420]
	linux-gate.so.1(__kernel_vsyscall+0x10) [0xf76f7440]
	/lib/i386-linux-gnu/i686/cmov/libc.so.6(gsignal+0x47) [0xf74fe367]
	/lib/i386-linux-gnu/i686/cmov/libc.so.6(abort+0x143) [0xf74ffa23]
	mono() [0x827d2f1]
	mono() [0x827d478]
	mono() [0x827d503]
	mono() [0x8137c13]
	mono() [0x81418b6]
	mono() [0x8143dd3]
	mono() [0x80d4a0b]
	mono() [0x80d632e]
	mono(mono_main+0x118a) [0x80c28ca]
	mono() [0x8065da2]
	/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf3) [0xf74e9a63]
	mono() [0x8065f5d]

Debug info from gdb:


warning: Can not parse XML syscalls information; XML support was disabled at compile time.
Error while mapping shared library sections:
linux-gate.so.1: No such file or directory.
[Thread debugging using libthread_db enabled]
[New Thread 0xf5a2bb40 (LWP 24797)]
[New Thread 0xf6fffb40 (LWP 24796)]
0xf76f7440 in __kernel_vsyscall ()
  3 Thread 0xf6fffb40 (LWP 24796)  0xf76f7440 in __kernel_vsyscall ()
  2 Thread 0xf5a2bb40 (LWP 24797)  0xf76f7440 in __kernel_vsyscall ()
* 1 Thread 0xf74ce700 (LWP 24795)  0xf76f7440 in __kernel_vsyscall ()

Thread 3 (Thread 0xf6fffb40 (LWP 24796)):
#0  0xf76f7440 in __kernel_vsyscall ()
#1  0xf7687c4b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#2  0x08247a40 in ?? ()
#3  0xf7683efb in start_thread () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#4  0xf75bbede in clone () from /lib/i386-linux-gnu/i686/cmov/libc.so.6

Thread 2 (Thread 0xf5a2bb40 (LWP 24797)):
#0  0xf76f7440 in __kernel_vsyscall ()
#1  0xf7689df5 in sem_wait@@GLIBC_2.1 () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#2  0x0826f2e8 in mono_sem_wait ()
#3  0x081eeac4 in ?? ()
#4  0x081cfb31 in ?? ()
#5  0x08275f31 in ?? ()
#6  0xf7683efb in start_thread () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#7  0xf75bbede in clone () from /lib/i386-linux-gnu/i686/cmov/libc.so.6

Thread 1 (Thread 0xf74ce700 (LWP 24795)):
#0  0xf76f7440 in __kernel_vsyscall ()
#1  0xf768b80b in waitpid () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
#2  0x080eecda in ?? ()
#3  <signal handler called>
#4  0xf76f7440 in __kernel_vsyscall ()
#5  0xf74fe367 in raise () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#6  0xf74ffa23 in abort () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#7  0x0827d2f1 in ?? ()
#8  0x0827d478 in ?? ()
#9  0x0827d503 in ?? ()
#10 0x08137c13 in ?? ()
#11 0x081418b6 in ?? ()
#12 0x08143dd3 in ?? ()
#13 0x080d4a0b in ?? ()
#14 0x080d632e in ?? ()
#15 0x080c28ca in mono_main ()
#16 0x08065da2 in ?? ()
#17 0xf74e9a63 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
#18 0x08065f5d in _start ()

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



On another build environment:

localhost:~# mono --aot -O=all <Program>
Mono Ahead of Time compiler - compiling assembly <Program>
* Assertion at mini-x86.c:3167, condition `ins->dreg == MONO_ARCH_GOT_REG' not met

Stacktrace:


Native stacktrace:

	mono() [0x80eec33]
	linux-gate.so.1(__kernel_rt_sigreturn+0) [0xf7796420]
	/lib/i386-linux-gnu/libc.so.6(gsignal+0x3c) [0xf75dae2c]
	/lib/i386-linux-gnu/libc.so.6(abort+0x143) [0xf75dc4b3]
	mono() [0x827d2f1]
	mono() [0x827d478]
	mono() [0x827d503]
	mono() [0x8137c13]
	mono() [0x81418b6]
	mono() [0x8143dd3]
	mono() [0x80d4a0b]
	mono() [0x80d632e]
	mono(mono_main+0x118a) [0x80c28ca]
	mono() [0x8065da2]
	/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0xf75c6723]
	mono() [0x8065f5d]

Debug info from gdb:


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


localhost:~# dpkg -l mono-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                         Version                             Architecture                        Description
+++-============================================================-===================================-===================================-==============================================================================================================================
ii  mono-4.0-gac                                                 4.2.3.4-0xamarin2                   all                                 Mono GAC tool (for CLI 4.0)
ii  mono-gac                                                     4.2.3.4-0xamarin2                   all                                 Mono GAC tool
ii  mono-runtime                                                 4.2.3.4-0xamarin2                   i386                                Mono runtime - default version
ii  mono-runtime-common                                          4.2.3.4-0xamarin2                   i386                                Mono runtime - common files
ii  mono-runtime-sgen                                            4.2.3.4-0xamarin2                   i386                                Mono runtime - SGen


localhost:~# dpkg -l libmono-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                         Version                             Architecture                        Description
+++-============================================================-===================================-===================================-==============================================================================================================================
ii  libmono-corlib4.5-cil                                        4.2.3.4-0xamarin2                   all                                 Mono core library (for CLI 4.5)
ii  libmono-data-tds4.0-cil                                      4.2.3.4-0xamarin2                   all                                 Mono Data Library (for CLI 4.0)
ii  libmono-i18n-cjk4.0-cil                                      4.2.3.4-0xamarin2                   all                                 Mono I18N.CJK library (for CLI 4.0)
ii  libmono-i18n-mideast4.0-cil                                  4.2.3.4-0xamarin2                   all                                 Mono I18N.MidEast library (for CLI 4.0)
ii  libmono-i18n-other4.0-cil                                    4.2.3.4-0xamarin2                   all                                 Mono I18N.Other library (for CLI 4.0)
ii  libmono-i18n-rare4.0-cil                                     4.2.3.4-0xamarin2                   all                                 Mono I18N.Rare library (for CLI 4.0)
ii  libmono-i18n-west4.0-cil                                     4.2.3.4-0xamarin2                   all                                 Mono I18N.West library (for CLI 4.0)
ii  libmono-i18n4.0-all                                          4.2.3.4-0xamarin2                   all                                 Mono I18N libraries (for CLI 4.0)
ii  libmono-i18n4.0-cil                                          4.2.3.4-0xamarin2                   all                                 Mono I18N base library (for CLI 4.0)
ii  libmono-ldap4.0-cil                                          4.2.3.4-0xamarin2                   all                                 Mono LDAP library (for CLI 4.0)
ii  libmono-posix4.0-cil                                         4.2.3.4-0xamarin2                   all                                 Mono.Posix library (for CLI 4.0)
ii  libmono-security4.0-cil                                      4.2.3.4-0xamarin2                   all                                 Mono Security library (for CLI 4.0)
ii  libmono-system-configuration4.0-cil                          4.2.3.4-0xamarin2                   all                                 Mono System.Configuration library (for CLI 4.0)
ii  libmono-system-core4.0-cil                                   4.2.3.4-0xamarin2                   all                                 Mono System.Core library (for CLI 4.0)
ii  libmono-system-data4.0-cil                                   4.2.3.4-0xamarin2                   all                                 Mono System.Data library (for CLI 4.0)
ii  libmono-system-enterpriseservices4.0-cil                     4.2.3.4-0xamarin2                   all                                 Mono System.EnterpriseServices library (for CLI 4.0)
ii  libmono-system-numerics4.0-cil                               4.2.3.4-0xamarin2                   all                                 Mono System.Numerics library (for CLI 4.0)
ii  libmono-system-security4.0-cil                               4.2.3.4-0xamarin2                   all                                 Mono System.Security library (for CLI 4.0)
ii  libmono-system-transactions4.0-cil                           4.2.3.4-0xamarin2                   all                                 Mono System.Transactions library (for CLI 4.0)
ii  libmono-system-xml4.0-cil                                    4.2.3.4-0xamarin2                   all                                 Mono System.Xml library (for CLI 4.0)
ii  libmono-system4.0-cil                                        4.2.3.4-0xamarin2                   all                                 Mono System libraries (for CLI 4.0)


ii  libc6:i386                                                   2.19-18+deb8u4                      i386                                GNU C Library: Shared libraries