Modify

Opened 13 months ago

Closed 4 months 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@… 13 months ago.
Fixed tss_pe.cpp

Download all attachments as: .zip

Change History (10)

Changed 13 months ago by z7z7z@…

Attachment: tss_pe.cpp added

Fixed tss_pe.cpp

comment:1 Changed 11 months ago by viboes

Component: threadsthread

comment:2 Changed 11 months ago by viboes

Owner: changed from Anthony Williams to viboes
Status: newassigned

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

comment:3 Changed 11 months ago by anonymous

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 Changed 11 months ago by frank.richter@…

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 Changed 5 months ago by viboes

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

comment:6 Changed 5 months ago by viboes

Summary: static threads library is incompatible with MSVC 2017 RCwindows - static threads library is incompatible with MSVC 2017 RC

comment:9 Changed 4 months ago by viboes

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.