http://bugs.winehq.org/show_bug.cgi?id=25561
Summary: Setting watches in winedbg can generated unhandled floating point stack check exceptions Product: Wine Version: 1.3.9 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winedbg AssignedTo: wine-bugs@winehq.org ReportedBy: austin.lund@gmail.com
The way the recreate this may seem rather artificial, but it seems to always reproduce it for me.
$ cd dlls/riched20/tests $ winedbg riched20_test.exe.so editor < dbgbug
where the dbgbug file is:
b test_EM_FORMATRANGE c watch * &fr.rc.bottom c c
The output I get is attached.
http://bugs.winehq.org/show_bug.cgi?id=25561
Austin Lund austin.lund@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Setting watches in winedbg |Setting watches in winedbg |can generated unhandled |can generate unhandled |floating point stack check |floating point stack check |exceptions |exceptions
http://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #1 from Austin Lund austin.lund@gmail.com 2010-12-19 19:50:45 CST --- Created an attachment (id=32547) --> (http://bugs.winehq.org/attachment.cgi?id=32547) Output from reproduction procedure
http://bugs.winehq.org/show_bug.cgi?id=25561
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@orange.fr
--- Comment #2 from Eric Pouech eric.pouech@orange.fr 2010-12-22 09:39:03 CST --- I can reproduce it. Actually, running under winedbg --gdb doesn't generate any float exception. Btw, the watch point is set on an address which is on the stack, but the execution continues after the function finishes. IIRC, gdb only activates the watchpoint when rentering the current function, while winedbg incorrectly keeps the watchpoint active in all cases.
http://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #3 from Austin Lund austin.lund@gmail.com 2010-12-22 19:06:11 CST --- Testing with winedbg --gdb gives me the wrong thing also. It stops execution at the start of the next line in test_EM_FORMATRANGE instead of stopping it at the line of code which does the assignment.
http://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #4 from rainy6144@gmail.com 2011-05-23 01:17:24 CDT --- Created an attachment (id=34868) --> (http://bugs.winehq.org/attachment.cgi?id=34868) Proposed patch
Apparently, when a debug register is used by a watchpoint, raise_trap_exception() inadvertently removes the FPU state from the context, and so when wineserver subsequently serves a get_thread_context request from the debugger, it does not have the FPU state to pass to the debugger (i.e. in the server's copy_context(), the FPU state is in flags but not in from->flags).
This patch seems to solve this problem.
http://bugs.winehq.org/show_bug.cgi?id=25561
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |focht@gmx.net Component|winedbg |ntdll Summary|Setting watches in winedbg |Setting watches (hw |can generate unhandled |breakpoints) in debuggers |floating point stack check |can generate unhandled |exceptions |floating point stack check | |exceptions Ever Confirmed|0 |1
--- Comment #5 from Anastasius Focht focht@gmx.net 2011-05-23 05:51:17 CDT --- Hello,
--- quote --- Apparently, when a debug register is used by a watchpoint, raise_trap_exception() inadvertently removes the FPU state from the context, and so when wineserver subsequently serves a get_thread_context request from the debugger, it does not have the FPU state to pass to the debugger (i.e. in the server's copy_context(), the FPU state is in flags but not in from->flags). --- quote ---
good catch. I've occasionally seen this behaviour with other debuggers as well (like ollydbg) when using hw breakpoints in apps that make use of fp (VB apps do).
Regards
http://bugs.winehq.org/show_bug.cgi?id=25561
Alex Bradbury asb@asbradbury.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |asb@asbradbury.org
http://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #6 from Anastasius Focht focht@gmx.net 2011-12-20 15:12:12 CST --- Hello,
still a problem. Makes debugging of VB6 apps with hardware breakpoints almost impossible.
The patch from comment #4 saved the day several times ... Hopefully it can be removed from my stgit one day.
$ wine --version wine-1.3.35-85-g9622300
Regards
http://bugs.winehq.org/show_bug.cgi?id=25561
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=25561
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rainy6144@gmail.com
--- Comment #7 from Eric Pouech eric.pouech@orange.fr 2012-03-01 15:43:03 CST --- to rainy6144 can you send the patch to wine-patches (with your real name), it looks perfectly ok to me
http://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #8 from rainy6144@gmail.com 2012-03-02 00:07:04 CST --- (In reply to comment #7)
to rainy6144 can you send the patch to wine-patches (with your real name), it looks perfectly ok to me
Eric, since the patch is trivial, could you submit it using your name? Currently I don't have access to a computer outside of work. Thanks.
http://bugs.winehq.org/show_bug.cgi?id=25561
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-03-24 11:57:00 CDT --- (In reply to comment #8) Update on this patch please
https://bugs.winehq.org/show_bug.cgi?id=25561
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
--- Comment #10 from Austin English austinenglish@gmail.com --- (In reply to Jerome Leclanche from comment #9)
(In reply to comment #8) Update on this patch please
It's still not in wine-1.7.16-135-g7f311fb.
The bug is reproducible there as well.
https://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #11 from Austin English austinenglish@gmail.com --- Created attachment 48077 --> https://bugs.winehq.org/attachment.cgi?id=48077 backtrace in git
https://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #12 from Anastasius Focht focht@gmx.net --- Hello Austin,
since there is no attempt to send this patch to wine-patches, maybe you can take over and send the patch on behalf of rainy6144.
This bug is annoying, especially when debugging VB6 garbage. I have to resort to software breakpoints and guard page based memory 'watchpoints'.
Regards
https://bugs.winehq.org/show_bug.cgi?id=25561
--- Comment #13 from Austin English austinenglish@gmail.com --- https://source.winehq.org/patches/data/103866
https://bugs.winehq.org/show_bug.cgi?id=25561
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |1a988fa46580250bd7640f8f0f3 | |c4c06ea5053c3 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #14 from Austin English austinenglish@gmail.com --- https://source.winehq.org/git/wine.git/commitdiff/1a988fa46580250bd7640f8f0f...
https://bugs.winehq.org/show_bug.cgi?id=25561
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #15 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.17.