godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.16k stars 21.19k forks source link

Godot alpha0 Mono release export crashes #32300

Closed cart closed 5 years ago

cart commented 5 years ago

Godot version: official alpha0 mono

OS/device including version: Arch Linux mono version: 6.0.0

Issue description: Exporting release builds (debug unchecked) results in a crash. I reproed this on linux releases and windows releases (via wine).

This happens both on a dead-simple project and my gratuitously complex High Hat game.

Exporting in Debug mode works just fine.

linux log:

carter@beemo ~/R/linux> ./Repro_MonoCrash.x86_64
Godot Engine v3.2.alpha0.mono.official - https://godotengine.org
OpenGL ES 2.0 Renderer: GeForce GTX 1070/PCIe/SSE2

Mono: Logfile is: /home/carter/.local/share/godot/app_userdata/Repro_MonoCrash/mono/mono_logs/2019_09_23 23.54.47 (11098).txt
ERROR: _load_api_assemblies: FATAL: Method/Function Failed.
   At: modules/mono/mono_gd/gd_mono.cpp:805.

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
/proc/self/maps:
00400000-02c1b000 r-xp 00000000 103:06 24904575                          /home/carter/Repro_MonoCrash/linux/Repro_MonoCrash.x86_64
02e1b000-02eba000 r--p 0281b000 103:06 24904575                          /home/carter/Repro_MonoCrash/linux/Repro_MonoCrash.x86_64
02eba000-02ec5000 rw-p 028ba000 103:06 24904575                          /home/carter/Repro_MonoCrash/linux/Repro_MonoCrash.x86_64
02ec5000-02ef4000 rw-p 00000000 00:00 0 
03661000-04b46000 rw-p 00000000 00:00 0                                  [heap]
40057000-40067000 rwxp 00000000 00:00 0 
410c1000-410d1000 rwxp 00000000 00:00 0 
411da000-411dc000 r-xs 00000000 00:2d 307354                             /tmp/.glefJqIc (deleted)
418ec000-418fc000 rwxp 00000000 00:00 0 
41bb8000-41c6b000 rw-p 00000000 00:00 0 
7f4188000000-7f4188021000 rw-p 00000000 00:00 0 
7f4188021000-7f418c000000 ---p 00000000 00:00 0 
7f418c000000-7f418c021000 rw-p 00000000 00:00 0 
7f418c021000-7f4190000000 ---p 00000000 00:00 0 
7f4190000000-7f4190021000 rw-p 00000000 00:00 0 
7f4190021000-7f4194000000 ---p 00000000 00:00 0 
7f4194fa7000-7f41953fe000 rw-p 00000000 00:00 0 
7f4195bff000-7f4196bff000 rw-p 00000000 00:00 0 
7f4196bff000-7f4196c00000 ---p 00000000 00:00 0 
7f4196c00000-7f4197800000 rw-p 00000000 00:00 0 
7f4197a55000-7f4197c55000 rw-s 00000000 00:06 24072                      /dev/nvidiactl
7f4197dfe000-7f4197dff000 ---p 00000000 00:00 0 
7f4197dff000-7f4197e00000 rw-p 00000000 00:00 0 
7f4197e00000-7f4197e08000 ---p 00000000 00:00 0 
7f4197e08000-7f4197fff000 rw-p 00000000 00:00 0 

=================================================================
    Basic Fault Adddress Reporting
