-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
dotnet/runtime
#33201Labels
Description
Steps to Reproduce
- Build mono with AOT: ./autogen.sh --enable-llvm && make -j4
- Set the following two environment variables:
export MONO_PATH=/mono/mcs/class/lib/net_4_x-linux
export PATH=/mono/llvm/usr/bin:$PATH - AOT mono with llvm: ./mono/mini/mono --aot=llvm mcs/class/lib/xbuild_14/Mono.XBuild.Tasks.dll
Current Behavior
Crashing
Expected Behavior
AOT mono with llvm successfully
On which platforms did you notice this
[ ] macOS
[x] Linux
[ ] Windows
Version Used:
mono master
Stacktrace
Mono Ahead of Time compiler - compiling assembly /home/yangfan/fanyang/mono_latest/mono/mcs/class/lib/xbuild_14/Mono.XBuild.Tasks.dll
AOTID F8A7BE9D-6F38-A94D-5AE1-798ED7EC3831
mono_method_full_name [0x558d59476e50] Cannot enter GC unsafe region on a different thread
--------------------------------
Native Crash Reporting
--------------------------------
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.
----------------------------
Native stacktrace:
----------------------------
0x558d56e82e79 - ./mono/mini/mono :
0x558d56e831f9 - ./mono/mini/mono :
0x558d56e0b549 - ./mono/mini/mono :
0x558d56e8242f - ./mono/mini/mono :
0x7ff4b5efe890 - /lib/x86_64-linux-gnu/libpthread.so.0 :
0x7ff4b51fae97 - /lib/x86_64-linux-gnu/libc.so.6 : gsignal
0x7ff4b51fc801 - /lib/x86_64-linux-gnu/libc.so.6 : abort
0x558d570f0307 - ./mono/mini/mono :
0x558d570d3313 - ./mono/mini/mono :
0x558d570f0288 - ./mono/mini/mono :
0x558d570f06c9 - ./mono/mini/mono : monoeg_g_logv
0x558d570f076f - ./mono/mini/mono : monoeg_g_log
0x558d570e5ed7 - ./mono/mini/mono :
0x558d570e6448 - ./mono/mini/mono :
0x558d56f8433b - ./mono/mini/mono : mono_method_full_name
0x558d56de9d85 - ./mono/mini/mono :
0x558d56e476a8 - ./mono/mini/mono :
0x558d56e89ba8 - ./mono/mini/mono :
0x558d56df7ae7 - ./mono/mini/mono :
0x558d56dfa41e - ./mono/mini/mono :
0x558d56ddf9c7 - ./mono/mini/mono : mono_main
0x558d56d9632c - ./mono/mini/mono :
0x7ff4b51ddb97 - /lib/x86_64-linux-gnu/libc.so.6 : __libc_start_main
0x558d56dcf50a - ./mono/mini/mono : _start
----------------------------
Telemetry Dumper:
----------------------------
No threads attached to runtime.
-----------------------------------
External Debugger Dump:
-----------------------------------
[New LWP 43071]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007ff4b5efe23a in __waitpid (pid=pid@entry=43074, stat_loc=stat_loc@entry=0x7fffdaac8954, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
30 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
Id Target Id Frame
* 1 Thread 0x7ff4b6b70780 (LWP 43070) "mono" 0x00007ff4b5efe23a in __waitpid (pid=pid@entry=43074, stat_loc=stat_loc@entry=0x7fffdaac8954, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2 Thread 0x7ff4b4bff700 (LWP 43071) "SGen worker" 0x00007ff4b5ef99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x558d58c28028 <work_cond+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
Thread 2 (Thread 0x7ff4b4bff700 (LWP 43071)):
#0 0x00007ff4b5ef99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x558d58c28028 <work_cond+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x558d58c28040 <lock>, cond=0x558d58c28000 <work_cond>) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=cond@entry=0x558d58c28000 <work_cond>, mutex=mutex@entry=0x558d58c28040 <lock>) at pthread_cond_wait.c:655
#3 0x0000558d570cb17a in mono_os_cond_wait (mutex=0x558d58c28040 <lock>, cond=0x558d58c28000 <work_cond>) at ../../mono/utils/mono-os-mutex.h:219
#4 get_work (job=<synthetic pointer>, do_idle=<synthetic pointer>, work_context=<synthetic pointer>, worker_index=0) at sgen-thread-pool.c:165
#5 thread_func (data=<optimized out>) at sgen-thread-pool.c:196
#6 0x00007ff4b5ef36db in start_thread (arg=0x7ff4b4bff700) at pthread_create.c:463
#7 0x00007ff4b52dd88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 1 (Thread 0x7ff4b6b70780 (LWP 43070)):
#0 0x00007ff4b5efe23a in __waitpid (pid=pid@entry=43074, stat_loc=stat_loc@entry=0x7fffdaac8954, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1 0x0000558d56e830d2 in dump_native_stacktrace (signal=signal@entry=0x558d5823ebe5 "SIGABRT", mctx=mctx@entry=0x7fffdaac94c0) at mini-posix.c:1112
#2 0x0000558d56e831f9 in mono_dump_native_crash_info (signal=signal@entry=0x558d5823ebe5 "SIGABRT", mctx=mctx@entry=0x7fffdaac94c0, info=info@entry=0x7fffdaac97b0) at mini-posix.c:1156
#3 0x0000558d56e0b549 in mono_handle_native_crash (signal=0x558d5823ebe5 "SIGABRT", mctx=mctx@entry=0x7fffdaac94c0, info=info@entry=0x7fffdaac97b0) at mini-exceptions.c:3427
#4 0x0000558d56e8242f in sigabrt_signal_handler (_dummy=<optimized out>, _info=0x7fffdaac97b0, context=0x7fffdaac9680) at mini-posix.c:234
#5 <signal handler called>
#6 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#7 0x00007ff4b51fc801 in __GI_abort () at abort.c:79
#8 0x0000558d570f0307 in monoeg_assert_abort () at goutput.c:57
#9 0x0000558d570d3313 in mono_log_write_logfile (log_domain=<optimized out>, level=<optimized out>, hdr=<optimized out>, message=0x558d59476720 "mono_method_full_name [0x558d59476e50] Cannot enter GC unsafe region on a different thread") at mono-log-common.c:136
#10 0x0000558d570f0288 in monoeg_g_logstr (msg=<optimized out>, log_level=G_LOG_LEVEL_ERROR, log_domain=0x0) at goutput.c:151
#11 monoeg_g_logv_nofree (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7fffdaaca6d0) at goutput.c:166
#12 0x0000558d570f06c9 in monoeg_g_logv (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>, args=args@entry=0x7fffdaaca6d0) at goutput.c:173
#13 0x0000558d570f076f in monoeg_g_log (log_domain=log_domain@entry=0x0, log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x558d582ec3c8 "%s [%p] Cannot %s GC %s region on a different thread") at goutput.c:182
#14 0x0000558d570e5ed7 in check_info (info=0x558d59476810, action=0x558d5861fc7f "enter", state=0x558d585fc2d4 "unsafe", func=0x558d58263140 <__func__.20114> "mono_method_full_name") at mono-threads-coop.c:101
#15 0x0000558d570e6448 in mono_threads_enter_gc_unsafe_region_unbalanced_with_info (info=0x558d59476810, stackdata=0x7fffdaaca810) at mono-threads-coop.c:476
#16 0x0000558d56f8433b in mono_method_full_name (method=method@entry=0x558d594438f8, signature=signature@entry=1) at debug-helpers.c:976
#17 0x0000558d56de9d85 in get_debug_sym (method=0x558d594438f8, prefix=prefix@entry=0x558d586223ff "", cache=0x558d59434770) at aot-compiler.c:6386
#18 0x0000558d56ded865 in mono_aot_get_method_name (cfg=cfg@entry=0x558d59476810) at aot-compiler.c:9082
#19 0x0000558d56e476a8 in mono_llvm_emit_method (cfg=cfg@entry=0x558d59476810) at mini-llvm.c:8426
#20 0x0000558d56e89ba8 in mini_method_compile (method=method@entry=0x558d594438f8, opts=<optimized out>, domain=<optimized out>, flags=flags@entry=(JIT_FLAG_AOT | JIT_FLAG_LLVM), parts=parts@entry=0, aot_method_index=aot_method_index@entry=0) at mini.c:3839
#21 0x0000558d56df7ae7 in compile_method (acfg=acfg@entry=0x558d59436cb0, method=0x558d594438f8) at aot-compiler.c:8697
#22 0x0000558d56dfa41e in compile_method (method=<optimized out>, acfg=0x558d59436cb0) at aot-compiler.c:12148
#23 compile_methods (acfg=0x558d59436cb0) at aot-compiler.c:12148
#24 mono_compile_assembly (ass=ass@entry=0x558d59434310, opts=opts@entry=374434303, aot_options=aot_options@entry=0x558d593f3760 "llvm", global_aot_state=global_aot_state@entry=0x7fffdaacad50) at aot-compiler.c:13887
#25 0x0000558d56ddf9c7 in main_thread_handler (user_data=<synthetic pointer>) at driver.c:1446
#26 mono_main (argc=<optimized out>, argv=<optimized out>) at driver.c:2745
#27 0x0000558d56d9632c in mono_main_with_options (argv=<optimized out>, argc=<optimized out>) at main.c:51
#28 main (argc=<optimized out>, argv=<optimized out>) at main.c:339
--------------------------------------
Basic Fault Address Reporting
--------------------------------------
Memory around native instruction pointer (0x7ff4b51fae97):0x7ff4b51fae87 d2 4c 89 ce bf 02 00 00 00 b8 0e 00 00 00 0f 05 .L..............
0x7ff4b51fae97 48 8b 8c 24 08 01 00 00 64 48 33 0c 25 28 00 00 H..$....dH3.%(..
0x7ff4b51faea7 00 44 89 c0 75 1f 48 81 c4 18 01 00 00 c3 0f 1f .D..u.H.........
0x7ff4b51faeb7 00 48 8b 15 a9 bf 3a 00 f7 d8 41 b8 ff ff ff ff .H....:...A.....
Aborted (core dumped)