https://bugs.winehq.org/show_bug.cgi?id=39449
Bug ID: 39449 Summary: __finally being called too many times Product: Wine Version: 1.7.52 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lamberga@gmail.com Distribution: ---
This bug dealing with exception handling only occurs in a 64 bit environment. Appears to be independent of msvc*.dll version (also, switching to native dlls does not seem to have any effect). I have attached a reproducer.
Expected output (output under Windows and 32 bit Wine): Hello from main Hello from prog1 Finalizing Caught: Oh No!
Output under 64 bit Wine: Hello from main Hello from prog1 Finalizing Finalizing Caught: Oh No!
https://bugs.winehq.org/show_bug.cgi?id=39449
--- Comment #1 from lamberga@gmail.com --- Created attachment 52565 --> https://bugs.winehq.org/attachment.cgi?id=52565 Reproducer
https://bugs.winehq.org/show_bug.cgi?id=39449
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
https://bugs.winehq.org/show_bug.cgi?id=39449
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
--- Comment #2 from Sebastian Lackner sebastian@fds-team.de --- Could you maybe provide a precompiled executable of your test code? I would like to reproduce this issue, but don't have a 64-bit version of the MS build tools available.
https://bugs.winehq.org/show_bug.cgi?id=39449
--- Comment #3 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 52604 --> https://bugs.winehq.org/attachment.cgi?id=52604 dynamically compiled test
https://bugs.winehq.org/show_bug.cgi?id=39449
--- Comment #4 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 52605 --> https://bugs.winehq.org/attachment.cgi?id=52605 statically compiled test
https://bugs.winehq.org/show_bug.cgi?id=39449
--- Comment #5 from Dmitry Timoshkov dmitry@baikal.ru --- I've attached two 64-bit executables compiled with PSDK 7.1 tools: one - dynamically links with msvcrt, another one - statically.
https://bugs.winehq.org/show_bug.cgi?id=39449
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #6 from Dmitry Timoshkov dmitry@baikal.ru --- ... and confirming.
https://bugs.winehq.org/show_bug.cgi?id=39449
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |sebastian@fds-team.de
--- Comment #7 from Sebastian Lackner sebastian@fds-team.de --- The problem is that RtlUnwindEx is called from within a STATUS_UNWIND_CONSOLIDATE callback, it should skip already unwound stack frames. On Windows this is solved with specially crafted unwind info in a wrapper function. I'll see if I can come up with a solution for this.
https://bugs.winehq.org/show_bug.cgi?id=39449
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |erich.e.hoover@wine-staging | |.com, michael@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/ntdll-Consolid | |ation_Callback
https://bugs.winehq.org/show_bug.cgi?id=39449
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch Summary|__finally being called too |__finally being called too |many times |many times (Unwind | |consolidate callback needs | |special wrapper function to | |skip stack frames)
--- Comment #8 from Sebastian Lackner sebastian@fds-team.de --- Please try the attached proof-of-concept patch, it fixes the issue for me: https://github.com/wine-compholio/wine-staging/blob/master/patches/ntdll-Con...
https://bugs.winehq.org/show_bug.cgi?id=39449
--- Comment #9 from lamberga@gmail.com --- Confirming that this indeed fixes the issue for me as well. Thank you!
https://bugs.winehq.org/show_bug.cgi?id=39449
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |cbb57052163d05a14d3d8cf25fe | |e08eea6660142 Status|STAGED |RESOLVED Resolution|--- |FIXED
--- Comment #10 from Sebastian Lackner sebastian@fds-team.de --- Fixed with http://source.winehq.org/git/wine.git/commit/cbb57052163d05a14d3d8cf25fee08e....
https://bugs.winehq.org/show_bug.cgi?id=39449
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.54.
https://bugs.winehq.org/show_bug.cgi?id=39449
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Component|-unknown |ntdll