Reproduction steps:
1. Add a command line argument “-showAudioFoundationUI”
2. Open the attached project “ReproProject”
3. Make sure that Audio Foundation option is set to “Enhanced“ (the option can be found at Edit → Project Settings → Audio → Audio Foundation)
4. Open the scene “SampleScene”
5. Connect headphones with microphone (can be wired or wireless)
6. Enter into the Play Mode
7. Wait up to 15-20 seconds
8. Observe the crash
Reproducible in: 6000.4.0a2, 6000.4.0b10, 6000.5.0a7
Not reproducible in: 6000.0.67f1, 6000.3.8f1, 6000.4.0a1, 6000.5.0a6
Reproducible on: macOS 26.2 (M1 Pro, M1 Max, M3 Pro, M3 Max, M4)
Not reproducible on: Windows 11
Notes:
- Also reproducible in Standalone Player for MacOS
- To add a command line argument in Unity Hub, navigate to Projects → [ReproProject] → Press the three-dots on the right → Add command line arguments
First few lines of the stack trace:
#0 0x000001082d78f8 in block_merge_next
#1 0x0000010829f0b0 in DynamicHeapAllocator::Deallocate(void*)
#2 0x0000010829d2c8 in DualThreadAllocator<DynamicHeapAllocator>::TryDeallocate(void*)
#3 0x000001082a5c18 in MemoryManager::TryDeallocateWithLabel(void*, MemLabelId, char const*, int)
#4 0x000001082a0190 in free_alloc_internal(void*, MemLabelId const&, char const*, int)
#5 0x00000106cf09e4 in PlatformAudio::SampleBuffer::FreeBuffers()