Bug 28857

Summary: Nursery-canaries and AOT causes assertion failure
Product: [Mono] Runtime Reporter: Alexander Kyte <alexander.kyte>
Component: GCAssignee: Bugzilla <bugzilla>
Status: RESOLVED FEATURE    
Severity: normal CC: mark, mono-bugs+mono, mono-bugs+runtime
Priority: ---    
Version: 3.12.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Folder with .cs, .exe, and .dylib.dSYM seeing a crash

Description Alexander Kyte 2015-04-07 13:51:26 UTC
Created attachment 10660 [details]
Folder with .cs, .exe, and .dylib.dSYM seeing a crash

Reproduction:

1) Take any .exe, Foo.exe in this example
2) run mono --aot Foo.exe
3) MONO_GC_DEBUG='nursery-canaries' mono Foo.exe

Example stacktrace:

* Assertion at aot-runtime.c:863, condition `ref->method' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at Program.Main (string[]) <0x00031>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	0   mono                                0x00000001010e1dca mono_handle_native_sigsegv + 282
	1   libsystem_platform.dylib            0x00007fff97f00f1a _sigtramp + 26
	2   ???                                 0x00007fff5ebc77a0 0x0 + 140734782797728
	3   libsystem_c.dylib                   0x00007fff9664cb53 abort + 129
	4   mono                                0x0000000101283b9d monoeg_log_default_handler + 125
	5   mono                                0x0000000101283d60 monoeg_assertion_message + 192
	6   mono                                0x00000001010d629b decode_method_ref_with_target + 7147
	7   mono                                0x00000001010d01da decode_patch + 90
	8   mono                                0x00000001010d0053 mono_aot_plt_resolve + 211
	9   mono                                0x00000001010e3c05 mono_aot_plt_trampoline + 37
	10  ???                                 0x00000001014e8fb2 0x0 + 4316893106
	11  Test.exe.dylib                      0x00000001016a7ac2 Program_Main_string__ + 50
	12  mono                                0x0000000101044209 mono_jit_runtime_invoke + 1641
	13  mono                                0x00000001011f8a5e mono_runtime_invoke + 110
	14  mono                                0x00000001011fe33b mono_runtime_exec_main + 379
	15  mono                                0x00000001010b1fe0 mono_main + 7808
	16  libdyld.dylib                       0x00007fff99d0a5c9 start + 1

Debug info from gdb:

[New Thread 0x1103 of process 14052]
[New Thread 0x1203 of process 14052]
^C

warning: Could not open OSO archive file "/BinaryCache/corecrypto/corecrypto-233.1.2~26/Symbols/BuiltProducts/libcorecrypto_static.a"
warning: `/BinaryCache/coreTLS/coreTLS-35.1.2~2/Objects/coretls.build/coretls.build/Objects-normal/x86_64/system_coretls_vers.o': can't open to read symbols: No such file or directory.
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_ciphersuites.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_handshake.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_record.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.1.2~2/Symbols/BuiltProducts/libcoretls_stream_parser.a"
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bdz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bdz_ph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bmz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bmz8.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/brz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/buffer_entry.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/buffer_manager.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chd.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chd_ph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chm.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/cmph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/cmph_structs.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/compressed_rank.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/compressed_seq.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/fch.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/fch_buckets.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/graph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/hash.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/jenkins_hash.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/linear_string_map.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/miller_rabin.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/select.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/vqueue.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/vstack.o': can't open to read symbols: No such file or directory.
warning: `/var/folders/9n/mdh_qr_11ql3r03sxtd91yz80000gn/T/mono_aot_HchGqg.o': can't open to read symbols: No such file or directory.
0x00007fff92bf4902 in __wait4 () from /usr/lib/system/libsystem_kernel.dylib
  Id   Target Id         Frame
  3    Thread 0x1203 of process 14052 0x00007fff92bf5232 in kevent64 () from /usr/lib/system/libsystem_kernel.dylib
  2    Thread 0x1103 of process 14052 0x00007fff92bef51a in semaphore_wait_trap () from /usr/lib/system/libsystem_kernel.dylib
* 1    Thread 0x1003 of process 14052 0x00007fff92bf4902 in __wait4 () from /usr/lib/system/libsystem_kernel.dylib

Thread 3 (Thread 0x1203 of process 14052):
#0  0x00007fff92bf5232 in kevent64 () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff9439cd91 in ?? () from /usr/lib/system/libdispatch.dylib
#2  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x1103 of process 14052):
#0  0x00007fff92bef51a in semaphore_wait_trap () from /usr/lib/system/libsystem_kernel.dylib
#1  0x0000000101275db7 in mono_sem_wait (sem=<optimized out>, alertable=<optimized out>, sem=<optimized out>, alertable=<optimized out>) at mono-semaphore.c:103
#2  0x00000001011f69e2 in finalizer_thread (unused=<optimized out>) at gc.c:1093
#3  0x00000001011cff5b in start_wrapper_internal (data=<optimized out>) at threads.c:664
#4  start_wrapper (data=<optimized out>) at threads.c:711
#5  0x000000010127d49e in inner_start_thread (arg=<optimized out>) at mono-threads-posix.c:96
#6  0x00007fff8ab2c268 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib
#7  0x00007fff8ab2c1e5 in _pthread_start () from /usr/lib/system/libsystem_pthread.dylib
#8  0x00007fff8ab2a41d in thread_start () from /usr/lib/system/libsystem_pthread.dylib
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x1003 of process 14052):
#0  0x00007fff92bf4902 in __wait4 () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00000001010e1e61 in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>, info=<optimized out>) at mini-exceptions.c:2364
Backtrace stopped: Cannot access memory at address 0x3715
Comment 1 Mark Probst 2015-04-08 17:24:49 UTC
Canaries aren't supported with AOT.  AOT requires a managed allocator, and canaries aren't implemented in the managed allocator, so it's disabled.

Now exits with an error in b7ca3af3da8cb83478554b880c7984e45d12b2b8.