rive-app / rive-unity

MIT License
104 stars 11 forks source link

Unity crashes upon importing Rive asset in 0.1.188 #59

Closed JadenH closed 3 months ago

JadenH commented 4 months ago

On occasion, my editor crashes, and the crash report points to Rive import. I started running into this after upgrading from v0.1.175 to v0.1.188. Here is the crash log I was able to grab:

Start importing Assets/_ui/rive using Guid(b2b1e27bd56cb3b4185f2448e74e19a6) Importer(-1,00000000000000000000000000000000)  -> (artifact id: '1ae24120c757e3d10b41a6f5cf50061b') in 0.001136 seconds
Start importing Assets/_ui/rive/iwy_ability.riv using Guid(917a1bf3fdc19ee4da237f6cbd89c51c) Importer(-1,00000000000000000000000000000000) 
=================================================================
    Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at Rive.AssetImporter:loadEmbeddedAssetList <0x00106>
      at Rive.AssetImporter:OnImportAsset <0x003d2>
      at UnityEditor.AssetImporters.ScriptedImporter:GenerateAssetData <0x00084>
      at <Module>:runtime_invoke_void__this___object <0x0018d>
=================================================================
Received signal SIGSEGV
Obtained 37 stack frames
0x00007ffb5395dfbc (rive) updatePaint
0x00007ffb5395db34 (rive) updatePaint
0x00007ffb538f5560 (rive) loadEmbeddedAssetList
0x000001caca3736c7 (Mono JIT Code) (wrapper managed-to-native) Rive.AssetImporter:loadEmbeddedAssetList (byte[],uintptr)
0x000001caca371b43 (Mono JIT Code) Rive.AssetImporter:OnImportAsset (UnityEditor.AssetImporters.AssetImportContext) (at ./Library/PackageCache/app.rive.rive-unity@f5e2d1f01f/Editor/AssetImporter.cs:40)
0x000001caca3716f5 (Mono JIT Code) UnityEditor.AssetImporters.ScriptedImporter:GenerateAssetData (UnityEditor.AssetImporters.AssetImportContext)
0x000001cab1b0380e (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)
0x00007ffb59a04c1e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffb5993d254 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007ffb5993d3cc (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115)
0x00007ff6a0f21b34 (Unity) scripting_method_invoke
0x00007ff6a0eff8a4 (Unity) ScriptingInvocation::Invoke
0x00007ff6a241cf94 (Unity) ScriptedImporter::GenerateAssetData
0x00007ff6a230beba (Unity) ImportToObjects
0x00007ff6a230af6c (Unity) ImportAsset
0x00007ff6a232fb98 (Unity) AssetImportWorker::Import
0x00007ff6a2360cb5 (Unity) AssetImportManager::ImportInProcess
0x00007ff6a235e332 (Unity) AssetImportManager::Import
0x00007ff6a2361961 (Unity) ImportOutOfDateAssets
0x00007ff6a236bc0c (Unity) RefreshInternalV2
0x00007ff6a23737ec (Unity) StopAssetImportingV2Internal
0x00007ff6a233e387 (Unity) ImportAssetsV2_Internal<core::hash_set<UnityGUID,core::hash<UnityGUID>,std::equal_to<UnityGUID> > >
0x00007ff6a22e2bae (Unity) AssetDatabase::ReimportAssets
0x00007ff6a1d8621b (Unity) AssetsMenu::Execute
0x00007ff6a1993ba2 (Unity) MenuController::ExecuteMenuItem
0x00007ff6a20126a2 (Unity) ShowDelayedContextMenu
0x00007ff6a2023f4e (Unity) GUIView::OnInputEvent
0x00007ff6a1a514d3 (Unity) GUIView::ProcessInputEventFromAPI
0x00007ff6a1a513a8 (Unity) GUIView::ProcessInputEvent
0x00007ff6a201d24c (Unity) GUIView::DoPaint
0x00007ff6a19de176 (Unity) TooltipManager::Update
0x00007ff6a1b7d021 (Unity) Application::TickTimer
0x00007ff6a1ff876a (Unity) MainMessageLoop
0x00007ff6a1ffd640 (Unity) WinMain
0x00007ff6a33e046e (Unity) __scrt_common_main_seh
0x00007ffc5dae7344 (KERNEL32) BaseThreadInitThunk
0x00007ffc5e89cc91 (ntdll) RtlUserThreadStart
damzobridge commented 3 months ago

This is unfortunately due to Unity not unloading the previously loaded native plugin, which may crash during package upgrades. For now, we recommend either reloading the editor when you update the package or updating the package manifest outside the editor.

We're looking into workarounds for this within the Unity Editor.