Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b83c7bb903741909f01f444b781e3c0f61a37c4bf691709d6bdc3463fdf4e620
Ticket: a9625d1f53554f9d575c6e3a58bbd80f5f9a2ab6
lseq list causes crash with lindex and only 1 arg
User & Date: anonymous on 2024-03-07 10:21:39
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    % set bar [list 1 2 3 4 5 6 7 8 9]
    1 2 3 4 5 6 7 8 9
    % lindex $bar
    1 2 3 4 5 6 7 8 9
    
    That works, but this crashes (repeatable):
    
    % set foo [lseq 100]
    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
    % lindex $foo
    
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7cad621 in TclLindexFlat (interp=0x5555555740c0, listObj=0x5555556b3bd0, indexCount=0, indexArray=0x555555578178)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclListObj.c:2674
    2674		Tcl_IncrRefCount(elemObj);
    (gdb) bt
    #0  0x00007ffff7cad621 in TclLindexFlat (interp=0x5555555740c0, listObj=0x5555556b3bd0, indexCount=0, indexArray=0x555555578178)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclListObj.c:2674
    #1  0x00007ffff7c5d0ca in TEBCresume (data=0x5555556b3ba8, interp=0x5555555740c0, result=0)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclExecute.c:4891
    #2  0x00007ffff7b5c961 in TclNRRunCallbacks (interp=0x5555555740c0, result=0, rootPtr=0x0)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclBasic.c:4613
    #3  0x00007ffff7b5f9c5 in TclEvalObjEx (interp=0x5555555740c0, objPtr=0x5555556b3f00, flags=131072, invoker=0x0, word=0)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclBasic.c:6073
    #4  0x00007ffff7b5f959 in Tcl_EvalObjEx (interp=0x5555555740c0, objPtr=0x5555556b3f00, flags=131072)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclBasic.c:6054
    #5  0x00007ffff7c76cd2 in Tcl_RecordAndEvalObj (interp=0x5555555740c0, cmdPtr=0x5555556b3f00, flags=131072)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclHistory.c:182
    #6  0x00007ffff7c76925 in Tcl_RecordAndEval (interp=0x5555555740c0, cmd=0x7fffffffdd38 "lindex $foo\n", flags=131072)
        at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclHistory.c:74
    #7  0x00007ffff7e2fa5b in StdinProc (clientData=0x7fffffffdd10, dummy407=2)
        at /home/et/vwtests/mytcltk/tk9.0b1/unix/../generic/tkMain.c:449
    #8  0x00007ffff7c8c91d in Tcl_NotifyChannel (channel=0x5555556febb0, mask=2) at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclIO.c:8577
    #9  0x00007ffff7d21330 in FileWatchNotifyChannelWrapper (clientData=0x5555556febb0, mask=2)
        at /home/et/vwtests/mytcltk/tcl9.0b1/unix/tclUnixChan.c:494
    #10 0x00007ffff7d2fa15 in FileHandlerEventProc (evPtr=0x555555612270, flags=-3)
        at /home/et/vwtests/mytcltk/tcl9.0b1/unix/tclUnixNotfy.c:322
    #11 0x00007ffff7cbc82e in Tcl_ServiceEvent (flags=-3) at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclNotify.c:710
    #12 0x00007ffff7cbcc6e in Tcl_DoOneEvent (flags=-3) at /home/et/vwtests/mytcltk/tcl9.0b1/generic/tclNotify.c:1007
    #13 0x00007ffff7e1869c in Tk_MainLoop () at /home/et/vwtests/mytcltk/tk9.0b1/unix/../generic/tkEvent.c:2127
    #14 0x00007ffff7e2f80e in Tk_MainEx (argc=-1, argv=0x7fffffffe018, appInitProc=0x555555555200 <Tcl_AppInit>, interp=0x5555555740c0)
        at /home/et/vwtests/mytcltk/tk9.0b1/unix/../generic/tkMain.c:378
    #15 0x00005555555551f9 in main (argc=1, argv=0x7fffffffe018) at /home/et/vwtests/mytcltk/tk9.0b1/unix/../unix/tkAppInit.c:115
    (g
    
  5. foundin changed to: "9.0b1"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "00bdf9c17e050798051e55dc79c62671cedf03c1"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "- New Builtin Commands"
  15. title changed to: "lseq list causes crash with lindex and only 1 arg"
  16. type changed to: "Bug"