cesium-unreal icon indicating copy to clipboard operation
cesium-unreal copied to clipboard

Crash when adding CesiumSunSky while the viewport is hidden

Open yuanlei88 opened this issue 2 years ago • 7 comments

Add Cesium SunSky error

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000030

UnrealEditor_CesiumRuntime!ACesiumSunSky::UpdateAtmosphereRadius() [D:\build\U5M-Marketplace\Sync\LocalBuilds\PluginTemp\HostProject\Plugins\CesiumForUnreal\Source\CesiumRuntime\Private\CesiumSunSky.cpp:439] UnrealEditor_Engine!AActor::TickActor() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:1360] UnrealEditor_Engine!FActorTickFunction::ExecuteTick() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Actor.cpp:197] UnrealEditor_Engine!FTickFunctionTask::DoTask() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:284] UnrealEditor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:975] UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:753] UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:642] UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2169] UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:565] UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1592] UnrealEditor_Engine!UWorld::RunTickGroup() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:790] UnrealEditor_Engine!UWorld::Tick() [D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1531] UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1568] UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:474] UnrealEditor!FEngineLoop::Tick() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5215] UnrealEditor!GuardedMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183] UnrealEditor!GuardedMainWrapper() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147] UnrealEditor!LaunchWindowsStartup() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283] UnrealEditor!WinMain() [D:\build++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330] UnrealEditor!__scrt_common_main_seh() [d:\a01_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288] kernel32 ntdll

image

yuanlei88 avatar Apr 27 '22 09:04 yuanlei88

@yuanlei88 that is a very strange error, as it implies the editor has an invalid list of viewport clients. Can you tell us the steps you took that led up that error?

kring avatar Apr 28 '22 00:04 kring

Thank you very much for your reply, thank you! I don't have any special steps, just click Add Cesium SunSky and error as normal. But from your reply, I did try. There are two pictures. image Add Cesium SunSky OK!

image

Add Or Delete Cesium SunSky error!

Although I don't know the specific reason, it has something to do with me hiding the viewport! Thanks for your help and good luck.

yuanlei88 avatar Apr 28 '22 00:04 yuanlei88

I tested this out a little. For me, the crash only occurred on deleting the CesiumSunSky actor, but not adding it.

Also, I think this is a problem from the core SunSky from the Sun Position Calculator plugin. The crash occurred for me when deleting that actor as well.

Also confirmed that a crash does not occur in UE 4.27.

argallegos avatar May 12 '22 19:05 argallegos

We may be able to use the FEditorViewportClient::IsVisible() function to check if an editor viewport is closed or not. Similar to my comment left here: https://github.com/CesiumGS/cesium-unreal/issues/801#issuecomment-1138712206.

nithinp7 avatar Jun 13 '22 12:06 nithinp7

In version 1.15.1 we experienced a similar crash - this post gave the hint I needed to fix it.

If you launch UE and the Cesium window covers the viewport window, this also causes a crash. I presume this would be the case if the viewport window is hidden behind any other window. We had to disable the plugin in the .uproject, move the viewport window to another section of the UE editor, re-enable the plugin in the .uproject, and ensure that the cesium window didn't cover the viewport window.

bradybr90 avatar Jul 27 '22 17:07 bradybr90

@bradybr90 That sounds annoying, sorry for the inconvenience there glad you got it fixed! Do you have a stack trace handy for the variation of the crash you ran into? It definitely sounds like a similar problem.

nithinp7 avatar Jul 27 '22 20:07 nithinp7

Unfortunately I don't, it was on a co-workers machine and it took us awhile to figure out what it was - the callstack was pretty much a dead pointer, and before that a call into cesiumsunsky.cpp 439, and then external code. I assume it should be pretty easy to reproduce, just put some window over your viewport and close UE, reopen it and it should be doing it.

bradybr90 avatar Jul 27 '22 20:07 bradybr90

Umm, @bradybr90, sorry to bothering you man, but did you finally find out how to fix this stuff? guess i know that caused this crashes, but have no idea what to do about it... that's the only conversation bout this issue that i found

tavarenik avatar Feb 05 '23 14:02 tavarenik

I can't seem to recreate this bug, even without the fix in #1349. I'm going to close this issue, but feel free to reopen it if the problem persists.

j9liu avatar Feb 13 '24 18:02 j9liu