[Bug 59910] New: One case of i386 unwinding broken
http://bugs.winehq.org/show_bug.cgi?id=59910 Bug ID: 59910 Summary: One case of i386 unwinding broken Product: Wine Version: 9.6 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@list.winehq.org Reporter: martin@martin.st CC: pgofman@codeweavers.com Regression SHA1: 29c73ee17335b30f3f49c8b3562742c6a35b482c Distribution: --- Created attachment 81239 --> http://bugs.winehq.org/attachment.cgi?id=81239 Test executable Since commit 29c73ee17335b30f3f49c8b3562742c6a35b482c, "ntdll: Support more xstate features.", one testcase of i386 unwinding fails. The testcase is https://github.com/microsoft/compiler-tests/blob/master/eh/recursive_throw.c..., compiled with MSVC, with "cl -MD recursive_throw.cpp -EHsc". (The issue appears the same both with and without "-MD", and also the same if compiled with -O2 for optimization.) Before this commit, executing this binary output: --- N loops: 10 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 Level MAX_REC throwing. main catched level 0 --- After this change, executing the binary produces this instead: --- N loops: 10 Level MAX_REC throwing. 0024:err:virtual:virtual_setup_exception stack overflow 3072 bytes addr 0x7bd41f67 stack 0x220400 (0x220000-0x221000-0x320000) --- -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59910 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, regression, | |source, testcase URL| |https://bugs.winehq.org/att | |achment.cgi?id=81239 --- Comment #1 from Ken Sharp <imwellcushtymelike@gmail.com> --- Did you test this with latest git? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59910 --- Comment #2 from Martin Storsjö <martin@martin.st> --- Yes, I've tested this on the latest git as well. That's where I encountered it, and to get useful context I bisected it down to find the regressing commit. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59910 --- Comment #3 from Paul Gofman <pgofman@codeweavers.com> --- This test probably only fails on avx512 enabled machine (it does here, but not if avx512 is unsupported). The blamed commit added big chunk to xstate data when avx512 is supported, that how it is triggered the test failure. The process of unwinding / rethrowing goes down the stack and uses NtRaiseException to throw from inner catches. So the raised exception stack layout adds to stack usage and now that doesn't fit in. The issue is not present with WINE_ARCH=wow64, however the part which is different with wow64 which I spotted first is probably not quite right. If there is no xstate in the exception wow64's call_user_exception_dispatcher won't allocate space for xstate on stack. However on Windows NtRaiseException always ends up with xstate anyway, even if the supplied context doesn't have xstate, and probably in any case on Windows full xstate space ends up on stack always after raising exception. The actual related bug I found that i386 (non wow64) call_user_exception_dispatcher currently reserves the space for base context part twice (while always having xstate allocated looks right). Removing that double reservation looks enough for this test to fit in the default thread stack, I sent a patch: https://gitlab.winehq.org/wine/wine/-/merge_requests/11254 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59910 --- Comment #4 from Martin Storsjö <martin@martin.st> --- Thanks for the explanation, and thanks for the quick fix! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59910 Paul Gofman <pgofman@codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f01b373b05bf1a4d2dd4a1c730a | |78b5e914224a8 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #5 from Paul Gofman <pgofman@codeweavers.com> --- Should be fixed by f01b373b05bf1a4d2dd4a1c730a78b5e914224a8. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla