Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3fd8a534e2e4801c55265f80bbbb63d91ef13136
Ticket: 261a8a79f011fa26ecdaafbdc1c24c1285f48de3
Segfault due to integer overflow in TranslateInputEOL()
User & Date: dgp on 2015-11-05 15:21:17
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    set outfile [ open "big.tcl" w ]
    set count 59000000
    set current 0
    while { $current != $count } {
        puts $outfile "# a comment $count"
        incr current
    }
    
    puts $outfile "puts \"hello world\""
    
    Generate the file 'big.tcl' and then execute it either by sourcing it, or by running 
    
    tclsh big.tcl
    
    
    #0 0x00007ffff716ab6a in memchr () from /lib64/libc.so.6
    #1 0x00000000005152e8 in TranslateInputEOL (statePtr=0x878160,
    dstStart=0x7fff30793020 "\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a commen"...,
    srcStart=0x7fff30793020 "\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a comment 59000000\n# a commen"..., dstLenPtr=0x7fffffffd13c, srcLenPtr=0x7fffffffd140)
    at /home/dgp/fossil/tcl/generic/tclIO.c:6395
    #2 0x0000000000514c69 in ReadChars (statePtr=0x878160, objPtr=0x8649d0,
    charsToRead=-1073733632, factorPtr=0x7fffffffd1e8)
    at /home/dgp/fossil/tcl/generic/tclIO.c:6066
    #3 0x00000000005146ff in DoReadChars (chanPtr=0x8833f0, objPtr=0x8649d0,
    toRead=-1073733632, appendFlag=-204)
    at /home/dgp/fossil/tcl/generic/tclIO.c:5793
    #4 0x0000000000514492 in Tcl_ReadChars (chan=0x8833f0, objPtr=0x8649d0,
    toRead=-1, appendFlag=-204) at /home/dgp/fossil/tcl/generic/tclIO.c:5678
    #5 0x00000000005289e4 in Tcl_FSEvalFileEx (interp=0x8205c0, pathPtr=0x863b00,
    encodingName=0x0) at /home/dgp/fossil/tcl/generic/tclIOUtil.c:1803
    
  5. is_private changed to: "0"
  6. login: "dgp"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Critical"
  10. status changed to: "Open"
  11. submitter changed to: "dgp"
  12. subsystem changed to: "25. Channel System"
  13. title changed to: "Tcl_ReadChars() crash."
  14. type changed to: "Bug"