Built Project Crash at rapidjson Call v1.8.1

Hi everyone,

we recently just compiled CesiumForUnreal v1.8.1 to work with. However, it is resulting in a crash ONLY in built projects.

The error only occurs when a World Terrain Tileset is present in the scene and the log indicates it is crashing during a rapidjson call.

We test multiple projects all were correctly work/still correctly work with the previous v1.7.0 release.

The project runs correctly in PIE and in Standalone but crash at startup of the built package.

Has anyone had this happen or suggest a workaround? For now we have rolled back to v1.7.0

[2021.12.09-05.03.23:103][  2]LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Win64-Debug.exe
[2021.12.09-05.03.23:103][  2]LogWindows: Error: Fatal error!
[2021.12.09-05.03.23:103][  2]LogMemory: Platform Memory Stats for WindowsNoEditor
[2021.12.09-05.03.23:103][  2]LogWindows: Error: 
[2021.12.09-05.03.23:103][  2]LogMemory: Process Physical Memory: 487.20 MB used, 531.70 MB peak
[2021.12.09-05.03.23:103][  2]LogMemory: Process Virtual Memory: 1145.21 MB used, 1145.96 MB peak
[2021.12.09-05.03.23:103][  2]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000010008
[2021.12.09-05.03.23:103][  2]LogMemory: Physical Memory: 33849.51 MB used,  97058.42 MB free, 130907.94 MB total
[2021.12.09-05.03.23:103][  2]LogWindows: Error: 
[2021.12.09-05.03.23:103][  2]LogMemory: Virtual Memory: 134047768.00 MB used,  169958.80 MB free, 134217728.00 MB total
[2021.12.09-05.03.23:103][  2]LogWindows: Error: [Callstack] 0x00007ff6d1a7e84b A1454_Wandoan_V3.exe!rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::Malloc() [D:\temp\UE4Source\ue427\Engine\Plugins\Custom\Sparky\Source\SparkyCommon\Private\rapidjson\allocators.h:181]
[2021.12.09-05.03.23:103][  2]Message dialog closed, result: Ok, title: The UE4-A1454_Wandoan_V3 Game has crashed and will close, text: Fatal error!


[2021.12.09-05.03.23:103][  2]LogWindows: Error: 
[2021.12.09-05.03.23:103][  2]LogThreadingWindows: Error: Runnable thread TaskGraphThreadNP 0 crashed.
[2021.12.09-05.03.23:103][  2]LogWindows: Error: Crash in runnable thread TaskGraphThreadNP 0

Hi @V2i,

Unfortunately, I’m not able to replicate this on my end, but it definitely sounds Cesium-related if it’s only happening when CWT is in the level.
I noticed the line [2021.12.09-05.03.23:103][ 2]LogWindows: Error: [Callstack] 0x00007ff6d1a7e84b A1454_Wandoan_V3.exe!rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::Malloc() [D:\temp\UE4Source\ue427\Engine\Plugins\Custom\Sparky\Source\SparkyCommon\Private\rapidjson\allocators.h:181] in your error log. Is this Sparky plugin used in all of your projects? Are you able to disable it and see if that allows you to run a built project?

If it’s possible that this other plugin is contributing to this issue, it could be helpful to know more about that plugin to figure out if there’s anything we can adjust in the Cesium plugin code to prevent other issues like this.

-Alex

Hi @agallegos ,

We managed to resolve this on our own. The Cesium For Unreal rapidjson call were also calling the rapidjson functions we have in our own Sparky plugin for some reason even though they are separate. We just refactored our implementation and it’s resolved.

1 Like

Hi Alex,
We also meet this program with v1.10.1.
And here is the log:

