|
2001-04-14
| ||
| 02:04 | • Ticket [217898ffff] tclScan.c should not blindly call ckalloc() for zero bytes o... artifact: c80db5beeb user: dgp | |
|
2000-10-26
| ||
| 08:09 | • Closed ticket [217898ffff]. artifact: fc60f9a8d5 user: welch | |
| 00:45 | • New ticket [217898ffff]. artifact: dbf1a38a7a user: nobody | |
tclScan.c should not blindly call ckalloc() for zero bytes o
Closed / Fixed217898ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:45:35
OriginalBugID: 2518 Bug
Version: 8.2b2
SubmitDate: '1999-08-10'
LastModified: '1999-09-17'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 2795
OS: AIX
OSVersion: 4.3.2
Machine: RS6000
FixedDate: '2000-10-25'
ClosedDate: '1999-09-17'
Name:
Valdis Kletnieks
CVS:
updated from CVS 08/10/99 * RCS: @(#) $Id: tclScan.c,v 1.2 1999/04/16 00:46:53 stanton Exp $
Comments:
The attached patch works around the problem at the cost of a small
amount
of temporarily allocated memory. I wasn't ambitious enough to examine
tclScan.c
in more detail to see if there should be explicit tests/returns if
numVars
was a broken value.
ReproducibleScript:
On AIX 4.3.2, 'make test' fails fatally in 'scan.test' with an error
unable to allocate zero bytes.
DesiredBehavior:
tclScan.c should not blindly call ckalloc() for zero bytes, which can
happen
if ValidateFormat() or Tcl_ScanObjCmd() is called with an incorrect objv
list
(which is intentionally tested in scan.test, and could also be tripped
over
by buggy user code, which should trigger a tcl_error, not crash Tcl
entirely.
Patch:
http://black-ice.cc.vt.edu/~valdis/tcl8.2.tclScan.patch
PatchFiles:
tclScan.c
This appears to be just an AIX problem. Duffin says that the
alloc of 0 bytes is undefined (although it shouldn't crash).
He also states:
Looking at the code in ValidateFormat in tclScan.c I noticed that you
are not trying to use a local fixed size array as is normally done to
try and reduce the number of allocations so that is probably the
problem. Doing something like
if (numVars > LOCAL_SIZE) {
nassign = ckalloc (...)
} else {
nassign = localArray;
}
and the necessary clean up will probably fix it and fit in better with
the way that it is normally done.
-- 08/11/1999 hobbs
welch Closed ticket [217898ffff].
[History diff]2000-10-26 08:09:11
dgp Ticket [217898ffff]: 3 changes
[History diff]2001-04-14 02:04:28
Log in (anonymous is fine) to add a comment.