Should be fixing the constant MR failures, though I don't know how critical DECLSPEC_HOTPATCH is.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/kernelbase/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c index f6eb6b0e51e..721d61f60f5 100644 --- a/dlls/kernelbase/thread.c +++ b/dlls/kernelbase/thread.c @@ -1035,7 +1035,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH ConvertFiberToThread(void) /*********************************************************************** * ConvertThreadToFiber (kernelbase.@) */ -LPVOID WINAPI DECLSPEC_HOTPATCH ConvertThreadToFiber( LPVOID param ) +LPVOID WINAPI /* DECLSPEC_HOTPATCH */ ConvertThreadToFiber( LPVOID param ) { return ConvertThreadToFiberEx( param, 0 ); }
Would you explain how it works in the commit message? `DECLSPEC_HOTLATCH` just adds no-op code at function prologue, so there should be something more contrived going on.
On Sat Jun 3 06:41:10 2023 +0000, Jinoh Kang wrote:
Would you explain how it works in the commit message? `DECLSPEC_HOTLATCH` just adds no-op code at function prologue, so there should be something more contrived going on.
It's a known mingw bug and not the first instance of it. I don't actually know the details but the stack pointer gets off by one and the calls return to an invalid address.
On Sat Jun 3 06:42:02 2023 +0000, Rémi Bernon wrote:
It's a known mingw bug and not the first instance of it. It only happens with some old mingw, but the gitlab image apparently has it. I don't actually know the details but the stack pointer gets off by one and the calls return to an invalid address.
The following bugs are related to the DECLSPEC_HOTPATCH. The bug gets triggered for small functions.
https://bugs.winehq.org/show_bug.cgi?id=47633
https://bugs.winehq.org/show_bug.cgi?id=47649
https://source.winehq.org/git/wine.git/commitdiff/de6554a312a731db7d85440ce4...
The corresponding mingw bug is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91489. Supposedly it should be fixed in the new versions.
On Sat Jun 3 08:42:04 2023 +0000, Zhiyi Zhang wrote:
The following bugs are related to the DECLSPEC_HOTPATCH. The bug gets triggered for small functions. https://bugs.winehq.org/show_bug.cgi?id=47633 https://bugs.winehq.org/show_bug.cgi?id=47649 https://source.winehq.org/git/wine.git/commitdiff/de6554a312a731db7d85440ce4... The corresponding mingw bug is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91489. Supposedly it should be fixed in the new versions.
In that case, shouldn't we just change `DECLSPEC_HOTPATCH` to never omit the frame pointer?
This won’t workaround gcc bug.
This is fixed in gcc more than a year ago I think (after fix taking about another year to get in). Also, declspec_hotpatch is really needed for much less amount of functions since Wine modules are built as no-PIC. So probably removing the attribute on the occasion is the best course of action. Just in decade or two the compiler fix will be in all the distributions.
On 3 Jun 2023, at 8:16, Jinoh Kang (@iamahuman) wine@gitlab.winehq.org wrote:
On Sat Jun 3 08:42:04 2023 +0000, Zhiyi Zhang wrote:
The following bugs are related to the DECLSPEC_HOTPATCH. The bug gets triggered for small functions. https://bugs.winehq.org/show_bug.cgi?id=47633 https://bugs.winehq.org/show_bug.cgi?id=47649 https://source.winehq.org/git/wine.git/commitdiff/de6554a312a731db7d85440ce4... The corresponding mingw bug is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91489. Supposedly it should be fixed in the new versions.
In that case, shouldn't we just change `DECLSPEC_HOTPATCH` to never omit the frame pointer?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2960#note_34557