Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4
2020.2
2020.2.0a12
Issue ID
1254155
Regression
No
Editor crashes on mono_string_new_checked when calling an extern function from DLL with a wrong return type
Reproduction steps:
1. Open the attached "case_1254155.zip" project
2. Load the "SampleScene"
3. Enter Play mode
-- Observe the crash
Reproducible with: 2018.4.23f1, 2019.3.16f1, 2019.4.0f1, 2020.1.0b13, 2020.2.0a15
Note: in Unity 2018.4 the Editor silently crashes without any stack trace
First lines of the stack trace:
0x00007FFE506BC6C6 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:6350] mono_string_new_checked
0x00007FFE5068C636 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\marshal.c:333] ves_icall_string_new_wrapper
ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 00000227DD014628)
ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 00000227DD014628)
0x00000227DD014628 ((<unknown>)) (function-name not available)
0x0000022839928F83 (Mono JIT Code) (wrapper managed-to-native) Test:GetKeyboardLayout (int)
0x0000022839928DEB (Mono JIT Code) [D:\Downloads\case_1254155\Assets\Test.cs:14] Test:Start ()
<...>
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- URP Terrain Demo crash on burst_signal_handler after Generating lighting
- Project window button icons are poorly visible and their shades differ in Light theme
- GC.Alloc called by HDRenderPipeline.LensFlareMergeOcclusionDataDrivenPass() when playing the default HDRP Sample Template project
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
Resolution Note:
Crash is a result of user error and the way mono handles pinvokes providing incorrect data to native functions. The stack provided in the editor log when the crash occurs provides the user with enough information to determine the cause. https://www.mono-project.com/docs/advanced/pinvoke/