[2022.04.15-07.19.16:844][394]LogCesium: Loading tileset from URL http://192.0.2.130:11356/E:/SatellieDate/Terrain/WGS84/Earht-13/layer.json
[2022.04.15-07.19.16:844][394]LogCesium: Loading tileset from URL http://192.0.2.130:11356/E:/SatellieDate/Terrain/WGS84/Earht-13/layer.json done
[2022.04.15-07.19.16:956][430]LogLevel: WORLD TRANSLATION BEGIN {-61965, 171171, 42254} -> {-61952, 171176, 52373}
[2022.04.15-07.19.16:956][430]LogLevel: WORLD TRANSLATION END {-61952, 171176, 52373} took 0.6555 ms
[2022.04.15-07.19.17:078][443]LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Win64-Debug.exe
[2022.04.15-07.19.17:078][443]LogMemory: Platform Memory Stats for WindowsNoEditor
[2022.04.15-07.19.17:078][443]LogMemory: Process Physical Memory: 799.73 MB used, 850.61 MB peak
[2022.04.15-07.19.17:078][443]LogMemory: Process Virtual Memory: 1641.92 MB used, 1690.15 MB peak
[2022.04.15-07.19.17:078][443]LogMemory: Physical Memory: 11769.17 MB used,  20808.00 MB free, 32577.17 MB total
[2022.04.15-07.19.17:078][443]LogMemory: Virtual Memory: 134186720.00 MB used,  31011.47 MB free, 134217728.00 MB total
[2022.04.15-07.19.19:218][123]Message dialog closed, result: Ok, title: The UE4-MyViewPort Game has crashed and will close, text: Fatal error!