=================================================================
Memory around native instruction pointer (0x230aa13):0x230aa03  69 74 3e 00 48 8d 3d 52 b7 41 00 e8 bd 2e 91 fe  it>.H.=R.A......
0x230aa13  0f 0b 90 66 2e 0f 1f 84 00 00 00 00 00 55 53 48  ...f.........USH
0x230aa23  83 ec 08 85 f6 0f 88 52 01 00 00 89 f3 48 8b 37  .......R.....H.7
0x230aa33  48 89 fd c6 05 5b 26 bd 00 00 31 c0 48 85 f6 74  H....[&...1.H..t

=================================================================
    Native stacktrace:
=================================================================
    0x9cc735 - ./Repro_MonoCrash.x86_64 : (null)
    0x9c00c9 - ./Repro_MonoCrash.x86_64 : (null)
    0x9d5068 - ./Repro_MonoCrash.x86_64 : (null)
    0x7f41b94d9d00 - /usr/lib/libpthread.so.0 : (null)
    0x230aa13 - ./Repro_MonoCrash.x86_64 : (null)
    0x20f9402 - ./Repro_MonoCrash.x86_64 : _ZN14CSharpLanguage4initEv
    0xf7b3df - ./Repro_MonoCrash.x86_64 : _ZN12ScriptServer14init_languagesEv
    0x23dddfe - ./Repro_MonoCrash.x86_64 : _ZN4Main6setup2Em
    0x23e24a9 - ./Repro_MonoCrash.x86_64 : _ZN4Main5setupEPKciPPcb
    0x8fd16f - ./Repro_MonoCrash.x86_64 : main
    0x7f41b91d3ee3 - /usr/lib/libc.so.6 : __libc_start_main
    0x8fd45e - ./Repro_MonoCrash.x86_64 : (null)

=================================================================
    Telemetry Dumper:
=================================================================
Pkilling 0x7f4197ffe700 from 0x7f41b7e5d800
Entering thread summarizer pause from 0x7f41b7e5d800
Finished thread summarizer pause from 0x7f41b7e5d800.

Waiting for dumping threads to resume

Debug info from gdb:

=================================================================
    External Debugger Dump:
=================================================================
[New LWP 11099]
[New LWP 11102]
[New LWP 11104]
[New LWP 11106]
[New LWP 11108]
[New LWP 11109]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0x00007f41b94d9636 in waitpid () from /usr/lib/libpthread.so.0
  Id   Target Id                                           Frame 
* 1    Thread 0x7f41b7e5d800 (LWP 11098) "Repro_MonoCrash" 0x00007f41b94d9636 in waitpid () from /usr/lib/libpthread.so.0
  2    Thread 0x7f41b953d700 (LWP 11099) "Repro_MonoCrash" 0x00007f41b94d7d16 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
  3    Thread 0x7f41b4fea700 (LWP 11102) "Repro_MonoCrash" 0x00007f41b94d7d16 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
  4    Thread 0x7f41b424b700 (LWP 11104) "Repro_MonoCrash" 0x00007f41b94d9145 in nanosleep () from /usr/lib/libpthread.so.0
  5    Thread 0x7f41b420a700 (LWP 11106) "Repro_MonoCrash" 0x00007f41b927636d in nanosleep () from /usr/lib/libc.so.6
  6    Thread 0x7f41973ff700 (LWP 11108) "SGen worker"     0x00007f41b94d5415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
  7    Thread 0x7f4197ffe700 (LWP 11109) "Finalizer"       0x00007f41b94d7d16 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0

Thread 7 (Thread 0x7f4197ffe700 (LWP 11109)):
#0  0x00007f41b94d7d16 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007f41b94d7e18 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x0000000000a896b4 in mono_os_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x2ec7840 <finalizer_sem>) at ../../mono/utils/mono-os-semaphore.h:209
#3  mono_coop_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x2ec7840 <finalizer_sem>) at ../../mono/utils/mono-coop-semaphore.h:43
#4  finalizer_thread (unused=unused@entry=0x0) at gc.c:918
#5  0x0000000000b3cdcb in start_wrapper_internal (stack_ptr=<optimized out>, start_info=0x0) at threads.c:1155
#6  start_wrapper (data=0x44e19e0) at threads.c:1215
#7  0x00007f41b94cf57f in start_thread () from /usr/lib/libpthread.so.0
#8  0x00007f41b92a90e3 in clone () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7f41973ff700 (LWP 11108)):
#0  0x00007f41b94d5415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1  0x0000000000ba83b3 in mono_os_cond_wait (mutex=0x2eda060 <lock>, cond=0x2eda020 <work_cond>) at ../../mono/utils/mono-os-mutex.h:173
#2  get_work (job=<synthetic pointer>, do_idle=<synthetic pointer>, work_context=<synthetic pointer>, worker_index=0) at sgen-thread-pool.c:165
#3  thread_func (data=<optimized out>) at sgen-thread-pool.c:196
#4  0x00007f41b94cf57f in start_thread () from /usr/lib/libpthread.so.0
#5  0x00007f41b92a90e3 in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7f41b420a700 (LWP 11106)):
#0  0x00007f41b927636d in nanosleep () from /usr/lib/libc.so.6
#1  0x00007f41b92a16e9 in usleep () from /usr/lib/libc.so.6
#2  0x000000000233e1ac in JoypadLinux::monitor_joypads() ()
#3  0x00007f4188000020 in ?? ()
#4  0x00007f4188000b50 in ?? ()
#5  0x706e692f7665642f in ?? ()
#6  0x746e6576652f7475 in ?? ()
#7  0xffffffffff003133 in ?? ()
#8  0x00007f41b420a700 in ?? ()
#9  0x00007f41b4209f00 in ?? ()
#10 0x00007f41b92347ff in malloc () from /usr/lib/libc.so.6
#11 0x00007fffe28ffe2e in ?? ()
#12 0x00007fffe28ffe2f in ?? ()
#13 0x00007f41b420a700 in ?? ()
#14 0x00007f41b4209f00 in ?? ()
#15 0x0000000001d5f880 in ThreadPosix::thread_callback(void*) ()
#16 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f41b424b700 (LWP 11104)):
#0  0x00007f41b94d9145 in nanosleep () from /usr/lib/libpthread.so.0
#1  0x0000000000be766b in OS_Unix::delay_usec(unsigned int) const [clone .constprop.11962] ()
#2  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f41b4fea700 (LWP 11102)):
#0  0x00007f41b94d7d16 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007f41b94d7e18 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x00000000012c65d9 in VisualServerScene::_gi_probe_bake_thread() ()
#3  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f41b953d700 (LWP 11099)):
#0  0x00007f41b94d7d16 in do_futex_wait.constprop () from /usr/lib/libpthread.so.0
#1  0x00007f41b94d7e18 in __new_sem_wait_slow.constprop.0 () from /usr/lib/libpthread.so.0
#2  0x0000000000ded8e2 in _IP_ResolverPrivate::_thread_function(void*) ()
#3  0xffffffffffffff58 in ?? ()
#4  0x00000000036d7028 in ?? ()
#5  0x00007f41b953cf00 in ?? ()
#6  0x00007f41b92347ff in malloc () from /usr/lib/libc.so.6
#7  0x00007fffe29000ce in ?? ()
#8  0x00007fffe29000cf in ?? ()
#9  0x00007f41b953d700 in ?? ()
#10 0x00007f41b953cf00 in ?? ()
#11 0x0000000001d5f880 in ThreadPosix::thread_callback(void*) ()
#12 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f41b7e5d800 (LWP 11098)):
#0  0x00007f41b94d9636 in waitpid () from /usr/lib/libpthread.so.0
#1  0x00000000009cc89a in dump_native_stacktrace (ctx=ctx@entry=0x7fffe28ff940, signal=0x2475811 "SIGILL") at mini-posix.c:1112
#2  0x00000000009cca4a in mono_dump_native_crash_info (signal=signal@entry=0x2475811 "SIGILL", ctx=ctx@entry=0x7fffe28ff940, info=info@entry=0x7fffe28ffa70) at mini-posix.c:1149
#3  0x00000000009c00c9 in mono_handle_native_crash (signal=signal@entry=0x2475811 "SIGILL", ctx=ctx@entry=0x7fffe28ff940, info=info@entry=0x7fffe28ffa70) at mini-exceptions.c:3290
#4  0x00000000009d5068 in mono_sigill_signal_handler (_dummy=4, _info=0x7fffe28ffa70, context=0x7fffe28ff940) at mini-runtime.c:3388
#5  <signal handler called>
#6  0x000000000230aa13 in GDMono::_load_api_assemblies() [clone .part.22] ()
#7  0x00007fffe2900080 in ?? ()
#8  0x00000000020f9402 in CSharpLanguage::init() ()
#9  0x00007fffe2900080 in ?? ()
#10 0x00007fffe29001a0 in ?? ()
#11 0x0000000000000003 in ?? ()
#12 0x0000000002ede5e0 in ResourceSaver::save_callback ()
#13 0x0000000000f7b3df in ScriptServer::init_languages() ()
#14 0x00007fffe2900050 in ?? ()
#15 0x00007fffe2900058 in ?? ()
#16 0x00007fffe29000a0 in ?? ()
#17 0x00007fffe2900070 in ?? ()
#18 0x00007fffe29000e0 in ?? ()
#19 0x01000000043c6fe0 in ?? ()
#20 0x0000000002ede3a0 in ?? ()
#21 0x0000000004408e20 in ?? ()
#22 0x00007fffe2900100 in ?? ()
#23 0x0000000000ee7b66 in StringName::operator=(StringName const&) ()
#24 0x0000000000000000 in ?? ()
[Inferior 1 (process 11098) detached]

=================================================================
    Managed Stacktrace:
=================================================================
=================================================================

winows (wine) log:

Godot Engine v3.2.alpha0.mono.official - https://godotengine.org
OpenGL ES 2.0 Renderer: GeForce GTX 1070/PCIe/SSE2
002b:fixme:win:RegisterTouchWindow (0x10054 00000000): stub
002b:fixme:imm:ImmReleaseContext (0000000000010054, 000000000009C8F0): stub
002b:fixme:avrt:AvSetMmThreadCharacteristicsW (L"Games",000000000033BC80): stub
002b:fixme:avrt:AvSetMmThreadPriority (0000000012345678)->(2) stub

erasing C:/users/carter/Application Data/Godot/app_userdata/HighHat/mono/mono_logs/2019_09_08 12.33.10 (43).txt
erasing C:/users/carter/Application Data/Godot/app_userdata/HighHat/mono/mono_logs/2019_09_08 12.59.27 (46).txt
erasing C:/users/carter/Application Data/Godot/app_userdata/HighHat/mono/mono_logs/2019_09_08 12.59.45 (45).txt
Mono: Logfile is: C:/users/carter/Application Data/Godot/app_userdata/HighHat/mono/mono_logs/2019_09_23 23.29.36 (42).txt
ERROR: _load_api_assemblies: FATAL: Method/Function Failed.
   At: modules/mono/mono_gd/gd_mono.cpp:805

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

=================================================================
    Managed Stacktrace:
=================================================================
=================================================================

Steps to reproduce:

akien-mga commented 5 years ago

Possibly related: #32185 (but that one is from a custom build)

piratesephiroth commented 5 years ago

It seems related to the final comments of #31581. I get the same results with custom builds and the official alpha0 build. On Windows 10 x64 and Mono v5.18.1: debug template works, release template crashes.

neikeq commented 5 years ago

I cannot reproduce with alpha0 nor when building from source on Ubuntu 19.04 64bit.

piratesephiroth commented 5 years ago

I cannot reproduce with alpha0 nor when building from source on Ubuntu 19.04 64bit.

It's fixed now (763a4d84). Mono release template is working again. Also the editor now can't find MSBuild from VS Build Tools, I had to make it use Mono's.

akien-mga commented 5 years ago

Can you test if it still crashes with https://downloads.tuxfamily.org/godotengine/3.2/dev.bf1c81adf/mono/ ?

piratesephiroth commented 5 years ago

This version doesn't crash but still cannot find MSBuild from VS Build Tools

akien-mga commented 5 years ago

Yeah that was fixed in a later commit. It should be good in the master branch/upcoming 3.2 alpha 1.

Closing as fixed, please comment if you can still reproduce it in the latest build @cart.