ntdll: Do not execute callbacks past DeleteTimer(INVALID_HANDLE_VALUE) (try 2)

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Wed Oct 31 06:42:16 CDT 2012


Hi,

You know this patch from March this year.

>sync.c:808: Test failed: Timer callback 0 expected 1 got 0
Francois' flaky test fooled me.  I did not notice that his test systematically
fails on my machine.  My patch changes nothing about that.  His test
uses event=NULL, my patch is solely about event=INVALID_HANDLE_VALUE.

The core of the bug is that the call
     status = NtCreateEvent
overwrites the preinitialisation
     NTSTATUS status = STATUS_PENDING;

[original March message:]

If you've run my CreateTimerQueue tests found on testbot, you'll have noticed that callbacks
are running in Wine even after DeleteTimerQueue(INVALID_HANDLE_VALUE).
That is not supposed to happen.

This is no good and can cause mysterious and hard to reproduce crashes, as apps are
going to free resources after destruction of the timer queue.

I investigated the issue and here's a patch.
This bug has been in Wine since DeleteTimerQueue was added in 2008.

Perhaps that's why Andrew Eikum saw an improvement in wineoss after moving
away from using INVALID_HANDLE_VALUE.

Note that this affects EXECUTEINTIMERTHREAD above all. I've not investigated
native's event signaling behaviour when independent worker threads are used.

Regards,
 Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ntdll-Do-not-execute-callbacks-past-DeleteTimer-INV.patch
Type: application/octet-stream
Size: 1313 bytes
Desc: 0001-ntdll-Do-not-execute-callbacks-past-DeleteTimer-INV.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20121031/53af52c9/attachment.obj>


More information about the wine-patches mailing list