[Bug 49802] Crash at AfxBeginThread of x64 apps on macOS when built with VS2019

WineHQ Bugzilla wine-bugs at winehq.org
Tue Sep 8 14:05:41 CDT 2020


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

--- Comment #1 from Ken Thomases <ken at codeweavers.com> ---
There are currently limitations to how well macOS can support running 64-bit
Windows apps.

The root problem is an ABI incompatibility about the use of the %gs register
(and the hidden GS.base register).  Windows has GS.base point to the TEB. 
macOS has GS.base point to its pthread thread-local storage (TLS) area.  On
Linux, GS.base is free for apps to use, so Wine can make it point to the TEB. 
On macOS, we can't really change GS.base without breaking system libraries.

What 64-bit compatibility we do have for macOS is due to the fact that most
Windows programs only access certain fields of the TEB (offsets from GS.base)
directly.  Wine pokes appropriate values into the pthread TLS area at those
offsets so that Windows programs find what they expect.  Apple has blessed this
approach and reserved those offsets within the TLS area for this purpose.

But for any app which accesses other offsets directly, they get junk. 
Unfortunately, somewhere within AfxBeginThread() there's just such an access. 
There's not currently a clean workaround.

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