http://bugs.winehq.org/show_bug.cgi?id=14867
Summary: TrackMouseEvent thinko / valgrind warning? Product: Wine Version: CVS/GIT Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com
An app I'm looking at is doing TRACKMOUSEEVENT tme; tme.cbSize = sizeof(TRACKMOUSEEVENT); tme.dwFlags = TME_LEAVE; tme.hwndTrack = my_hWnd; TrackMouseEvent(&tme);
which causes the following valgrind complaint:
Conditional jump or move depends on uninitialised value(s) at TrackMouseEvent (input.c:1043) by MyTrackMouseLeave (in app) ... Uninitialised value was created by a stack allocation at MyTrackMouseLeave (in app)
Looking at git blame user32/input.c, I see line 1043 is the if: hover_time = ptme->dwHoverTime; if (hover_time == HOVER_DEFAULT || hover_time == 0 || !(ptme->dwHoverTime&TME_HOVER)) Squinting at that a bit, it get the feeling the bitmask check is a typo; shouldn't that be dwFlags, not dwHoverTime? Also, if TME_HOVER is not set, we probably shouldn't be looking at dwHoverTime, right?
FWIW, that bitmask check was added by http://www.winehq.org/pipermail/wine-patches/2006-October/031794.html
Incidentally, while playing around, I noticed that the test crashes if you get too many events. I'll attach a little patch to fail more gracefully.
http://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #1 from Dan Kegel dank@kegel.com 2008-08-14 17:18:38 --- Created an attachment (id=15416) --> (http://bugs.winehq.org/attachment.cgi?id=15416) Patch to make input.c test fail more gracefully if too many events
http://bugs.winehq.org/show_bug.cgi?id=14867
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=14867
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|patch |
--- Comment #2 from Dan Kegel dank@kegel.com 2008-08-14 21:49:34 --- That patch isn't a fix for the bug, so removing the patch keyword.
http://bugs.winehq.org/show_bug.cgi?id=14867
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mikolaj.zalewski@gmail.com
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2008-08-14 22:53:29 --- Add Mikołaj to the cc: list.
http://bugs.winehq.org/show_bug.cgi?id=14867
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified
--- Comment #4 from Austin English austinenglish@gmail.com 2009-01-20 02:39:58 --- Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
http://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #5 from Mikolaj Zalewski mikolaj.zalewski@gmail.com 2009-01-20 13:06:23 --- Created an attachment (id=18853) --> (http://bugs.winehq.org/attachment.cgi?id=18853) patch
It looks like a bug (found thanks to Valgrind). I have fixed it and also changed the order of checks so that hover_time is not read if the mode is not TME_HOVER. Does this make Valgrind happy?
http://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #6 from Dan Kegel dank@kegel.com 2009-11-27 19:08:31 --- Sorry for not getting back to you, Mikolaj!
The affected app is Google Chrome, the problem was still happening with the most recent source of wine and chrome, your patch still applies, and it seems to fix the problem. Can you submit the patch?
fwiw, the exact commands I used, after following the tips in http://winezeug.googlecode.com/svn/trunk/valgrind/doc/win32.html to build wine and valgrind, were:
svn checkout http://winezeug.googlecode.com/svn/trunk/ winezeug cd winezeug cat valgrind/valgrind-suppressions testsuites/chromium/chromium-valgrind-suppressions > ../supp.txt cd .. wget http://build.chromium.org/buildbot/snapshots/chromium-rel-xp/33231/chrome-wi... unzip chrome-win32.zip wget http://build.chromium.org/buildbot/snapshots/chromium-rel-xp/33231/chrome-wi... unzip chrome-win32-syms.zip cd chrome-win32 mv ../chrome-win32-syms/chrome_dll.pdb chrome.pdb /usr/local/valgrind-for-wine/bin/valgrind --trace-children=yes --track-origins=yes --workaround-gcc296-bugs=yes --suppressions=../supp.txt --leak-check=full --show-possible=no ~/wine-git/wine chrome --no-sandbox http://zilf.org > log.txt 2>&1
I then waited for zilf.org to show up, hit refresh a few times, and quit, then looked at log.txt.
http://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #7 from Mikolaj Zalewski mikolaj.zalewski@gmail.com 2010-01-24 16:21:09 --- I have tried to run it, but, so for, it doesn't work. I managed to start Chrome under Valgrind, in the logs I got a warning about preloaded couldn't reserving memory, one uninitialized access from wine_server_call (I guess a false positive?), a lot of them from fglrx and then a segmentation fault inside valgrind. It got killed before the browser came up, so I couldn't check the TrackMouseEvent warning. At some later time, I will check if I can run it, e.g., by disabling DirectX.
I had also a problem applying the GlobalFlags registry fix. In the latest Wine Git, I can't create a subkey of HKLM\System\CurrentControlSet\Control because of an error "the key must be volatile" (is HKLM\System\CurrentControlSet\Control now itself volatile and can't have non-volatile subkeys?). I was able to apply it in the prefix using an older wine, but it's possible it gets ignored.
http://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #8 from Dan Kegel dank@kegel.com 2010-01-24 16:38:08 --- You might want to wait until Alexandre finishes adding the heap checks to Wine.
http://bugs.winehq.org/show_bug.cgi?id=14867
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
--- Comment #9 from Jerome Leclanche adys.wh@gmail.com 2012-02-17 13:43:58 CST --- (In reply to comment #8) Please retest in wine-1.4-rc3.
http://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #10 from Austin English austinenglish@gmail.com 2012-09-17 14:43:30 CDT --- I don't know if the original problem would show up under make input.ok, but in wine-1.5.13-63-gcaf6fe0 / valgrind 3.7.0, that error doesn't appear. There are other warnings, however..
https://bugs.winehq.org/show_bug.cgi?id=14867
--- Comment #11 from Austin English austinenglish@gmail.com --- Please retest in current (1.7.17 or newer) wine.
https://bugs.winehq.org/show_bug.cgi?id=14867
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #12 from joaopa jeremielapuree@yahoo.fr --- Does the bug still occur with wine-5.11?
https://bugs.winehq.org/show_bug.cgi?id=14867
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |ABANDONED Status|NEW |RESOLVED
--- Comment #13 from Austin English austinenglish@gmail.com --- Abandoned.
https://bugs.winehq.org/show_bug.cgi?id=14867
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Gijs Vermeulen gijsvrm@gmail.com --- Closing ABANDONED.