Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2018-04-27
13:21 • Closed ticket [7faad04be6]: TIP 430 immediate segfault plus 4 other changes artifact: 945a8cff7d user: dgp
03:12 • Ticket [7faad04be6]: 3 changes artifact: dd2ab76b31 user: hypnotoad
03:11 • Ticket [7faad04be6]: 3 changes artifact: 8d04d79421 user: hypnotoad
2018-04-25
14:02 • Ticket [7faad04be6]: 3 changes artifact: 7dd6b1ee7f user: dgp
14:02 • New ticket [7faad04be6]. artifact: 29ecbc50f0 user: dgp

TIP 430 immediate segfault

Closed / Fixed7faad04be62497d023d0d61d5519d0aaa5aaa8d8Created 9 years agoUpdated 9 years ago
Descriptionplain2018-04-25 14:02:16
Starting with checkin

https://core.tcl-lang.org/tcl/info/1f15130a9637c276

The "core_zip_vfs" branch (TIP 430) immediately segfaults
when `make test` is attempted on a --enable-symbols=mem build.
dgp Ticket [7faad04be6]: 3 changes [History diff]2018-04-25 14:02:28
hypnotoadplain2018-04-27 03:11:44
The ->namelen field was naively assuming that memory would be initialized to zero on Alloc. That is obviously not the case for --enable-symbols=mem  :-/

The portion of the code was also the part of the Tcl bootstrap that tries various files to see if there are zip file systems encoded at the end of them. So the code was dumping out prior to the complete initialization of the data structure that happens in ZipFS_Catalogue_Filesystem.

In checkin [730a3c01cbcc07eba202a74c012b85b30f8645e64c000f37e3c9d9cdd7b23c61] I added code to ensure that (at least in the case exercised by --enable-symbols=mem) we initialize that namelen flag to zero, which prevents the free() call from happening on failure to locate the zipfile header.
hypnotoad Ticket [7faad04be6]: 3 changes [History diff]2018-04-27 03:12:08
dgp Closed ticket [7faad04be6]. [History diff]2018-04-27 13:21:30
Log in (anonymous is fine) to add a comment.