#3861 "lsearch -exact -integer ..." crashes

obsolete: 8.5b3
closed-fixed
9
2007-12-05
2007-12-05
No

"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)

Discussion

  • Donal K. Fellows

    • labels: 104239 --> 105659
    • priority: 5 --> 9
    • assigned_to: msofer --> dkf
     
  • miguel sofer

    miguel sofer - 2007-12-05

    Logged In: YES
    user_id=148712
    Originator: NO

    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

     
  • Donal K. Fellows

    • labels: 105659 --> 17. Commands I-L
     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902
    Originator: NO

    Was a shimmering smash.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks