Search Issue Tracker
Fixed in 2020.3.37f1, 2021.3.5f1, 2022.1.6f1, 2022.2.0a10
Memory access violation in LightProbesManager when appending LightProbes objects with overlaps twice
Steps to reproduce:
1. Open the attached project (JapanOffice.zip);
2. In the opened popup window for prompting to change Project setting press Cancel button;
3. Ensure that in the Hierarchy there are several scenes loaded additively; if there are none, load those scenes manually;
4. In the Hierarchy select any scene other than the active scene (e.g. NoonB) and double-click on it;
5. Repeat step 4 5-6 times;
6. Enter Play mode.
Expected result: Play mode launches without crashes.
Actual result: Editor crashes
Reproducible with: 2021.2.0b15, 2021.2.4f, 2022.1.0a9, 2022.1.0a16
Not reproducible with: 2019.4.33f1, 2020.3.23f1, 2021.2.0b14, 2022.1.0a8
- Reproducible on Windows (by following the repro steps) and macOS (after just opening the repro project);
- The crash might not reproduce every time; if it doesn't try exiting Play mode after step 6 or repeat the initial steps once again with different timings between actions;
- The crash might produce different stack traces on different versions.
- First few lines of a stacktrace:
0x00007ff76b9aed85 (Unity) `anonymous namespace'::CombineMeshFiltersForStaticBatching
0x00007ff76b9ae6f8 (Unity) StaticBatching::CombineAllStaticMeshesInSceneForStaticBatching
0x00007ff76b4174c9 (Unity) StaticBatchingEditorHelper_CUSTOM_CombineAllStaticMeshesForScenePostProcessing
0x000001a845246391 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.StaticBatchingEditorHelper:CombineAllStaticMeshesForScenePostProcessing (ulong)
0x000001a845245983 (Mono JIT Code) UnityEditor.UnityBuildPostprocessor:OnProcessScene
Probable Root Cause:
When reproing this we found what seemed like random callstack at each crash. Further investigation suggests that this is because LightProbesManager#Append() can write beyond the range of its allocated memory (see the memcpy involving m_BakedCoefficients inside Append()). By doing this it effectively caused undefined behaviour (including sometimes crashing the editor).
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- The <sprite> tag inserted image from a Sprite Asset into the UI Builder Button disappears when the Inlined Style Text Shadow Horizontal or Vertical Offset is set to be more than 0 px
- Build fails when building with ILCPP Scripting Backend and ARMv7 as the Target Architecture
- Textures turn black in Player when they are referenced by a script instance
- [Android] Virtual device crashes with "Scudo ERROR: invalid chunk state when deallocating address" error in Firebase Test Lab when Optimized Frame Pacing is enabled
- Particle System does not resume when its Culling Mode is set to "Pause" or "Pause and Catch-up," and particle position simulate in world space