# Lightmass Crash in 4.18 P1

**URL:** <https://forums.unrealengine.com/t/lightmass-crash-in-4-18-p1/405516>\
**Category:** Rendering\
**Tags:** static-lights, lightmass-crash, unreal-engine, crash, Lighting, question\
**Created:** [September 29, 2017, 12:43pm UTC](https://forums.unrealengine.com/t/lightmass-crash-in-4-18-p1/405516 "2017-09-29T12:43:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pax\_invictus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pax\_invictus](https://forums.unrealengine.com/u/pax_invictus)\
**Post date:** [September 29, 2017, 12:43pm UTC](https://forums.unrealengine.com/t/lightmass-crash-in-4-18-p1/405516/1 "2017-09-29T12:43:30Z")

</div>

## FINAL UPDATE

I think I figured out exactly what the cause of the crash is, namely:

_setting “Cast shadow as masked” on a material applied to any static mesh_

Steps to reproduce:

- Create a new Blank project, no starter content
- Create a new material. Simply create it, don’t even open it.
- Apply newly created material to the Floor mesh - it turns black
- Build lighting. As expected, build succeeds
- Open the new material
- In its properties (to the left) under Lighmass Settings, check “Cast Shadow as Masked” and save the material
- Build lighting

Expected: lighting built successfully  
Actual outcome: lightmass crashes

Feel free to completely ignore everything below. I’m leaving it for completeness.

================

**UPDATE**

I’ve got a repro! After a lot of triangulation, I managed to isolate the offending static mesh asset. Attached is a zipped up minimal project.

Also, the error is now a little more informative and includes this line:

```
Fatal error: [File:D:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Programs\UnrealLightmass\Private\Lighting\LightingSystem.cpp] [Line: 1338] 

```

A thing to note about this static mesh is that UV1 is messed up, however the lightmap index is set to UV2, which is okay (auto-unwrapped). UV0 is fine.

Everything in this project is otherwise unmodified/default. Started with a Blank project, with no starter content. Deleted the Directional Light, added a stationary spot light and the offending static mesh actor to the scene.

**Steps to repro**

Simply open up the project and press the Build button (or building lighting).  
Expected outcome: Successfully built lighting  
Actual outcome: Lightmass crashes

Hopefully this helps!

link text

**Update 2**

Noticed that replacing the material in the second material slot (Element 1) with a non-emissive one (M\_Basic\_Wall, included in the project), building the lights succeeds. This is odd, since the SM actor is _not_ set to use emissive for static lighting, therefore emissive should not factor into the lightmap rendering.

===============

**Original**

This is a project converted from 4.17. Log output does not tell me a lot.  
Tried:

- Force No Precomputed Lighting to clear the lightmaps, built lights once - lightmaps cleared. Building lighting after re-enabling precomputed lighting, same crash occurs.
- Created a new project - VR template. Verified that skylight is static, built lighting - no problem.

Not sure what else to try. Let me know if you have suggestions on how to figure out the cause. Here’s the log:

```
8:25:45 AM: Starting up SwarmAgent ...
8:25:45 AM: ... registering SwarmAgent with remoting service
8:25:45 AM: ... registering SwarmAgent network channels
8:25:45 AM: ... initializing SwarmAgent
8:25:45 AM: ......... certificate check has failed
8:25:45 AM: ...... initializing cache
8:25:45 AM: ......... using cache folder 'C:/Users/Yanko/AppData/Local/UnrealEngine/4.18/Saved/Swarm\SwarmCache'
8:25:45 AM: ......... recreating SwarmAgent cache staging area
8:25:45 AM: ...... initializing connection to SwarmCoordinator
8:25:45 AM: ......... using SwarmCoordinator on RENDER-01
8:25:48 AM: ......... SwarmCoordinator failed to be initialized
8:25:48 AM: ...... initializing local performance monitoring subsystem
8:25:48 AM: ... initialization successful, SwarmAgent now running
8:25:48 AM: [Interface:TryOpenConnection] Local connection established
8:25:49 AM: [Job] Accepted Job 92BB5403-48335EFF-B421CEBA-412E36CB
8:25:50 AM: [Job] Launched Job UnrealLightmass_2017-09-26_14-52-24_1188800-64bit.exe
8:25:50 AM: [Job] PID is 18284
8:25:50 AM: [Job] GUID is "92BB5403-48335EFF-B421CEBA-412E36CB"
8:25:50 AM: LogLightmass: Display: Lightmass Win64 started on: AENAR. Command-line: 92BB540348335EFFB421CEBA412E36CB
8:25:50 AM: Failed to determine engine directory: Defaulting to ../../../Engine/
8:25:50 AM: Failed to load 'aqProf.dll' (GetLastError=126)
8:25:50 AM: File 'aqProf.dll' does not exist
8:25:50 AM: Failed to load 'VtuneApi.dll' (GetLastError=126)
8:25:50 AM: File 'VtuneApi.dll' does not exist
8:25:50 AM: Failed to load 'VtuneApi32e.dll' (GetLastError=126)
8:25:50 AM: File 'VtuneApi32e.dll' does not exist
8:25:50 AM: Lightmass Win64 started on: AENAR. Command-line: 92BB540348335EFFB421CEBA412E36CB
8:25:50 AM: LogLightmass: Display: Processing scene GUID: 92BB540348335EFFB421CEBA412E36CB with 10 threads
8:25:50 AM: Processing scene GUID: 92BB540348335EFFB421CEBA412E36CB with 10 threads
8:25:50 AM: Building static lighting...
8:25:50 AM: [OpenConnection] Registering TCP channel ...
8:25:50 AM: [OpenConnection] Connecting to agent ...
8:25:50 AM: [TryOpenConnection] Testing the Agent
8:25:50 AM: [TryOpenConnection] Opening Connection to Agent
8:25:50 AM: [TryOpenConnection] Local Process ID is 18284
8:25:50 AM: [Job] Found a parent connection for PID 18284
8:25:50 AM: [Job] 0DABB73A -> 28202E7F
8:25:50 AM: [Interface:TryOpenConnection] Local connection established
8:25:50 AM: Skylight import processing 0.010s with CubemapSize 128
8:25:53 AM: Measured CPU frequency: 3.40 GHz
8:25:53 AM: FStaticLightingSystem started using GKDOPMaxTrisPerLeaf: 4
8:25:53 AM: Number of texture mappings: 1065
8:25:53 AM: Number of fluid mappings: 0
8:25:53 AM: Number of landscape mappings: 0
8:25:53 AM: Number of BSP mappings: 6
8:25:53 AM: Number of static mesh instance mappings: 1065
8:25:54 AM: Scene surface area calculated at 555.549 million units (65.446% of the estimated 848.866 million units)
8:25:54 AM: Importance volume surface area calculated at 552.390 million units (228.327% of the estimated 241.930 million units)
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: Collision Mesh Overview:
8:25:55 AM: Num Triangles : 2033893
8:25:55 AM: MeshInfos : 0.1Mb
8:25:55 AM: UVs : 32.5Mb
8:25:55 AM: LightmapUVs : 32.5Mb
8:25:55 AM: Embree Used Memory : 153.2Mb
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: Processing...
8:25:55 AM: Exception handled in main, crash report generated, re-throwing exception
8:25:55 AM: Exception handled in main, calling appHandleCriticalError
8:25:55 AM: LogLightmass: Error: === Critical error: === Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000002
8:25:55 AM: 
8:25:55 AM: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000002
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: 0x00000000DF66CEF0 UnrealLightmass-Core.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBD94E6C UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBD93BA8 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DF297EA6 embree.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DEDC8AD0 embree.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBDA94E4 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBDFBC7F UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBDFB652 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBE1CF18 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DF8F737C UnrealLightmass-Core.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DF8E7C63 UnrealLightmass-Core.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x000000004E282774 KERNEL32.DLL!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000503B0D51 ntdll.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000503B0D51 ntdll.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: === Critical error: === Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000002
8:25:55 AM: 
8:25:55 AM: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000002
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: 0x00000000DF66CEF0 UnrealLightmass-Core.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBD94E6C UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBD93BA8 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DF297EA6 embree.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DEDC8AD0 embree.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBDA94E4 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBDFBC7F UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBDFB652 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000CBE1CF18 UnrealLightmass.exe!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DF8F737C UnrealLightmass-Core.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000DF8E7C63 UnrealLightmass-Core.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x000000004E282774 KERNEL32.DLL!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000503B0D51 ntdll.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 0x00000000503B0D51 ntdll.dll!UnknownFunction []
8:25:55 AM: 
8:25:55 AM: 
8:25:55 AM: LogWindows: Warning: CreateProc failed (2) ../DotNET/AutoReporter.exe 18284 "UE4AutoReportDump.txt" "UnrealLight_AENAR_6EA7C72B46E64EDE84CE91AAD9D35F60.log" "UE4AutoReportIniDump.txt" "" -unattended
8:25:55 AM: CreateProc failed (2) ../DotNET/AutoReporter.exe 18284 "UE4AutoReportDump.txt" "UnrealLight_AENAR_6EA7C72B46E64EDE84CE91AAD9D35F60.log" "UE4AutoReportIniDump.txt" "" -unattended
8:25:55 AM: LogLightmass: Error: Couldn't start up the Auto Reporting process!
8:25:55 AM: Couldn't start up the Auto Reporting process!
8:25:55 AM: *** CRITICAL ERROR! Machine: AENAR
8:25:55 AM: *** CRITICAL ERROR! Logfile: UnrealLight_AENAR_6EA7C72B46E64EDE84CE91AAD9D35F60.log
8:25:55 AM: *** CRITICAL ERROR! Crash report: 
8:25:55 AM: [CloseConnection] Closing connection 28202E7F using handle 28202E7F
8:25:55 AM: [CloseConnection] Connection confirmed for disconnection 28202E7F
8:25:55 AM: [CloseConnection] Connection disconnected 28202E7F
8:25:55 AM: [GetMessage] Safely returning to 28202E7F with no message
8:25:56 AM: [MaintainConnections] Local connection has closed (28202E7F)
8:25:56 AM: [MaintainConnections] Removed connection 28202E7F
8:25:56 AM: [Job] Job has failed! Job executable didn't exit cleanly. Exit code: 1
8:25:56 AM: [CloseConnection] Closing connection 0DABB73A using handle 0DABB73A
8:25:56 AM: [CloseConnection] Connection confirmed for disconnection 0DABB73A
8:25:56 AM: [CloseConnection] Closing orphaned Job (92BB5403-48335EFF-B421CEBA-412E36CB)
8:25:57 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:25:57 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:25:58 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:25:58 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:25:59 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:25:59 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:26:00 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:26:00 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:26:01 AM: [MaintainConnections] Connection 0DABB73A is DISCONNECTING
8:26:01 AM: [CloseConnection] Connection disconnected 0DABB73A
8:26:01 AM: [GetMessage] Safely returning to 0DABB73A with no message
8:26:01 AM: [MaintainConnections] Local connection has closed (0DABB73A)
8:26:01 AM: [MaintainConnections] Removed connection 0DABB73A
8:26:01 AM: [MaintainConnections] All connections have closed
8:31:50 AM: [CleanCache] Clearing out the cache by user request
8:31:50 AM: [CleanCache] Cache successfully cleared
8:31:53 AM: [MaintainCache] Validating all cache entries and hashes
8:31:53 AM: [MaintainCache] Cache hashes validated and up to date

```

---

<div class="post-metadata">

**Author:** ![Stephen\_Ellis](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stephen_ellis/32/1225296_2.png) [@Stephen\_Ellis](https://forums.unrealengine.com/u/Stephen_Ellis)\
**Post date:** [October 4, 2017, 5:46pm UTC](https://forums.unrealengine.com/t/lightmass-crash-in-4-18-p1/405516/2 "2017-10-04T17:46:33Z")

</div>

I have moved this into the Bug Reports section. Thank you.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3622090e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3622090e](https://forums.unrealengine.com/u/anonymous_user_3622090e)\
**Post date:** [October 4, 2017, 7:53pm UTC](https://forums.unrealengine.com/t/lightmass-crash-in-4-18-p1/405516/3 "2017-10-04T19:53:04Z")

</div>

Hello,

Thanks for your report. I was able to recreate it and have sent in a report that you can track here [UE-50781](https://issues.unrealengine.com/issue/UE-50781).

Thanks,

---

<div class="post-metadata">

**Author:** ![pax\_invictus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pax\_invictus](https://forums.unrealengine.com/u/pax_invictus)\
**Post date:** [October 4, 2017, 10:16pm UTC](https://forums.unrealengine.com/t/lightmass-crash-in-4-18-p1/405516/4 "2017-10-04T22:16:34Z")

</div>

Awesome, thanks a lot !
