Skip to content
Tcl Source Code History Of Ticket 673714ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 673714ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 673714ffffffffffffffffffffffffffffffffff

  1. Ticket change [1877f2ad50] (rid 122664) by nobody on 2003-01-24 00:27:45:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hello Support,
      
      tclNotify.c : Tcl_DeleteEvents() removes events from
      the event queue.  If the event deleted is the last
      event in the queue, the tsdPtr->lastEventPtr is left
      pointing at evPtr which gets freed.  This leaves
      lastEventPtr pointing to freed memory which causes
      unpredictable behavior.
      
      I've changed the code so that lastEventPtr (and
      markEventPtr) get fixed up correctly in all cases.
      New code is included below.
      
      Platform: All
      Tested on Solaris 5.6 and Linux 7.1
      Tested with Tcl 8.3.4, but same problem exists in
      source code is in 8.4.1.
      
      Regards,
      Michael Webb
      Model Technology Inc.
      (503)526-1660
      [email protected]
      
      
      New Code for Tcl_DeleteEvents():
      
      void
      Tcl_DeleteEvents(proc, clientData)
          Tcl_EventDeleteProc *proc;      /* The procedure to
      call. */
          ClientData clientData;          /* type-specific
      data. */
      {
          Tcl_Event *evPtr, *prevPtr, *hold;
          ThreadSpecificData *tsdPtr =
      TCL_TSD_INIT(&dataKey);
       
          Tcl_MutexLock(&(tsdPtr->queueMutex));
          for (prevPtr = (Tcl_Event *) NULL, evPtr =
      tsdPtr->firstEventPtr;
                   evPtr != (Tcl_Event *) NULL;
                   ) {
              if ((*proc) (evPtr, clientData) == 1) {
                  if (tsdPtr->firstEventPtr == evPtr) {
                      tsdPtr->firstEventPtr = evPtr->nextPtr;
                  } else {
                      prevPtr->nextPtr = evPtr->nextPtr;
                  }
                  if (evPtr->nextPtr == (Tcl_Event *) NULL) {
                      tsdPtr->lastEventPtr = prevPtr;
                  }
                  if (tsdPtr->markerEventPtr == evPtr) {
                      tsdPtr->markerEventPtr = prevPtr;
                  }
                  hold = evPtr;
                  evPtr = evPtr->nextPtr;
                  ckfree((char *) hold);
              } else {
                  prevPtr = evPtr;
                  evPtr = evPtr->nextPtr;
              }
          }
          Tcl_MutexUnlock(&(tsdPtr->queueMutex));
      }
      
    4. foundin initialized to: "obsolete: 8.4.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "01. Notifier"
    10. title initialized to:
      Tcl_DeleteEvents() bug when deleting last event in queue
      
    11. type initialized to: "Bug"
  2. Ticket change [7a299885ae] (rid 90257) by kennykb on 2003-02-02 05:12:40:

    1. icomment:
      
      
      File Added - 41271: 673714.patch
      
      Logged In: YES 
      user_id=99768
      
      Submitter's code converted to a patch and attached.
      Current tests continue to pass with patch applied.
      We need to think up a regression test for this one.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  3. Add attachment "673714.patch" [16e8502334] (rid 124792) by kennykb on 2003-02-02 05:12:40.

  4. Ticket change [9f48711f3c] (rid 96616) by kennykb on 2003-02-16 03:35:18:

    1. closedate changed to: "2003-02-15T20:35:18"
    2. closer changed to: "kennykb"
    3. icomment:
      Logged In: YES 
      user_id=99768
      
      Fix committed. Fix adds a new 'testevent' command to tclTest.c
      and a new 'notify.test' with 23 new test cases to attempt to catch
      problems of this type on regression test.
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "kennykb"