Skip to content
Tcl Source Code History Of Ticket 8cd2fe7474
Login

History Of Ticket 8cd2fe7474

Artifacts Associated With Ticket 8cd2fe7474

  1. Ticket change [e970d187ff] (rid 176916) by BERC on 2019-11-12 09:57:52:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      In tclLoad.c (i.e. https://core.tcl-lang.org/tcl/artifact/76192e755eed7560) there is a bug which occurs when a library is unloaded.
      In the part "Remove this library from the interpreter's library cache.", the next pointers of the linked list are not properly updated.
      
      
      		ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
      		ipPtr = ipFirstPtr;
      		if (ipPtr->pkgPtr == defaultPtr) {
      		    ipFirstPtr = ipFirstPtr->nextPtr;
      		} else {
      		    InterpPackage *ipPrevPtr;
      
      		    for (ipPrevPtr = ipPtr; ipPtr != NULL;
      			    ipPrevPtr = ipPtr, ipPtr = ipPtr->nextPtr) {
      			if (ipPtr->pkgPtr == pkgPtr) {
      			    ipPrevPtr->nextPtr = ipPtr->nextPtr;
      			    break;
      			}
      		    }
      		}
      
      should be
      
      
      		ipFirstPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
      		ipPtr = ipFirstPtr;
      		if (ipPtr->pkgPtr == defaultPtr) {
      		    ipFirstPtr = ipFirstPtr->nextPtr;
      		} else {
      		    InterpPackage *ipPrevPtr;
      
      		    for (ipPrevPtr = ipPtr; ipPtr != NULL;
      			    ipPrevPtr = ipPtr, ipPtr = ipPtr->nextPtr) {
      			if (ipPtr->pkgPtr == defaultPtr) {
      			    ipPrevPtr->nextPtr = ipPtr->nextPtr;
      			    break;
      			}
      		    }
      		}
      
      
      So the check "(ipPtr->pkgPtr == pkgPtr)" should really be "(ipPtr->pkgPtr == defaultPtr)"
      
      With this bug, one can get error messages when first unloading a lib (works properly) and then unloading another one (will return error "has never been loaded in this interpreter" because it cannot be find in the list, because the linked list has been corrupted.
      
    5. foundin initialized to: "Tcl 9.0a0 and older"
    6. is_private initialized to: "0"
    7. login: "BERC"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "efbd17cefb5d0a14113ad516213d53b903e99650"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "BERC"
    14. subsystem initialized to: "38. Init - Library - Autoload"
    15. title initialized to: ""unload" command Bug (when handling multiple libs)"
    16. type initialized to: "Bug"
  2. Ticket change [3d620de599] (rid 176964) by dgp on 2019-11-13 15:06:49:

    1. assignee changed to: "mistachkin"
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. severity changed to: "Important"
    5. subsystem changed to: "40. Dynamic Loading"
  3. Ticket change [7911497f3c] (rid 178615) by jan.nijtmans on 2020-01-16 14:18:00:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Proposed fix committed to bug-8cd2fe7474 branch. Looks good.
      
      Thanks for the report and fix. I'll do some testing first.
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/plain"
    5. resolution changed to: "Accepted"
    6. status changed to: "Pending"
  4. Ticket change [848bc5f3b4] (rid 178624) by jan.nijtmans on 2020-01-17 09:22:31:

    1. closedate changed to: "2458865.89064435"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Fixed in all branches.
      
      Thanks!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"