|
2020-01-17
| ||
| 09:22 | • Closed ticket [8cd2fe7474]: "unload" command Bug (when handling multip... artifact: 848bc5f3b4 user: jan.nijtmans | |
| 08:53 | Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) check-in: 29086fe087 user: jan.nijtmans tags: core-8-6-branch | |
| 08:51 | Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) check-in: 8f93f9da3c user: jan.nijtmans tags: core-8-5-branch | |
|
2020-01-16
| ||
| 14:18 | • Pending ticket [8cd2fe7474]: "unload" command Bug (when handling multi... artifact: 7911497f3c user: jan.nijtmans | |
| 14:16 | Proposed fix for [8cd2fe7474]: "unload" command Bug (when handling multiple libs) closed check-in: e582dc6e06 user: jan.nijtmans tags: bug-8cd2fe7474 | |
|
2019-11-13
| ||
| 15:06 | • Ticket [8cd2fe7474] "unload" command Bug (when handling multiple libs)... artifact: 3d620de599 user: dgp | |
|
2019-11-12
| ||
| 09:57 | • New ticket [8cd2fe7474]. artifact: e970d187ff user: BERC | |
"unload" command Bug (when handling multiple libs)
Closed / Fixed8cd2fe747463756f4a4a31f726c2c0163ecde2ffCreated 7 years agoUpdated 7 years ago
Descriptionplain2019-11-12 09:57:52
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.
Referenced by3
29086fe087Fix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) check-in2020-01-17 08:53:298f93f9da3cFix [8cd2fe7474]: "unload" command Bug (when handling multiple libs) check-in2020-01-17 08:51:38e582dc6e06Proposed fix for [8cd2fe7474]: "unload" command Bug (when handling multiple libs) check-in2020-01-16 14:16:48
dgp Ticket [8cd2fe7474]: 5 changes
[History diff]2019-11-13 15:06:49
jan.nijtmansplain2020-01-16 14:18:00
Proposed fix committed to bug-8cd2fe7474 branch. Looks good. Thanks for the report and fix. I'll do some testing first.
jan.nijtmansplain2020-01-17 09:22:31
Fixed in all branches. Thanks!
Log in (anonymous is fine) to add a comment.