- Home /
Occasional crash when importing open type font
Hi there
I have a case where a font's meta files get deleted and on the next import, unity crashes (see the stack trace below).
This isn't 100% reproducable though, it only happens about 25% of the time.
The process that triggers the occasional crash (after the meta file has been deleted) is:
AssetDatabase.StartAssetEditing();
AssetDatabase.ImportAsset(fontPath,ImportAssetOptions.ForceUpdate); AssetDatabase.StopAssetEditing(); AssetDatabase.Refresh();
Does anyone have any ideas what could be causing this?
Stack trace in the Editor.log after a crash:
========= OUTPUTING STACK TRACE ==================
(0x00CF099D) c:\buildagent\work\d3d49558e4d408f4\editor\src\assetpipeline\truetypefontimporter.cpp (608 + 0x0): TrueTypeFontImporter::GetFallbackFontReferences + 0x13d
(0x0062138C) c:\buildagent\work\d3d49558e4d408f4\runtime\filters\misc\font.cpp (339 + 0x0): Font::AwakeFromLoad + 0x3c
(0x00CF342D) c:\buildagent\work\d3d49558e4d408f4\editor\src\assetpipeline\truetypefontimporter.cpp (571 + 0x0): TrueTypeFontImporter::GenerateAssetData + 0xc1d
(0x0096C258) c:\buildagent\work\d3d49558e4d408f4\editor\src\assetpipeline\assetdatabase.cpp (375 + 0x0): AssetDatabase::ImportAsset + 0x1b8
(0x00973E6B) c:\buildagent\work\d3d49558e4d408f4\editor\src\assetpipeline\assetdatabase.cpp (1023 + 0x32): AssetDatabase::UpdateAsset + 0xf0b
(0x00CCD7DB) c:\buildagent\work\d3d49558e4d408f4\editor\src\assetpipeline\assetinterface.cpp (1100 + 0x0): AssetInterface::ProcessAssetsImplementation + 0x1db
(0x00CD00E6) c:\buildagent\work\d3d49558e4d408f4\editor\src\assetpipeline\assetinterface.cpp (359 + 0x0): AssetInterface::StopAssetEditing + 0xd6
(0x00BDCDE4) c:\buildagent\work\d3d49558e4d408f4\artifacts\editorgenerated\assetdatabase.cpp (94 + 0x0): AssetDatabase_CUSTOM_StopAssetEditing + 0x24
(0x0E28A879) (Mono JIT code): (filename not available): test:DoSomething () + 0x69 (0E28A810 0E28A89E) [05706D20 - Unity Child Domain] + 0x0
(0x09B50518) (Mono JIT code): (filename not available): (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) + 0x88 (09B50490 09B505E0) [05706D20 - Unity Child Domain] + 0x0
(0x0A76FEDE) c:\buildslave\monoandruntimeclasslibs\build\mono\mini\mini.c (4889 + 0xc): mono_jit_runtime_invoke + 0x214
(0x0A6DD680) c:\buildslave\monoandruntimeclasslibs\build\mono\metadata\object.c (2618 + 0x10): mono_runtime_invoke + 0x51
(0x00706EF8) c:\buildagent\work\d3d49558e4d408f4\runtime\scripting\backend\mono\scriptingbackendapi_mono.cpp (183 + 0x1a): scripting_method_invoke + 0xb8
(0x00826C78) c:\buildagent\work\d3d49558e4d408f4\runtime\scripting\backend\scriptinginvocation.cpp (115 + 0x0): ScriptingInvocation::Invoke + 0x58
(0x0082716E) c:\buildagent\work\d3d49558e4d408f4\runtime\scripting\backend\scriptinginvocation.cpp (99 + 0x0): ScriptingInvocation::Invoke + 0xe
(0x008271DC) c:\buildagent\work\d3d49558e4d408f4\runtime\scripting\backend\scriptinginvocationnoargs.cpp (120 + 0x13): ScriptingInvocationNoArgs::InvokeChecked + 0x2c
(0x00E11011) c:\buildagent\work\d3d49558e4d408f4\editor\src\commands\scriptcommands.cpp (124 + 0x0): ScriptCommands::InvokeMenuItemWithContext + 0x91
(0x00E11191) c:\buildagent\work\d3d49558e4d408f4\editor\src\commands\scriptcommands.cpp (105 + 0x1d): ScriptCommands::Execute + 0x71
(0x00F74BA7) c:\buildagent\work\d3d49558e4d408f4\editor\src\menucontroller.cpp (274 + 0x0): MenuController::ExecuteMenuItem + 0x127
(0x01001471) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\menucontrollerwin.cpp (222 + 0x6): ExecuteMenuItemWithID + 0x41
(0x0100BACC) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\wineditormain.cpp (251 + 0x9): ProcessMainWindowMessages + 0x1cc
(0x00FF5D61) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\editorwindows.cpp (697 + 0x13): ContainerWindow::ContainerWndProc + 0x531
(0x75A762FA) (USER32): (filename not available): gapfnScSendMessage + 0x332
(0x75A76D3A) (USER32): (filename not available): GetThreadDesktop + 0xd7
(0x75A80D27) (USER32): (filename not available): GetClientRect + 0xc5
(0x75A80D4D) (USER32): (filename not available): CallWindowProcW + 0x1b
(0x6B1EBC93) (tv_w32): (filename not available): GetTeamViewerInterface + 0x4703
(0x75A762FA) (USER32): (filename not available): gapfnScSendMessage + 0x332
(0x75A76D3A) (USER32): (filename not available): GetThreadDesktop + 0xd7
(0x75A777C4) (USER32): (filename not available): CharPrevW + 0x138
(0x75A77BCA) (USER32): (filename not available): DispatchMessageA + 0xf
(0x0100C670) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\wineditormain.cpp (328 + 0x0): MainMessageLoop + 0x1b0
(0x0100D5C7) c:\buildagent\work\d3d49558e4d408f4\editor\platform\windows\wineditormain.cpp (848 + 0x0): WinMain + 0xe37
(0x01125C34) f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c (275 + 0x1c): __tmainCRTStartup + 0x11a
(0x7570338A) (kernel32): (filename not available): BaseThreadInitThunk + 0x12
(0x771F9F72) (ntdll): (filename not available): RtlInitializeExceptionChain + 0x63
(0x771F9F45) (ntdll): (filename not available): RtlInitializeExceptionChain + 0x36
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613164229im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Fill Font Characters with White? 0 Answers
Custom Font on iOS4.3.2 & iOS5.0 ?? 0 Answers
Are there anyway to load ttf file as font at runtime already? 0 Answers
How to find a font via script? 2 Answers
Font effects 2 Answers