|
2006-03-25
| ||
| 10:22 | • Closed ticket [1178805fff]: empty lists cause nasty surprises plus 6 other c... artifact: e349b4869e user: sf-robot | |
|
2006-03-10
| ||
| 23:22 | • Pending ticket [1178805fff]. artifact: 070c77e063 user: msofer | |
| 12:17 | • Ticket [1178805fff]: 4 changes artifact: f638557629 user: nobody | |
| 10:03 | • Ticket [1178805fff]: 4 changes artifact: 776acb1000 user: dgp | |
|
2005-05-11
| ||
| 21:21 | • Ticket [1178805fff]: 4 changes artifact: cd0c3b3628 user: msofer | |
|
2005-04-25
| ||
| 13:46 | • Ticket [1178805fff]: 4 changes artifact: 8c3a74c09f user: jenglish | |
|
2005-04-20
| ||
| 16:56 | • Ticket [1178805fff]: 4 changes artifact: f9a21d345b user: dkf | |
| 02:44 | • Ticket [1178805fff]: 6 changes artifact: 087ed1c873 user: msofer | |
| 02:38 | • Ticket [1178805fff]: 4 changes artifact: 2057c71792 user: hobbs | |
|
2005-04-19
| ||
| 22:14 | • Ticket [1178805fff]: 5 changes artifact: 46b2678061 user: kennykb | |
|
2005-04-17
| ||
| 04:02 | • Ticket [1178805fff]: 5 changes artifact: ae82215dbb user: msofer | |
|
2005-04-08
| ||
| 02:53 | • Ticket [1178805fff]: 4 changes artifact: dbdb2a9c25 user: jenglish | |
|
2005-04-07
| ||
| 19:41 | • New ticket [1178805fff]. artifact: ef33166b6c user: msofer | |
empty lists cause nasty surprises
Closed1178805fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2005-04-07 19:41:28
[Patch 1158008] causes segfaults for extensions that expect that a call to Tcl_ListObj* functions shimmers the object to tclListType, as it will fail to meet that assumption for zero-length lists. Notable example is Tile [Bug 1177266]. Even though this is IMO a bug in the extension and not in Tcl, the cost of fixing that and avoiding the grief is relatively small: do make it a tclListObjType, and let FreeListInternalRep() do the right thing with it - ie, nothing.
jenglishplain2005-04-08 02:53:54
Logged In: YES user_id=68433 It's not entirely clear whether the manpage guarantees this behavior or not, but it does seem strongly implied. "If listPtr is not already a list object, Tcl_ListObjGetElements will attempt to convert it to one; if the conversion fails, it returns TCL_ERROR [ ... ] Otherwise it returns TCL_OK [...]" I always took that to mean that if Tcl_ListObjGetElements(..., objPtr, ..) returns TCL_OK, then objPtr is now a list object (which I also took to mean, "the typePtr and internal representation fields are set as described above").
msoferplain2005-04-17 04:02:44
Logged In: YES user_id=148712 The more I think about this, the less I think it is a Tcl bug. Extensions should not make assumptions about the internal rep of Tcl_Objs. The issue will raise again with the changes in numerical treatment, eg in calls to Tcl_GetDoubleFromObj: according to the docs it "converts" to a double, but it may not cause a shimmering of objs that have an integral string or internal rep (IIUC). Kevin: opinion?
kennykbplain2005-04-19 22:14:48
Logged In: YES user_id=99768 Opinion posted to tcl-core. Now we need to convince (or outvote) tclguy.
hobbsplain2005-04-20 02:38:28
Logged In: YES user_id=72656 As was noted on chat, extensions *have* to make assumptions about internal reps because that's often necessary in building your own new Tcl_Obj type. Whether Tcl_Obj users should do so is debatable, but the docs certainly allow it (currently).
msoferplain2005-04-20 02:44:56
Logged In: YES user_id=148712 Retaking ownership, lest I forget to fix it by giving empty lists a tclListType. The wider discussion can continue in tcl-core
dkfplain2005-04-20 16:56:01
Logged In: YES user_id=79902 General note: extensions can make lots of assumptions about their own types of Tcl_Obj since they provide all the internal-rep management code for the type. The Q is about what assumptions can be made by code that is *not* managing the i-rep (e.g. extensions and the internal rep of lists, where all the official management code is in the Tcl core.)
jenglishplain2005-04-25 13:46:41
Logged In: YES user_id=68433 See also #1189274, which appears to have the same root cause (a Tcl_Obj * known to be "of list type" but without a valid intrep).
msoferplain2005-05-11 21:21:43
Logged In: YES user_id=148712 Will go back to the 8.4 behaviour wrt to empty lists, and maybe consider a more radical 'all empty lists returned by list ops have a list internal rep' (see performance aspects of [Bug 1143805]). Review [concat] handling of list arguments, making use of the new facilities for shared listReps.
dgpplain2006-03-10 10:03:55
Logged In: YES user_id=80530 anything left to fix here for 8.4.13 or 8.5a4 ?
nobodyplain2006-03-10 12:17:29
Logged In: NO > anything left to fix here for 8.4.13 or 8.5a4? Not that I know of -- the two known bugs that were triggered by the change have been fixed (one in Tile, another in the core itself), and the change itself has been reverted.
msoferplain2006-03-10 23:22:02
Logged In: YES user_id=148712 Correction: the change itself has not been reverted, empty lists are not always converted to list type: the behaviour is not identical to 8.4 in this respect. Still, I'm satisfied with the current state and no recent complaints have been recorded. Setting to Pending, and opening a performance bug for empty lists as arguments to [concat].
sf-robotplain2006-03-25 10:22:13
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.