http://bugs.winehq.org/show_bug.cgi?id=13723
Summary: Sound buffer freed by both winealsa.drv and dsound Product: Wine Version: CVS/GIT Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
So, who owns the buffer? Looks like dsound and winealsa.drv are having a little argument here. This doesn't happen on every run, but it seems kinda bad:
$ cd dlls/dsound/tests $ RUNTEST_USE_VALGRIND=1 ../../../tools/runtest -P wine -M dsound.dll -T ../../.. -p dsound_test.exe.so ds3d.c
...
Invalid free() / delete / delete[] at notify_free (heap.c:199) by RtlFreeHeap (heap.c:1284) by DirectSoundDevice_Release (dsound.c:1285) by IDirectSoundImpl_Release (dsound.c:304) by IDirectSound_IDirectSound_Release (dsound.c:442) by test_for_driver (ds3d.c:1004) by dsenum_callback (ds3d.c:1281) by DirectSoundEnumerateA (dsound_main.c:315) by ds3d_tests (ds3d.c:1324) by func_ds3d (ds3d.c:1344) by run_test (test.h:421) by main (test.h:470) Address 0x466ef78 is 0 bytes inside a block of size 65,536 free'd at free (vg_replace_malloc.c:323) by snd_pcm_munmap (in /usr/lib/libasound.so.2.0.0) by snd_pcm_hw_free (in /usr/lib/libasound.so.2.0.0) by snd_pcm_generic_hw_free (in /usr/lib/libasound.so.2.0.0) by snd_pcm_hw_free (in /usr/lib/libasound.so.2.0.0) by (within /usr/lib/libasound.so.2.0.0) by snd_pcm_hw_free (in /usr/lib/libasound.so.2.0.0) by snd_pcm_close (in /usr/lib/libasound.so.2.0.0) by IDsDriverBufferImpl_Release (dsoutput.c:274) by DSOUND_PrimaryClose (primary.c:299) by DSOUND_PrimaryDestroy (primary.c:331) by DirectSoundDevice_Release (dsound.c:1268) by IDirectSoundImpl_Release (dsound.c:304) by IDirectSound_IDirectSound_Release (dsound.c:442) by test_for_driver (ds3d.c:1004) by dsenum_callback (ds3d.c:1281) by DirectSoundEnumerateA (dsound_main.c:315) by ds3d_tests (ds3d.c:1324) by func_ds3d (ds3d.c:1344) by run_test (test.h:421)
http://bugs.winehq.org/show_bug.cgi?id=13723
--- Comment #1 from Dan Kegel dank@kegel.com 2008-06-06 07:05:10 --- Maarten says "If it was created with USESYSTEMMEMORY, then dsound created the buffer, if not, alsa owns it."
OK. Patch sent. Here's a copy for review, since the archive seems slow:
diff -u a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c @@ -1282,7 +1282,8 @@ ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
HeapFree(GetProcessHeap(), 0, device->tmp_buffer); HeapFree(GetProcessHeap(), 0, device->mix_buffer); - HeapFree(GetProcessHeap(), 0, device->buffer); + if (device->drvdesc.dwFlags & DSDDESC_USESYSTEMMEMORY) + HeapFree(GetProcessHeap(), 0, device->buffer); RtlDeleteResource(&device->buffer_list_lock); device->mixlock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&device->mixlock);
I'm no expert, but hey, it worked...
http://bugs.winehq.org/show_bug.cgi?id=13723
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2008-06-09 21:57:04 --- This is already fixed from what I remember.
http://bugs.winehq.org/show_bug.cgi?id=13723
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |
--- Comment #3 from Dan Kegel dank@kegel.com 2008-06-09 22:06:56 --- Good memory, but the change you're thinking of http://source.winehq.org/git/wine.git/?a=commitdiff;h=84fd6e629a05a87cf788cf... is for a different instance of the bug. I've definitely seen the problem since then, and I need my patch in the tree to avoid it.
http://bugs.winehq.org/show_bug.cgi?id=13723
--- Comment #4 from knan-wine@anduin.net 2008-09-18 18:59:33 --- The patch is in, since 2008-06-21 and wine-1.1.0. Close?
http://bugs.winehq.org/show_bug.cgi?id=13723
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED
--- Comment #5 from Dan Kegel dank@kegel.com 2008-09-18 19:43:28 --- http://source.winehq.org/git/wine.git/?a=commit;h=025457e09be09b7a410feaa462...
Yeah, looks fixed, thanks.
http://bugs.winehq.org/show_bug.cgi?id=13723
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2008-09-19 11:17:26 --- Closing bugs fixed in 1.1.5.
http://bugs.winehq.org/show_bug.cgi?id=13723
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified