[Bug 45199] Many applications and games fail to start/ crash after compiling wine with gcc 8.1.0 and -O2

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Jun 1 22:06:21 CDT 2018


https://bugs.winehq.org/show_bug.cgi?id=45199

--- Comment #21 from countstarlight at gmail.com ---
(In reply to Lukáš Krejčí from comment #12)
> The crashes seem to be related to hot patching certain library functions.
> I was able to test the program from
> https://bugs.winehq.org/show_bug.cgi?id=45230 and found out that
> libtcmalloc.dll.so is patching RtlAllocateHeap (and others, list attached).
> The problem is that it is overwriting the position-independent code thunk
> call, which represents the first instruction of that function. The issues
> started with Wine 3.8, which was that first one compiled by GCC 8.1.0. Wine
> 3.7 was compiled by GCC 7.3.1.
> 
> When I recompiled RtlAllocateHeap with DECLSPEC_HOTPATCH modifier, the
> program (TIM.exe) started working. It also worked with WINEDEBUG=relay, this
> can be explained by the fact that entry points to ntdll are patched to relay
> thunks. It should also be noted the compiling with -O0 or -O1 did not work
> for me - I guess GCC did not insert the call to get_pc_thunk as the first
> instruction.
> 
> While I did not test recompiling SysAllocStringByteLen from this bug report,
> it too has a call to a thunk as its first instruction.

(TIM.exe) started working on wine 3.9 (on Arch x64) with the "WINEDEBUG=relay",
but it is very slow, can't use it as normal.

-- 
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.


More information about the wine-bugs mailing list