Share

Tcl

Tracker: Bugs

9 "lsearch -exact -integer ..." crashes - ID: 1844789
Last Update: Comment added ( dkf )

"lsearch" crashes under certain circumstances:

Condition 1:
The list and the query object share the same Tcl_Obj.

Condition 2:
Options used for lsearch are "-exact" and "-integer" or "-real"

crash example1:
set x 0
set y $x
lsearch -exact -integer $x $y


crash example2:
set x 0.2
set y $x
lsearch -exact -real $x $y

does not crash (example1 without -exact):
set x 0
set y $x
lsearch -integer $x $y

I tested this with tcl8.5b3 (windows) and tcl8.5b1 (linux)


tobias_hippler ( thippler ) - 2007-12-05 12:42

9

Closed

Fixed

Donal K. Fellows

17. Commands I-L

obsolete: 8.5b3

Public


Comments ( 2 )

Date: 2007-12-05 13:45
Sender: dkfProject Admin


Was a shimmering smash.


Date: 2007-12-05 13:29
Sender: msoferProject AdminAccepting Donations


Verified also in 8.4 - ie, this is not due to the new List intrep.

Stack trace of the first example shows that itemPtr at line 3162 in
tclCmdIl.c has both bytes and typePtr NULL, and refCount 0. This is not a
valid state for a Tcl_Obj


Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Open 2007-12-05 13:45 dkf
close_date - 2007-12-05 13:45 dkf
resolution_id None 2007-12-05 13:45 dkf
category_id 18. Commands M-Z 2007-12-05 13:31 dkf
category_id 10. Objects 2007-12-05 13:15 dkf
assigned_to msofer 2007-12-05 13:15 dkf
priority 5 2007-12-05 13:15 dkf