Reproduction steps:
1. Open the attached “CrashRepro” project
2. Open the “Assets/Flooded_Grounds/Scenes/HorrorScene.unity“ scene
3. Click Window > Rendering > Lighting
4. Click Generate Lighting
Expected result: Unity Editor successfully generates the lightmaps for the scene
Actual result: Unity Editor crashes
Reproducible with: 2022.3.9f1, 2023.1.12f1, 2023.2.0b8, 2023.3.0a4
Not reproducible with: 2021.3.30f1
Reproducible on: Ubuntu 23.04, Windows 10 Pro 22H2
Not reproducible on: No other environment tested on
First lines of the stack trace:
0x00007FFD1AC18B40 (Unity) memcpy
0x00007FFD1831C162 (Unity) CachedWriter::Write
0x00007FFD1990CDF8 (Unity) LightingDataAsset::Transfer<StreamedBinaryWrite>
0x00007FFD186FFA25 (Unity) SerializedFile::WriteObject
0x00007FFD186EBFFE (Unity) PersistentManager::WriteFile
Note: couldn’t test more versions to find the regression because baking takes around 10 hours