# Lightmass crashed

**URL:** <https://community.cesium.com/t/lightmass-crashed/32544>\
**Category:** Cesium for Unreal\
**Created:** [May 29, 2024, 2:30pm UTC](https://community.cesium.com/t/lightmass-crashed/32544 "2024-05-29T14:30:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![candy](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/candy/32/23784_2.png) [@candy](https://community.cesium.com/u/candy)\
**Post date:** [May 29, 2024, 2:30pm UTC](https://community.cesium.com/t/lightmass-crashed/32544/1 "2024-05-29T14:30:19Z")

</div>

I cant do build. Lightmass keeps crashing and I dont know what is the problem. I tried to build it on starter map when unreal 4.27 is opend. I recently started development using blueprints. Here is the error

= Lightmass crashed nhandled Exception: EXCEPTION\_ACCESS VIOLATION writing address 0x0000000000000020  
Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Programs/Unreallightmass/Private/Lighting/LightingSystem.cpp] [Line: 1458  
Static lighting thread exception  
Unhandled” Exception: EXCEPTION ACCESS\_VIOLATION writing address 0x0000000000000020

0x00007f805c41950 VCRUNTIME140.d11!UnknownFunction [1

0x00007f658e231df Unreallightmass.exe!Lightmass: :FStaticLightingSystem: :ProcessTextureMapping() [1  
0x00007f658e099e4 Unreallightmass.exe!Lightmass: : FStaticLightingSystem: : ThreadLoop()  
0x00007ff658e04ce3 Unreallightmass.exe!Lightmass: : FilappingProcessingThreadRunnable: :Run() [1  
0x00007f£708a9327 Unreallightmass-Core.dI1!UnknownFunction

0x00007ff708a0a40 Unreallightmass-Core.d11!UnknownFunction [1

0x00007ff81e30257d KERNEL32.DLL!UnknownFunction [1

0x00007ff81f2aaad8 ntdll.d1l!UnknownFunction

0x00007f6584f9476 Unreallightmass.exe!Lightmass: :FStaticLightingSystem: :MultithreadProcess() [1  
0x00007f658dc8814 Unreallightmass.exe!Lightmass: :FStaticLightingSystem: :FStaticLightingSystem() [1  
0x00007f658d7aa69 Unreallightmass.exe!Lightmass: :BuildStaticLighting() [1

0x00007f658da17f7 Unreallightmass.exe!Lightmass: :LightmassMain() [1

0x00007f658dc09d3 Unreallightmass.exelmain() [1

0x00007f658293d4 Unreallightmass.exe! \_scrt\_common\_main\_seh() [1

0x00007ff81e30257d KERNEL32.DLL!UnknownFunction [1

0x00007ff81f2aaad8 ntdll.d1l!UnknownFunction

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [May 30, 2024, 7:45am UTC](https://community.cesium.com/t/lightmass-crashed/32544/2 "2024-05-30T07:45:21Z")

</div>

Hi @candy,  
We fixed a lightmass-related bug in Cesium for Unreal v1.29.0:

> <https://github.com/CesiumGS/cesium-unreal/blob/main/CHANGES.md#v1290---2023-08-01>

However, the latest version that is available for UE 4.27 is v1.24.0:

> <https://github.com/CesiumGS/cesium-unreal/blob/main/CHANGES.md#v1240---2023-04-03>

Consistent with Epic’s Marketplace rules, we only release new versions of Cesium for Unreal for the 3 most recent Unreal Engine versions (currently 5.2, 5.3, and 5.4). So we highly recommend you upgrade your UE version.

If you can’t do that, your only other option is to backport the fix to your version and build it manually. The pull request that fixed the bug is here:

> <https://github.com/CesiumGS/cesium-unreal/pull/1181>
>
> Fixes #1180 
> 
> UnrealLightmass.exe is a separate process run via Swarm when bui…lding lighting. As reported in #1180, it (always? usually?) crashes when we attempt to build lighting (Build -\> Build Lighting Only) for a level that has a Cesium3DTileset in it. Unfortunately it's build without any debug symbols, so I had to build it myself to debug it.
> 
> Having done that, I learned that the problem is that every \`FStaticMeshLightingMesh\` pointed to the same \`FStaticMesh\` instance, which really couldn't be right. And I learned that that was happening because, on import, all the static mesh references had the same GUID (all zeros!). Ok, so the problem seemed to be back in the Unreal Editor on the export side.
> 
> So, I traced through the code that exported the lightmass data, and yep, it was writing a GUID of all zeros. It got that GUID from a property on the \`UStaticMesh\` called \`LightingGuid\`. So how is that property set? I searched for it in the UE source code, and saw that things like \`DatasmithStaticMeshImporter\` call \`SetLightingGuid\` on the static just before they called \`InitResources\`. I added the same to our code that creates the static mesh in CesiumGltfComponent, and the lightmass crash went away.
> 
> I'll spare everyone the rant about how ridiculous it is that we have to call some random undocumented method on every static mesh we create in order to prevent UE's static lighting baking system from crashing. 🤷
