Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-01-03
23:11 • Closed ticket [219243ffff]: thread extension TclGetLibraryPath in core returns... artifact: 3e6896bfa3 user: dkf
2000-12-30
04:07 • Ticket [219243ffff]: 4 changes artifact: c7426f92a0 user: davygrvy
2000-10-26
05:04 • New ticket [219243ffff]. artifact: 9b5eb37a3e user: nobody

[thread extension] TclGetLibraryPath in core returns NULL fo

Closed / Fixed219243ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 05:04:05
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
davygrvyplain2000-12-30 04:07:57
this bug should be marked fixed.  It was added for 8.4a2
dkfplain2001-01-03 23:11:44
Anything to oblige...
Log in (anonymous is fine) to add a comment.