Repository: godot
Issue: Executable project + plugin crash (Linux + C#)
Labels: bug,platform:linuxbsd,topic:dotnet,crash

**Godot version:**
3.2.1 stable mono
**OS/device including version:**
Debian 10
**Issue description:**
Trying to execute the project it crash with this error:
```
(base) vale@debianace:~/godot/tutorials/test$ ./test.x86_64 
Godot Engine v3.2.1.stable.mono.official - https://godotengine.org
OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) Ivybridge Mobile 
 
Mono: Logfile is: /home/vale/.local/share/godot/app_userdata/test/mono/mono_logs/2020_04_14 12.56.01 (4277).txt
ERROR: update_godot_api_cache: Mono Cache: Member cached_data.methodthunk_GodotTaskScheduler_Activate is null.
   At: modules/mono/mono_gd/gd_mono_cache.cpp:276.
ERROR: _load_api_assemblies: The loaded assembly 'GodotSharp' is in sync, but the cache update failed.
   At: modules/mono/mono_gd/gd_mono.cpp:928.
ERROR: _load_api_assemblies: FATAL: Method failed.
   At: modules/mono/mono_gd/gd_mono.cpp:937.

=================================================================
	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.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0xa712b4 - ./test.x86_64 : (null)
	0xa7162c - ./test.x86_64 : (null)
	0xa640d8 - ./test.x86_64 : (null)
	0xa7d3aa - ./test.x86_64 : (null)
	0x7f6454056730 - /lib/x86_64-linux-gnu/libpthread.so.0 : (null)
	0x24e451f - ./test.x86_64 : _ZN6GDMono20_load_api_assembliesEv
	0x24e46de - ./test.x86_64 : _ZN6GDMono26initialize_load_assembliesEv
	0x2251b22 - ./test.x86_64 : _ZN14CSharpLanguage4initEv
	0x101436f - ./test.x86_64 : _ZN12ScriptServer14init_languagesEv
	0x255d85e - ./test.x86_64 : _ZN4Main6setup2Em
	0x2561d7f - ./test.x86_64 : _ZN4Main5setupEPKciPPcb
	0x995438 - ./test.x86_64 : main
	0x7f6453d1509b - /lib/x86_64-linux-gnu/libc.so.6 : __libc_start_main
	0x99571e - ./test.x86_64 : (null)

=================================================================
	Telemetry Dumper:
=================================================================
Pkilling 0x7f6448ffe700 from 0x7f6451ac3880
* Assertion: should not be reached at threads.c:6254
Entering thread summarizer pause from 0x7f6451ac3880
Finished thread summarizer pause from 0x7f6451ac3880.

Waiting for dumping threads to resume

=================================================================
	External Debugger Dump:
=================================================================
[New LWP 4278]
[New LWP 4283]
[New LWP 4284]
[New LWP 4285]
[New LWP 4286]
[New LWP 4287]
[New LWP 4288]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f64540560ca in __waitpid (pid=pid@entry=4292, stat_loc=stat_loc@entry=0x7ffffcd3fa64, 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 0x7f6451ac3880 (LWP 4277) "test.x86_64"    0x00007f64540560ca in __waitpid (pid=pid@entry=4292, stat_loc=stat_loc@entry=0x7ffffcd3fa64, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
  2    Thread 0x7f645155c700 (LWP 4278) "test.x86_64"    futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x513a928) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  3    Thread 0x7f644bcb4700 (LWP 4283) "test.x8:disk$0" futex_wait_cancelable (private=0, expected=0, futex_word=0x53223d8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  4    Thread 0x7f644b39a700 (LWP 4284) "test.x86_64"    futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x53851f8) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  5    Thread 0x7f644b0d8700 (LWP 4285) "test.x86_64"    0x00007ffffcdd3b34 in clock_gettime ()
  6    Thread 0x7f644b097700 (LWP 4286) "test.x86_64"    0x00007f6453db7720 in __GI___nanosleep (requested_time=requested_time@entry=0x7f644b096ce0, remaining=remaining@entry=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  7    Thread 0x7f644a7ff700 (LWP 4287) "SGen worker"    futex_wait_cancelable (private=0, expected=0, futex_word=0x312a888 <work_cond+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  8    Thread 0x7f6448ffe700 (LWP 4288) "Finalizer"      futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x3118020 <finalizer_sem>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205

Thread 8 (Thread 0x7f6448ffe700 (LWP 4288)):
#0  futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x3118020 <finalizer_sem>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x3118020 <finalizer_sem>, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007f6454054988 in __new_sem_wait_slow (sem=sem@entry=0x3118020 <finalizer_sem>, abstime=0x0) at sem_waitcommon.c:181
#3  0x00007f64540549f9 in __new_sem_wait (sem=sem@entry=0x3118020 <finalizer_sem>) at sem_wait.c:42
#4  0x0000000000b2e4a8 in mono_os_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x3118020 <finalizer_sem>) at ../../mono/utils/mono-os-semaphore.h:203
#5  mono_coop_sem_wait (flags=MONO_SEM_FLAGS_ALERTABLE, sem=0x3118020 <finalizer_sem>) at ../../mono/utils/mono-coop-semaphore.h:41
#6  finalizer_thread (unused=unused@entry=0x0) at gc.c:967
#7  0x0000000000c02185 in start_wrapper_internal (stack_ptr=0x7f6448fff000, start_info=0x0) at threads.c:1222
#8  start_wrapper (data=0x5daef00) at threads.c:1295
#9  0x00007f645404bfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#10 0x00007f6453dea4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 7 (Thread 0x7f644a7ff700 (LWP 4287)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x312a888 <work_cond+40>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x312a8a0 <lock>, cond=0x312a860 <work_cond>) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=cond@entry=0x312a860 <work_cond>, mutex=mutex@entry=0x312a8a0 <lock>) at pthread_cond_wait.c:655
#3  0x0000000000c6cc86 in mono_os_cond_wait (mutex=0x312a8a0 <lock>, cond=0x312a860 <work_cond>) at ../../mono/utils/mono-os-mutex.h:177
#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  0x00007f645404bfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007f6453dea4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7f644b097700 (LWP 4286)):
#0  0x00007f6453db7720 in __GI___nanosleep (requested_time=requested_time@entry=0x7f644b096ce0, remaining=remaining@entry=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
#1  0x00007f6453de2874 in usleep (useconds=<optimized out>) at ../sysdeps/posix/usleep.c:32
#2  0x00000000024cdc02 in JoypadLinux::monitor_joypads() ()
#3  0x000000770000007c in ?? ()
#4  0x0000000005675610 in ?? ()
#5  0x0000000000000018 in ?? ()
#6  0x00007f6424000b50 in ?? ()
#7  0x706e692f7665642f in ?? ()
#8  0x746e6576652f7475 in ?? ()
#9  0xffffffffff003133 in ?? ()
#10 0x00007f644b097700 in ?? ()
#11 0x00007ffffcd40ba0 in ?? ()
#12 0x00007f6453d7556a in __GI___libc_malloc (bytes=140068732366120) at malloc.c:3057
#13 0x00007ffffcd409be in ?? ()
#14 0x00007ffffcd409bf in ?? ()
#15 0x00007f644b097700 in ?? ()
#16 0x00007ffffcd40ba0 in ?? ()
#17 0x0000000001f366d5 in ThreadPosix::thread_callback(void*) ()
#18 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f644b0d8700 (LWP 4285)):
#0  0x00007ffffcdd3b34 in clock_gettime ()
#1  0x00007f6453df7ff6 in __GI___clock_gettime (clock_id=4, tp=0x7f644b0d7d00) at ../sysdeps/unix/clock_gettime.c:115
#2  0x0000000000cd5862 in OS_Unix::get_ticks_usec() const [clone .constprop.10157] ()
#3  0x000000000000c1d1 in ?? ()
#4  0x0000000017739113 in ?? ()
#5  0x00007ffffcd41780 in ?? ()
#6  0x0000000000ee04bf in OS::get_ticks_msec() const ()
#7  0x0000000001e9b640 in ?? ()
#8  0x0000000001f77f9c in AudioDriverPulseAudio::thread_func(void*) ()
#9  0x0000000000000018 in ?? ()
#10 0x00007f644b0d7d68 in ?? ()
#11 0xffffffff00000000 in ?? ()
#12 0x00000000000004b0 in ?? ()
#13 0x00007ffffcd40ba0 in ?? ()
#14 0x00007f6453d7556a in __GI___libc_malloc (bytes=2048) at malloc.c:3057
#15 0x00007ffffcd408fe in ?? ()
#16 0x00007ffffcd408ff in ?? ()
#17 0x00007f644b0d8700 in ?? ()
#18 0x00007ffffcd40ba0 in ?? ()
#19 0x0000000001f366d5 in ThreadPosix::thread_callback(void*) ()
#20 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f644b39a700 (LWP 4284)):
#0  futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x53851f8) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x53851f8, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007f6454054988 in __new_sem_wait_slow (sem=0x53851f8, abstime=0x0) at sem_waitcommon.c:181
#3  0x0000000001ebbe2d in SemaphorePosix::wait() [clone .part.0] ()
#4  0x00007f644b39b020 in ?? ()
#5  0x0000000001368913 in VisualServerScene::_gi_probe_bake_thread() ()
#6  0x0000000000000008 in ?? ()
#7  0x00000000053a9ad0 in ?? ()
#8  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f644bcb4700 (LWP 4283)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x53223d8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5322388, cond=0x53223b0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x53223b0, mutex=0x5322388) at pthread_cond_wait.c:655
#3  0x00007f645066de83 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f645066dbd7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f645404bfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#6  0x00007f6453dea4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f645155c700 (LWP 4278)):
#0  futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x513a928) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x513a928, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007f6454054988 in __new_sem_wait_slow (sem=0x513a928, abstime=0x0) at sem_waitcommon.c:181
#3  0x0000000001ebbe2d in SemaphorePosix::wait() [clone .part.0] ()
#4  0x000000000513a960 in ?? ()
#5  0x0000000000e58e94 in _IP_ResolverPrivate::_thread_function(void*) ()
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f6451ac3880 (LWP 4277)):
#0  0x00007f64540560ca in __waitpid (pid=pid@entry=4292, stat_loc=stat_loc@entry=0x7ffffcd3fa64, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x0000000000a714a1 in dump_native_stacktrace (mctx=mctx@entry=0x7ffffcd403c0, signal=0x2601137 "SIGILL") at mini-posix.c:1089
#2  0x0000000000a7162c in mono_dump_native_crash_info (signal=signal@entry=0x2601137 "SIGILL", mctx=mctx@entry=0x7ffffcd403c0, info=info@entry=0x7ffffcd406b0) at mini-posix.c:1135
#3  0x0000000000a640d8 in mono_handle_native_crash (signal=signal@entry=0x2601137 "SIGILL", mctx=mctx@entry=0x7ffffcd403c0, info=info@entry=0x7ffffcd406b0) at mini-exceptions.c:3423
#4  0x0000000000a7d3aa in mono_sigill_signal_handler (_dummy=4, _info=0x7ffffcd406b0, context=0x7ffffcd40580) at mini-runtime.c:3244
#5  <signal handler called>
#6  0x00000000024e451f in GDMono::_load_api_assemblies() ()
#7  0x0000000005cf5c00 in ?? ()
#8  0x00000000024e46de in GDMono::initialize_load_assemblies() ()
#9  0x0000000005bec830 in ?? ()
#10 0x00007ffffcd40c60 in ?? ()
#11 0x0000000005cf5c00 in ?? ()
#12 0x00007ffffcd40b60 in ?? ()
#13 0x0000000002251b22 in CSharpLanguage::init() ()
#14 0x0000000000000000 in ?? ()
[Inferior 1 (process 4277) detached]

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x24e451f):0x24e450f  8d 8a 3c 00 48 8d 3d 96 3c 40 00 e8 11 81 aa fe  ..<.H.=.<@......
0x24e451f  0f 0b 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00  ..ffffff........
0x24e452f  00 45 31 c9 4c 8d 05 d6 b5 3c 00 48 8d 0d f7 32  .E1.L....<.H...2
0x24e453f  1f 00 ba ab 03 00 00 48 8d 35 53 8a 3c 00 48 8d  .......H.5S.<.H.

=================================================================
	Managed Stacktrace:
=================================================================
=================================================================
Aborted

```
Log file:
[2020_04_14 12.56.01 (4277).txt](https://github.com/godotengine/godot/files/4475101/2020_04_14.12.56.01.4277.txt)



**Steps to reproduce:**
Follow the instruction on the page then add "[Tool]" and pragma tags

**Minimal reproduction project:**
[test.zip](https://github.com/godotengine/godot/files/4475119/test.zip)