Lightmass Crash in 4.18 P1

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

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

Hello,

Thanks for your report. I was able to recreate it and have sent in a report that you can track here UE-50781.

Thanks,

Awesome, thanks a lot !