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
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
- Graphics State Collection warm-up does not work when using with Addressables Shaders
- "Baked Shadow Radius" field is visible but inactive when when the Shadow Type is set to "Hard Shadows" under the Light Component
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/