ArticySoftware / Articy3ImporterForUnreal

Articy Importer plugin for the Unreal Engine 4 and Unreal Engine 5 (work in progress).
MIT License
98 stars 39 forks source link

performing full reimport crashes Unreal 100% of the time. #30

Closed wvaughn409 closed 3 years ago

wvaughn409 commented 4 years ago

The initial import of the articy file worked, but after the project grew to a size on disk of more than 14gb, performing a full-reimport causes the following crash:

`LoginId:xxxxxxxxxxxx EpicAccountId:xxxxxxxxxxxxx

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff

UE4Editor_CoreUObject!FPropertyProxyArchive::operator<<() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\PropertyProxyArchive.h:45] UE4Editor_CoreUObject!UStruct::SerializeExpr() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\ScriptSerialization.h:222] UE4Editor_CoreUObject!UStruct::SerializeExpr() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:2126] UE4Editor_CoreUObject!UStruct::SerializeExpr() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:2126] UE4Editor_CoreUObject!UStruct::Serialize() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:1925] UE4Editor_CoreUObject!UFunction::Serialize() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:5555] UE4Editor_CoreUObject!FFindReferencersArchive::ResetPotentialReferencer() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\FindReferencersArchive.cpp:89] UE4Editor_UnrealEd!ObjectTools::ForceReplaceReferences() [D:\Build++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\ObjectTools.cpp:798] UE4Editor_UnrealEd!ObjectTools::ForceReplaceReferences() [D:\Build++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\ObjectTools.cpp:922] UE4Editor_UnrealEd!ObjectTools::ForceDeleteObjects() [D:\Build++UE4+Licensee\Sync\Engine\Source\Editor\UnrealEd\Private\ObjectTools.cpp:2811] UE4Editor_ArticyEditor!CodeGenerator::DeleteGeneratedAssets() [D:\Build++Portal+Promotion\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ArticyImporter\Source\ArticyEditor\Private\CodeGeneration\CodeGenerator.cpp:178] UE4Editor_ArticyEditor!CodeGenerator::GenerateAssets() [D:\Build++Portal+Promotion\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ArticyImporter\Source\ArticyEditor\Private\CodeGeneration\CodeGenerator.cpp:269] UE4Editor_ArticyEditor!TBaseFunctorDelegateInstance<void cdecl(UArticyImportData ), >::ExecuteIfSafe() [D:\RocketSync\4.25.0-13144385+++UE4+Release-4.25\Working\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:1005] UE4Editor_ArticyEditor!TBaseMulticastDelegate<void,UArticyImportData >::Broadcast() [D:\RocketSync\4.25.0-13144385+++UE4+Release-4.25\Working\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:1013] UE4Editor_ArticyEditor!CodeGenerator::OnCompiled() [D:\Build++Portal+Promotion\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\ArticyImporter\Source\ArticyEditor\Private\CodeGeneration\CodeGenerator.cpp:312] UE4Editor_ArticyEditor!TBaseFunctorDelegateInstance<void cdecl(bool), >::ExecuteIfSafe() [D:\RocketSync\4.25.0-13144385+++UE4+Release-4.25\Working\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:1007] UE4Editor_HotReload!TBaseMulticastDelegate<void,bool>::Broadcast() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:1013] UE4Editor_HotReload!FHotReloadModule::DoHotReloadInternal() [D:\Build++UE4+Licensee\Sync\Engine\Source\Developer\HotReload\Private\HotReload.cpp:890] UE4Editor_HotReload!UE4Function_Private::TFunctionRefCaller<,void __cdecl(TMap<FName,FString,FDefaultSetAllocator,TDefaultMapHashableKeyFuncs<FName,FString,0> > const &,bool,enum ECompilationResult::Type)>::Call() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Core\Public\Templates\Function.h:549] UE4Editor_HotReload!FHotReloadModule::CheckForFinishedModuleDLLCompile() [D:\Build++UE4+Licensee\Sync\Engine\Source\Developer\HotReload\Private\HotReload.cpp:1865] UE4Editor_HotReload!FHotReloadModule::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Developer\HotReload\Private\HotReload.cpp:1427] UE4Editor_Core!FTicker::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Core\Private\Containers\Ticker.cpp:95] UE4Editor!FEngineLoop::Tick() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5051] UE4Editor!GuardedMain() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:169] UE4Editor!GuardedMainWrapper() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137] UE4Editor!WinMain() [D:\Build++UE4+Licensee\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268] UE4Editor!__scrt_common_main_seh() [d:\agent_work\5\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288] kernel32 ntdll`

