iTunes hangs during playback, then asserts: main thread holds an iTunes.exe critical section (desktop, wine-11.20) #15
Labels
No labels
bug
Claude
deferred
enhancement
epic
implementation
priority/high
priority/low
priority/med
research
verification
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iTunes/iTunes.Wine#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
iTunes 12.13.11.1 64-bit on the desktop (Fedora
wine-11.20Staging, the freshinstall.shprefix from 2026-10-29 07:25) hung during playback, then crashed. The operator was only playing music (Apple Music streaming, judging bySubscriptionPlayCache), with no device plugged in.Evidence is from
journalctl --user, unitapp-itunes\x2dwine@…, processenv[18495]:0024) logsUiaRaiseAutomationPropertyChangedEvent … 30047about every 500 ms with an increasing value, which is the playhead advancing. Then it goes silent and playback stops.04f4and04dcboth logerr:sync:RtlpWaitForCriticalSection section 00000001420ADC10 "?" wait timed out …, blocked by 0024. Wine prints that after a 5 s wait, so they have been blocked since about 07:30:39. They log it again at 07:31:44.iTunes.exe's own image (140000000–142593000).04a8and04e0are the audio threads, the ones that callAvSetMmThreadCharacteristicsW("Pro Audio")for each track.04dcwas created just before04e0.Assertion failed at address 0000000140B07004 (thread 0024)(STATUS_ASSERTION_FAILURE, which is iTunes' own check failing, not Wine's).rbx=1420adc50,r14=1420adc00andr15=1420adcf0all point into the structure holding that critical section.itunes+0xb07004 ← +0xb07190 ← +0xb077ae ← +0xb07fdd ← +0xaf5dd0 ← +0xcb2568 ← … ← corefoundation+0x8cee6(a CFRunLoop callout)← itunes+0x25e51d ← … ← kernel32.winedbg --autostayed attached to the dead process untilwineserver -k. The library (iTunes Library.itl) was last saved at 07:28:41.winepulls inwine-dxvk, and a D3D11 device was created at 07:30:11. UNKNOWN whether that matters.This is a different signature from the two crashes in
KNOWLEDGE.md→ Update check in CI, which were page faults.Why it matters: playback is a required feature, and this kills it with no error message.
Done when: it is reproduced with
WINEDEBUG=+seh,+sync(or+relayscoped tontdll) and the lock holder's stack at the moment of the hang is known. Either a workaround is found (for example a Wine version, a DLL override, or DXVK off viaWINEDLLOVERRIDES=d3d11,dxgi=b), or it is recorded as an UNKNOWN cause with the measured frequency.Second hang, 2026-10-29 07:37:52 (same session pattern: playing music, then the authorize dialog). This time there was no crash and no critical-section timeout. iTunes stayed up with no CPU use. I ran
winedbgwithattach 0x20/bt all/detach; the full dump is on the desktop, not committed.0024(main),03c8and03d0. Each is initunes+0xb07264, the return address of aSignalObjectAndWait(signal=?, wait=<its own handle>, INFINITE, FALSE)call. The wait handles are0xE70,0x130and0x5B4. All three are reached throughitunes+0xb077ae.iTunes.exe12.13.11.1,0x140b070f0): a user-mode thread scheduler that passes a baton between threads.0x1420adc00: magic'lock'(0x6c6f636b), owner tid, recursion count, then the CRITICAL_SECTION0x1420adc10from the first hang.0x1420adc48is the current thread, and the run queues hold time quanta stored as doubles.0x140b06e40), sets it as current, and leaves the critical section. It then callsSignalObjectAndWait(next->[0xc8], self->[0xc8], INFINITE, FALSE): it wakes the next thread's event and sleeps on its own.0x140b07004, is in0x140b06f00, the run-queue update called just before the pick. The instruction there is an ordinaryinclinto.data, not anint 0x2c. UNKNOWN why Wine reported STATUS_ASSERTION_FAILURE there. The first hang had the main thread holding0x1420adc10for about 90 s while inside this code, so that hang was the scheduler stuck inside its own lock./dev/ntsyncexists (crw-rw-rw-), and every waiting thread'swchanisntsync_schedule. Fedora's ntdll implementsNtSignalAndWaitForSingleObjectasinproc_signal_and_wait, and the ntsync driver has no combined signal-and-wait operation. So on this setup the signal and the wait are two separate steps, whereas on Windows they happen as one. UNVERIFIED that this loses the baton, since an event that is signalled early should stay signalled.Next test: the same use with ntsync unavailable (
/dev/ntsyncmode 000 until reboot), so wineserver does the waits itself. If hours of playback pass without a hang, while it hangs within minutes with ntsync, that points at ntsync.With ntsync off, authorization works (2026-10-29 07:46).
chmod 000 /dev/ntsync(it comes back at reboot), and iTunes was restarted afterwineserver -k. Its threads now wait inanon_pipe_readandfutex_do_wait, neverntsync_schedule, and wineserver holds no/dev/ntsyncfd.SC Info.sidbwent from 0 bytes to 3365, andSC Info.sidd(200356 bytes) appeared, both at 07:46:19.If it holds, the fix in
install.shis to keep this prefix off ntsync. It also needs a way to do that without root: Fedora's Wine has no switch for it (strings ntdll.soshows no sync env var), so this is still open.