[2022.04.15-07.19.19:258][133]LogThreadingWindows: Error: Runnable thread TaskGraphThreadNP 0 crashed.
[2022.04.15-07.19.19:258][133]LogWindows: Error: === Critical error: ===
[2022.04.15-07.19.19:258][133]LogWindows: Error: 
[2022.04.15-07.19.19:258][133]LogWindows: Error: Fatal error!
[2022.04.15-07.19.19:258][133]LogWindows: Error: 
[2022.04.15-07.19.19:258][133]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000010008
[2022.04.15-07.19.19:258][133]LogWindows: Error: 
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64b622a6b MyViewPort.exe!rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>::Malloc_mem() [F:\Branch\Common\include\JsonPack\rapidjson\allocators.h:194]
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64b6223d7 MyViewPort.exe!rapidjson::GenericDocument<rapidjson::UTF8<char>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>,rapidjson::CrtAllocator>::EndObject() [F:\Branch\Common\include\JsonPack\rapidjson\document.h:2467]
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff650199f39 MyViewPort.exe!rapidjson::GenericReader<rapidjson::UTF8<char>,rapidjson::UTF8<char>,rapidjson::CrtAllocator>::ParseObject<0,rapidjson::EncodedInputStream<rapidjson::UTF8<char>,rapidjson::MemoryStream>,rapidjson::GenericDocument<rapidjson::UTF8<char>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>,rapidjson::CrtAllocator> >() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff6501991ec MyViewPort.exe!rapidjson::GenericReader<rapidjson::UTF8<char>,rapidjson::UTF8<char>,rapidjson::CrtAllocator>::ParseArray<0,rapidjson::EncodedInputStream<rapidjson::UTF8<char>,rapidjson::MemoryStream>,rapidjson::GenericDocument<rapidjson::UTF8<char>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>,rapidjson::CrtAllocator> >() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff6501991ec MyViewPort.exe!rapidjson::GenericReader<rapidjson::UTF8<char>,rapidjson::UTF8<char>,rapidjson::CrtAllocator>::ParseArray<0,rapidjson::EncodedInputStream<rapidjson::UTF8<char>,rapidjson::MemoryStream>,rapidjson::GenericDocument<rapidjson::UTF8<char>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>,rapidjson::CrtAllocator> >() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff650199e8f MyViewPort.exe!rapidjson::GenericReader<rapidjson::UTF8<char>,rapidjson::UTF8<char>,rapidjson::CrtAllocator>::ParseObject<0,rapidjson::EncodedInputStream<rapidjson::UTF8<char>,rapidjson::MemoryStream>,rapidjson::GenericDocument<rapidjson::UTF8<char>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>,rapidjson::CrtAllocator> >() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff65019a064 MyViewPort.exe!rapidjson::GenericDocument<rapidjson::UTF8<char>,rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>,rapidjson::CrtAllocator>::ParseStream<0,rapidjson::UTF8<char>,rapidjson::EncodedInputStream<rapidjson::UTF8<char>,rapidjson::MemoryStream> >() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff650205e17 MyViewPort.exe!Cesium3DTilesSelection::Tileset::LoadTilesetDotJson::start() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff650204d63 MyViewPort.exe!async::detail::task_func<CesiumAsync::Impl::ImmediateScheduler<CesiumAsync::Impl::QueuedScheduler>,async::detail::continuation_exec_func<CesiumAsync::Impl::ImmediateScheduler<CesiumAsync::Impl::QueuedScheduler>,async::task<std::exception_ptr>,std::optional<Cesium3DTilesSelection::TilesetLoadFailureDetails>,<lambda_e5b056bfffed655b235ff816f48e0f65>,std::integral_constant<bool,1>,0>,std::optional<Cesium3DTilesSelection::TilesetLoadFailureDetails> >::run() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff650245b80 MyViewPort.exe!CesiumAsync::Impl::ImmediateScheduler<CesiumAsync::Impl::TaskScheduler>::SchedulerScope::~SchedulerScope() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64b685cef MyViewPort.exe!TGraphTask<FAsyncGraphTask>::ExecuteTask() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64b696b17 MyViewPort.exe!FTaskThreadAnyThread::ProcessTasks() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64b697c60 MyViewPort.exe!FTaskThreadAnyThread::ProcessTasksUntilQuit() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64b69d735 MyViewPort.exe!FTaskThreadAnyThread::Run() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64bb7a25f MyViewPort.exe!FRunnableThreadWin::Run() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ff64bb72520 MyViewPort.exe!FRunnableThreadWin::GuardedRun() []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ffe2b0f7034 KERNEL32.DLL!UnknownFunction []
[2022.04.15-07.19.19:258][133]LogWindows: Error: [Callstack] 0x00007ffe2c662651 ntdll.dll!UnknownFunction []
[2022.04.15-07.19.19:258][133]LogWindows: Error: 
[2022.04.15-07.19.19:258][133]LogWindows: Error: Crash in runnable thread TaskGraphThreadNP 0
[2022.04.15-07.19.19:267][136]LogExit: Executing StaticShutdownAfterError
[2022.04.15-07.19.19:267][136]LogWindows: FPlatformMisc::RequestExit(1)
[2022.04.15-07.19.19:268][136]LogCore: Engine exit requested (reason: Win RequestExit)
[2022.04.15-07.19.19:293][136]Log file closed, 04/15/22 15:19:19

It seems that it also called the rapidjson. And it happened only when loading tileset from URL.
Is there any solusion now?

Hi V2i,
I also meet a similar problem. Can you tell me how did you fix it before?
Thanks a lot !

Hi @ColeMan,

Can you try updating to the newest version of Cesium for Unreal? I recommend you make a backup of your project before updating. Let me know if the crash still persists in the newest version.

Hi,
This issue still persists in 2023 latest version in unreal engine 5.1, I use game analaytics plugin with cesium and it says fatal error with the same errors when packaged the game.

is there a way to fix this issue?

This is a really difficult problem to solve. Presumably the game analytics plugin also uses RapidJSON, and it uses a different version than Cesium for Unreal uses. When you use both plugins together, the Unreal Build Tool slams all the code in all the plugins into one symbol namespace. So Cesium ends up using the other plugin’s version of RapidJSON, or vice-versa. The only solution that I know of is to ensure that both plugins are using the same version of RapidJSON. In theory you can recompile Cesium for Unreal to use a different version of RapidJSON, but that may or may not be an easy thing to do.

Is the game analytics plugin you mentioned shipped with Unreal, or is it something you’ve installed separately?