herr-edgy commented 4 years ago

Interesting. This appears to be an issue on the side of Unreal Engine, not the plugin code, as this crash happens during deletion of the previously generated assets. There are a couple things I'd like you to answer or try out:

  1. Can you trigger the same error if you select all generated articy assets and attempt a forced deletion?
  2. How large are the generated articy assets (import data asset + global variables + database + packages)?
  3. Are you referencing the generated assets anywhere directly?

For now, you should be able to bypass the crash by deleting the generated assets on disk. As there should be no references to the assets in the first place, doing so should be safe and the generating code won't trigger the code that is responsible for the crash.

wvaughn409 commented 4 years ago

your suggestions have aided me in discovering a work around, but it is a very long and temperamental process and not sustainable long term. Here are the steps I had to take in order for the import to work in our main project:

  1. close p4v (perforce)
  2. in windows explorer, right click on project folder and select properties
  3. untick "read only" and apply (takes a long time)
  4. navigate into the project folder and delete the .vs, DerivedDataCache, Intermediate, & Saved folders
  5. delete the [project].sln file
  6. navigate into the Content folder
  7. delete the articyue4 and the articy .uasset files
  8. delete the ArticyContent folder
  9. navigate back to main project root
  10. right click on project and select "generate visual studio project files"
  11. open the .sln and build
  12. open the project
  13. open any maps that rely on the articy integration and remove the references (for us, it is a Loc_cell.umap, the generated clickable zones, level handler blueprint, and location blueprint in that level)
  14. export from articy
  15. click yes at import (this will perform the import, but crash the program)
  16. open the project solution and build
  17. open the project
  18. from the Articy plugin menu, select full reimport
  19. open the level that references the integration and reconnect the hooks (for us this is open Loc_cell and re-add level handler and location blueprints, then click generate location and save)
  20. test dialogue trees (success)

As you can see, this is a bit cumbersome. Would it be possible to schedule a call with you to debug this behavior and devise a solutions strategy?

herr-edgy commented 4 years ago

Yes, please send a ticket to support@articy.com. I will send you my discord name and we can discuss things further.

I am confident that if a fix is not in sight, we should be able to find a workaround that is much more acceptable than the one you have outlined.

k0mbain commented 4 years ago

Try removing only Content*.articyue4 and corresponding Content*.uasset It may be useful to also remove Content\ArticyContent\Generated*Database.uasset and Content\ArticyContent\Generated*GlobalVariables.uasset. It seems that it crashes when Unreal tries to deserialize those assets. We workarounded this issue by creating Jenkins job to automate removing and importing articy assets. If you don't have any CI system you could try creating some .bat file to automate it.

herr-edgy commented 4 years ago

Try removing only Content.articyue4 and corresponding Content.uasset It may be useful to also remove Content\ArticyContent\GeneratedDatabase.uasset and Content\ArticyContent\GeneratedGlobalVariables.uasset. It seems that it crashes when Unreal tries to deserialize those assets. We workarounded this issue by creating Jenkins job to automate removing and importing articy assets. If you don't have any CI system you could try creating some .bat file to automate it.

Have you or your team encountered the same issue? I had a debug session with wvaughn409 today and it seems like a specific animation blueprint is being considered for reference cleanup during articy asset deletion (with no actual referencing going on), and some issue in that animation blueprint causes the crash.

brwarner commented 3 years ago

Closing as this seems to have been a very particular oddity in the reporter's project that was resolved when they recreated the offending animation asset. If anyone else is experiencing something something similar, please let us know so we can try to track it down.