Overview
| Artifact ID: | 9b5eb37a3e2a3def11ea6cdc7ec0c1e7eec30ee7 |
|---|---|
| Ticket: | 219243ffffffffffffffffffffffffffffffffff
[thread extension] TclGetLibraryPath in core returns NULL fo |
| User & Date: | nobody on 2000-10-26 05:04:05 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 5301 Bug Version: 8.3 SubmitDate: '2000-05-01' LastModified: '2000-06-06' Severity: CRIT Status: Assigned Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 3876 OS: Windows 2000 FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: David Gravereaux CVS: April 28, 1am PST Comments: Do we need to use Tcl_FindExecutable to set all these pre-init things from a thread ??? ReproducibleScript: set a breakpoint on line 640 of threadCmd.c "result = Tcl_Init(tsdPtr->interp);" and watch it return 1 (TCL_ERROR). ObservedBehavior: This at least shows the error as it was being hidden before. The root of the problem lies in TclGetLibraryPath returning an invalid pointer. Patch: *** generic/threadCmd.c2000/04/17 20:37:041.6 --- generic/threadCmd.c2000/04/29 09:30:21 *************** *** 636,643 **** */ tsdPtr->interp = Tcl_CreateInterp(); ! result = Tcl_Init(tsdPtr->interp); result = Thread_Init(tsdPtr->interp); /* --- 636,647 ---- */ tsdPtr->interp = Tcl_CreateInterp(); ! if ((result = Tcl_Init(tsdPtr->interp)) != TCL_OK) { ! Tcl_MutexLock(&threadMutex); ! ThreadErrorProc(tsdPtr->interp); ! Tcl_ExitThread(result); ! } result = Thread_Init(tsdPtr->interp); /* PatchFiles: generic/threadCmd.c Name: David Gravereaux CVS: updated yesterday Comments: This is a more complete patch solution then before. ReproducibleScript: package require Thread 2.0 set id [thread::create] ObservedBehavior: Tcl_Init fails Patch: *** tcl/generic/tclEvent.c2000/04/18 23:10:041.8 --- tcl/generic/tclEvent.c2000/04/30 06:24:42 *************** *** 99,104 **** --- 99,109 ---- static Tcl_ThreadDataKey dataKey; /* + * Common string for the library path for sharing across threads + */ + char *tclLibraryPathStr; + + /* * Prototypes for procedures referenced only in this file: */ *************** *** 596,601 **** --- 601,607 ---- Tcl_DecrRefCount(tsdPtr->tclLibraryPath); } tsdPtr->tclLibraryPath = pathPtr; + tclLibraryPathStr = Tcl_GetStringFromObj(pathPtr, NULL); } /* *************** *** 619,624 **** --- 625,634 ---- TclGetLibraryPath() { ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); + + if (tsdPtr->tclLibraryPath == NULL) { + tsdPtr->tclLibraryPath = Tcl_NewStringObj(tclLibraryPathStr, -1); + } return tsdPtr->tclLibraryPath; } *** thread/generic/threadCmd.c2000/04/17 20:37:041.6 --- thread/generic/threadCmd.c2000/04/29 09:30:21 *************** *** 636,643 **** */ tsdPtr->interp = Tcl_CreateInterp(); ! result = Tcl_Init(tsdPtr->interp); result = Thread_Init(tsdPtr->interp); /* --- 636,647 ---- */ tsdPtr->interp = Tcl_CreateInterp(); ! if ((result = Tcl_Init(tsdPtr->interp)) != TCL_OK) { ! Tcl_ConditionNotify(&ctrlPtr->condWait); ! ThreadErrorProc(tsdPtr->interp); ! Tcl_ExitThread(result); ! } result = Thread_Init(tsdPtr->interp); /* PatchFiles: tcl/generic/tclEvent.c thread/generic/threadCmd.c -- 06/06/2000 hobbs - foundin changed to: "obsolete: 8.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "49. Threading"
- title changed to:
[thread extension] TclGetLibraryPath in core returns NULL fo
- type changed to: "Bug"