[Bug 46236] Far 3.0 x64 crashes starting from build 5200

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Feb 25 14:24:40 CST 2019


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

Ken Thomases <ken at codeweavers.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ken at codeweavers.com

--- Comment #17 from Ken Thomases <ken at codeweavers.com> ---
Created attachment 63691
  --> https://bugs.winehq.org/attachment.cgi?id=63691
Hack to enable TEB->PEB access via %gs:0x60

(In reply to Chatty from comment #16)
> I could finally spot the root cause with the help of Alex:
> 
> This little piece of code compiled with /MT (instead of default /MD) causes
> x64 code to crash on a Mac (x86 or Linux is not affected):
> 
> 	struct s { static unsigned WINAPI func(void* Param) { std::wcout << (const
> wchar_t*)Param; return 0; } };
> 	_beginthreadex(nullptr, 0, &s::func, (void*)L"Test", 0, 0);
> 	Sleep(1000);
> 
> More info on the compiler parameter:
> https://docs.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-
> library?view=vs-2017

Those docs say that different libraries are linked depending on that compiler
switch.  Presumably, one library has an inlined access to some field of the TEB
structure which our workaround doesn't support while the other library does
not.

I'm attaching a gross hack that might help, depending on exactly which field of
the TEB the library tries to access.  If it's the Peb field, then this should
help.  Otherwise, not so much.

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