http://bugs.winehq.org/show_bug.cgi?id=32406
Bug #: 32406 Summary: dsound audible test randomly crashes (needs WINETEST_INTERACTIVE) Product: Wine Version: 1.5.19 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net Classification: Unclassified
Created attachment 42754 --> http://bugs.winehq.org/attachment.cgi?id=42754 backtrace + some of the test output preceding the crash
Please perform the dsound test in verbose and audible i.e. interactive mode, e.g. using the command line: ../../../tools/runtest -v -i -P wine -M dsound.dll -T ../../.. -p dsound_test.exe.so dsound.c or alternatively WINETEST_INTERACTIVE=1 make dsound.ok
The test may crash (perhaps in 7 out of 8 of invocations): dsound.c:490: Playing a 5 seconds reference tone at the current volume. [...] ds3d.c:503: Playing 5 second 440Hz tone at 48000x16x2 ds3d.c:513: Test failed: IDirectSound_SetCooperativeLevel(DSSCL_WRITEPRIMARY) failed: 88890008 =>0 DSOUND_timer+0xf0(timerID=0x1, msg=0, dwUser=0x11eb78, dw1=0, dw2=0) [.../dlls/dsound/../../include/audioclient.h:324] in dsound: movl 0x0(%eax),%ecx 324 return This->lpVtbl->GetCurrentPadding(This,pNumPaddingFrames);
There's no crash (or it becomes much less likely?) if you omit -v (aka. WINETEST_DEBUG) or -i (aka. WINETEST_INTERACTIVE).
http://bugs.winehq.org/show_bug.cgi?id=32406
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com
http://bugs.winehq.org/show_bug.cgi?id=32406
--- Comment #1 from Andrew Eikum aeikum@codeweavers.com 2012-12-10 10:19:36 CST --- I've tried 3 runs and it doesn't crash for me, but it looks like a race condition. The IAudioClient is NULL when GetCurrentPadding is called. A log with the channels from http://wiki.winehq.org/Sound might be useful if it doesn't turn into a heisenbug. Otherwise, we probably just need to look closely at how IAC is handled in dsound.
http://bugs.winehq.org/show_bug.cgi?id=32406
--- Comment #2 from Jörg Höhle hoehle@users.sourceforge.net 2012-12-12 09:34:41 CST --- Created attachment 42789 --> http://bugs.winehq.org/attachment.cgi?id=42789 log with warn+heap,+dsound,+tid and others
I think the log shows several bugs: - IDirectSound_SetCooperativeLevel failing, releasing mmdevapi but crashing DSound_timer (perhaps a bug in the tests?) - IsFormatSupported failing: warn:alsa:alsa_format Unsupported ValidBits: 0
and still there's some race condition, because the crash does not happen constantly. warn+heap doesn't change that.
All tests were performed on a single core machine, at lowest frequency.
http://bugs.winehq.org/show_bug.cgi?id=32406
--- Comment #3 from Andrew Eikum aeikum@codeweavers.com 2012-12-12 10:00:37 CST --- Created attachment 42790 --> http://bugs.winehq.org/attachment.cgi?id=42790 Patches to fix
These two patches should (doubly) fix the issue. They make dsound fill that member correctly, and winealsa be less strict about checking the value. The other drivers don't have this issue.
I think the race condition is dependent on whether dsound_Timer gets called in between iterations of the while() loop in <tests/ds3d.c>.
http://bugs.winehq.org/show_bug.cgi?id=32406
--- Comment #4 from Andrew Eikum aeikum@codeweavers.com 2012-12-12 10:03:50 CST --- To elaborate on that second point, if the call to SetCooperativeLevel fails, it leaves the dsound object in a broken state. This is a dsound bug, and a very long-standing one at that. Making SetCooperativeLevel less likely to fail (as these patches do) works around that problem.
http://bugs.winehq.org/show_bug.cgi?id=32406
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase Summary|dsound audible test |dsound randomly crashes |randomly crashes (needs |when SetCooperativeLevel |WINETEST_INTERACTIVE) |fails
--- Comment #5 from Jörg Höhle hoehle@users.sourceforge.net 2012-12-13 17:00:13 CST --- The dsound.c tests sound fine now. Your patches prevent the crash. I'm renaming the bug based on your last comment.
http://bugs.winehq.org/show_bug.cgi?id=32406
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |81d601f56fc5c84c7f517b9424a | |73e4788c784b8 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #6 from Andrew Eikum aeikum@codeweavers.com 2012-12-14 15:08:50 CST --- Fixed by 81d601f56fc5c84c7f517b9424a73e4788c784b8.
http://bugs.winehq.org/show_bug.cgi?id=32406
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org 2012-12-21 13:28:02 CST --- Closing bugs fixed in 1.5.20.