Overview
| Artifact ID: | b04f2a5d9297564d00d29149f07615f402dc96f9 |
|---|---|
| Ticket: | 987967ffffffffffffffffffffffffffffffffff
CRITICAL_SECTION masterLock not initialized |
| User & Date: | sorensenjs on 2004-07-09 13:51:30 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
Tcl version - current and all inspected - seems to be a problem all the way back to introduction of tclWinThrd.c so all v8.0 onwards OS - Windows only problem, and only if Tcl interpreters are not created (ie using tcl as a C library) When Tcl is used as a library (e.g. for utf-8 or regexp functions) on the Windows platform and TCL_THREADS is defined during the build of Tcl, the functions will produce a seg fault when the MASTER_LOCK macro is invoked because the masterLock variable has not been initialized. This is not seen if Tcl_CreateInterp has been invoked because TclpInitLock is called by TclInitSubsystems. However, the Tcl_RegExpCompile, for example is supposed to be callable with the Tcl_Interp parameter set to NULL (0). In the unix implementation, the corresponding variable is initialized at compile time through a static initializer static pthread_mutex_t masterLock = PTHREAD_MUTEX_INITIALIZER; this cannot be done on windows because a call to InitializeCriticalSection is required. One possible fix is change the macro for MASTER_LOCK to call the TclpMasterLock function in tclWinThrd.c This seems reasonable and it only affects this one file. In the meantime, it appears that a call to Tcl_GetTime will initialize the masterLock mutex.
- foundin changed to: "obsolete: 8.5a1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "sorensenjs"
- subsystem changed to: "49. Threading"
- title changed to: "CRITICAL_SECTION masterLock not initialized"
- type changed to: "Bug"