Opened 6 years ago

Closed 5 years ago

#12730 closed Patches (fixed)

windows - static threads library is incompatible with MSVC 2017 RC

Reported by: z7z7z@… Owned by: viboes
Milestone: Boost 1.66.0 Component: thread
Version: Boost 1.63.0 Severity: Showstopper
Keywords: Cc:

Description

Microsoft Visual C++ 2017 RC

While being linked statically with threads library, the EXE exits with the code 255 right after the start.

The problem is because of _PVFV/_PIFV function type mixup in /boost/libs/thread/src/win32/tss_pe.cpp - the on_tls_prepare() is expected to return zero, but it does not initialize the return value.

Seems that after the refactoring of CRT in VC2017 this inconsistency have become critical.

The fix proposed is in the attached version of tss_pe.cpp .

Attachments (1)

tss_pe.cpp (10.8 KB ) - added by z7z7z@… 6 years ago.
Fixed tss_pe.cpp

Download all attachments as: .zip

Change History (10)

by z7z7z@…, 6 years ago

Attachment: tss_pe.cpp added

Fixed tss_pe.cpp

comment:1 by viboes, 6 years ago

Component: threadsthread

comment:2 by viboes, 6 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

Please, could you provide a patch or even better a github PR?

comment:3 by anonymous, 6 years ago

Sorry, I dont't use git, so don't do PRs.

The diff of changes proposed is here: http://pastebin.com/USCA1FN3

The idea is that seems we can't actually generalize that all callbacks are non-returning or that all callbacks are int-returning. We have to differentiate between _I and _V versions.

Note that the fix was not tested on any other VS version.

comment:4 by frank.richter@…, 6 years ago

FWIW, looking through some older MSVC CRT sources, back to MSVC 8 the CRT$XI arrays were declared as having int functions - albeit inconsistently, in some places they were treated as void functions. Anyway, perhaps consider extending the change to _MSC_VER >= 1400.

comment:5 by viboes, 5 years ago

Could someone having access to Windows and git apply the patch and provide a PR on git?

comment:6 by viboes, 5 years ago

Summary: static threads library is incompatible with MSVC 2017 RCwindows - static threads library is incompatible with MSVC 2017 RC
Note: See TracTickets for help on using tickets.