urlmon ftp protocol failures on Windows

Ge van Geldorp ge at gse.nl
Sun Mar 29 16:37:30 CDT 2009


Hi Jacek,

I've been investigating the failures in the urlmon ftp protocol tests that
show up on quite a few WinXP and higher machines. It seems to me that there
is an inherent race condition in the test.
The main thread waits in line 1822 until IInternetProtocolSink_Switch has
been called. It will then call CHECK_CALLED(Switch) and SET_EXPECT(Switch).
However, nothing prevents a background thread from calling
IInternetProtocolSink_Switch again before SET_EXPECT(Switch) in the main
thread is complete. In fact, if I add a Sleep(100) between the
WaitForSingleObject() in line 1822 and the CHECK_CALLED() on the next line,
the failures that show up now and then on test.winehq.org become
reproducible every time.
I believe the attached patch fixes the problem, it breaks the current
assumption that there's a 1:1 relationship between
IInternetProtocolSinc_Switch() and IInternetProtocol_Read() calls. Before
shipping it off to wine-patches, I'd like your opinion, do you think this is
the correct solution?

Thanks, Ge.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: protocol.patch
Type: application/octet-stream
Size: 1314 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090329/c9b66b0c/attachment.obj>


More information about the wine-devel mailing list