Tcl Source Code

View Ticket
Login
Ticket UUID: 7393be0be6e7f91cbb2016fa777896e3895929e3
Title: Tcl Thread library doesn't work in Debug build on Windows_x64
Type: Bug Created on: 2016-04-18 12:45:34
Submitter: christian.nassau Assigned to: jan.nijtmans
Subsystem: 80. Thread Package Severity: Important
Priority: 5 Medium Last modified: 2026-10-22 17:19:32
Status: Closed Closed by: serhiy.storchaka
Resolution: Fixed Closed on: 2026-10-21 10:03:40
Version: 8.6.3
Description:
There are two problems that prevent the Tcl Thread package from working in a Windows debug build:

1) the pkgIndex.tcl always loads the release-version of thread27.dll
there should be a check for tcl_platform(debug) and thread27g.dll should be loaded in the debug case

2) the thread initialisation in TclWinThreadStart (file win/tclWinThrd.c) uses an illegal combination of flags in the line
    _controlfp(winThreadPtr->fpControl, fpmask);
The flag "_MCW_PC" is not allowed on a 64-bit Windows system (see https://msdn.microsoft.com/en-us/library/e9b52ceh.aspx).
Using "_MCW_PC" triggers an assertion on Windows 8.1 that aborts the process.

On affected systems the assertion can be triggered using
   package require Thread
   thread::create -joinable { thread::wait }
User Comments:
jan.nijtmans added on 2016-06-14 10:14:51:
Point 2) is now fixed in all open branches. So at least the non-debug version should be OK now on x64. Thanks!

jan.nijtmans added on 2021-03-18 20:55:14:

Let me check, but I think this one can be closed


serhiy.storchaka added on 2026-10-21 10:03:40:

Point 2 was fixed in 8.6.6 by [5ed3db2343]: _MCW_PC is no longer passed to _controlfp() on Win64. Point 1 is also resolved: the Thread nmake build writes pkgIndex.tcl with the DLL name of the build being made, including the debug suffix.