SMATCH: missing LeaveCriticalSection in error path

Michael Stefaniuc mstefani at redhat.de
Sun Feb 23 15:09:26 CST 2003


On Sun, Feb 23, 2003 at 11:39:33AM +0800, Dmitry Timoshkov wrote:
> Michael, I'm just curious, how hard it would be to adapt your SMATCH
> script for finding EnterCriticalSection/LeaveCriticalSection pair
> matching to do a similar work with wine_tsx11_lock/wine_tsx11_unlock,
> GDI_GetObjPtr/GDI_ReleaseObj, DC_GetDC[Ptr|Update]/GDI_ReleaseObj,
> USER_Lock/USER_Unlock, WIN_GetPtr/WIN_ReleasePtr, WIN_FindWndPtr/
> WIN_ReleaseWndPtr and some other internal Wine locks?
Not hard at all, I've created a new script
http://people.redhat.com/mstefani/wine/smatch/wine_locks.pl
that takes care of locks of the form:
  lock(this);
  do_something();
  unlock(this);
and put all of the above locking pairs into it. To add a new locking
pair all that's needed is to add an entry for it in the %locks hash.

Running wine_locks.pl requires this patch
http://people.redhat.com/mstefani/wine/smatch/smatch.pm.diff
for smatch.pm because it treats every ARGV entry as filename (i'll
contact the smatch author to find a solution that dosn't require this
hack).

Besides some NOTABUG's in the CriticalSection locking i found only this:
wine/windows/win.c 104 127 create_window_handle(31) 1 USER_Lock not
released
I'm not sure if it's a bug or not.

bye
	michael

-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20030223/f43261bf/attachment.pgp


More information about the wine-devel mailing list