Repository: godot
Issue: Trying to build Mono project from Github Actions causes headless editor to crash
Labels: bug,topic:editor,topic:porting,topic:dotnet,crash

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**

3.2.3 mono linux headless: https://downloads.tuxfamily.org/godotengine/3.2.3/mono/Godot_v3.2.3-stable_mono_linux_headless_64.zip

**OS/device including version:**

Ubuntu 18.04, config: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md

**Issue description:**

Goal is to compile C# scripts from CI/CD to catch any compilation error/warning, and run some unit test suites on some C# modules. I wanted to run Godot before having fun with MSBuild because the Godot C# scripts will need the `.mono` folder in order to find the Godot assemblies.

_Disclaimer: I don't even know if this is a good idea to setup, or if there's a better way. Suggestions welcome._

I wrote a GitHub action essentially downloading Godot and running it as follows:

```yml
name: Build C# Project

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-18.04

    steps:
    - uses: actions/checkout@v2
    - name: Setup Godot 3.2.3 with Mono Support
      run: |
        curl -o /tmp/godot-3.2.3.zip https://downloads.tuxfamily.org/godotengine/3.2.3/mono/Godot_v3.2.3-stable_mono_linux_headless_64.zip
        7z e /tmp/godot-3.2.3.zip -o/opt/godot-3.2.3 -r -y
    - name: Build with Godot
      run: /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 --build-solutions -q
```

```
Run /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 --build-solutions -q
  /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 --build-solutions -q
  shell: /bin/bash -e {0}
Godot Engine v3.2.3.stable.mono.official - https://godotengine.org
 
Mono: Log file is: '/home/runner/.local/share/godot/mono/mono_logs/2020_09_28 00.46.48 (2701).txt'
ERROR: mono_log_callback: Mono: FATAL ERROR 'Runtime critical type Mono.RuntimeStructs/MonoError not found (in domain , error)', ABORTING! Logfile: '/home/runner/.local/share/godot/mono/mono_logs/2020_09_28 00.46.48 (2701).txt'.

   At: modules/mono/mono_gd/gd_mono_log.cpp:93.
=================================================================
	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:
=================================================================
	0xcf4354 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xcf46cc - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xce7178 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xcf39af - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0x7fece16e68a0 - /lib/x86_64-linux-gnu/libpthread.so.0 : (null)
	0x7fece0b77f47 - /lib/x86_64-linux-gnu/libc.so.6 : gsignal
	0x7fece0b798b1 - /lib/x86_64-linux-gnu/libc.so.6 : abort
	0xbae025 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xf1826e - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xf18603 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : monoeg_g_logv
	0xf186b2 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : monoeg_g_log
	0xd911ce - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xde5e60 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xdf82a8 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xcb1272 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xcb3d92 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xcaf804 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xd086e7 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xd0a7e2 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xcfe723 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xd01126 - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0xd01e8f - /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 : (null)
	0x40726507 - Unknown

=================================================================
	Telemetry Dumper:
=================================================================
* Assertion: should not be reached at threads.c:6258
Pkilling 0x7fece1b05240 from 0x7fece024f700
Entering thread summarizer pause from 0x7fece024f700
Finished thread summarizer pause from 0x7fece024f700.

Waiting for dumping threads to resume

=================================================================
	External Debugger Dump:
=================================================================
mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fece0b77f47):0x7fece0b77f37  d2 4c 89 ce bf 02 00 00 00 b8 0e 00 00 00 0f 05  .L..............
0x7fece0b77f47  48 8b 8c 24 08 01 00 00 64 48 33 0c 25 28 00 00  H..$....dH3.%(..
0x7fece0b77f57  00 44 89 c0 75 1f 48 81 c4 18 01 00 00 c3 0f 1f  .D..u.H.........
0x7fece0b77f67  00 48 8b 15 f9 be 3a 00 f7 d8 41 b8 ff ff ff ff  .H....:...A.....

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at System.Collections.Generic.EqualityComparer`1:CreateComparer <0x000da>
	  at System.Collections.Generic.Dictionary`2:.ctor <0x0007f>
	  at System.Collections.Generic.Dictionary`2:.ctor <0x00013>
	  at System.LocalDataStoreMgr:.ctor <0x000b7>
	  at System.Runtime.Remoting.Contexts.Context:.cctor <0x0001f>
	  at System.Object:runtime_invoke_void <0x00066>
=================================================================
/home/runner/work/_temp/f9356c96-3674-4918-861d-071beff6d22d.sh: line 1:  2701 Aborted                 (core dumped) /opt/godot-3.2.3/Godot_v3.2.3-stable_mono_linux_headless.64 --build-solutions -q
Error: Process completed with exit code 134.
```

**Steps to reproduce:**


**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->