Skip to content
Tcl Source Code History Of Ticket 771613ffffffffff
Login

History Of Ticket 771613ffffffffff

Artifacts Associated With Ticket 771613ffffffffff

  1. Ticket change [8c313df774] (rid 127705) by nobody on 2003-07-15 13:52:42:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OS platform: linux 2.4.20, glibc 2.3.2, gcc 3.2.2
      Problem behaviour:
      Incorrect syntax for the if command, where the body
      opening brace is on the next line rather than the same
      line as the
      if command, causes the interpreter to crash.
      In the sample code below, the barcode_* functions are just 
      supporting functions from the program which exhibited
      the problem. 
      I reduced it down as far as I could. I note that if I
      do not call
      barcode_scanner_parm_get in the if expression, but
      replace it
      with something like 0 == 0, the crash does not occur.
      To reproduce the problem, save the following code to a
      file,
      test.tcl, and issue the command:
      tclsh test.tcl
      A stack trace is also included below.
      Expected behaviour:
      Show syntax error message but do not crash.
      Code sample:
      ------snip--------
      proc barcode_scanner_parm_get {scanner parm} {
          global barcode_scanner
          if {[array get barcode_scanner $scanner,$parm] == ""} {
      return 0
          }
          return $barcode_scanner($scanner,$parm)
      }
      
      proc barcode_scanner_parm_set {scanner parm val} {
          global barcode_scanner
          array set barcode_scanner "$scanner,$parm $val"
      }
      
      proc barcode_scanner_exists {scanner} {
          global barcode_scanner
          if {[array get barcode_scanner $scanner,mode] != ""} {
      return 1
          } else {
      return 0
          }
      }
      
      proc barcode_scanner_init {scanner} {
          barcode_scanner_parm_set $scanner mode normal
          barcode_scanner_parm_set $scanner state idle
      }
      
      proc test {} {
          set scanner 1
          if {![barcode_scanner_exists $scanner]} {
      barcode_scanner_init $scanner
          }
          
          if {[barcode_scanner_parm_get $scanner log_id] != 0} {
      if {[barcode_scanner_parm_get $scanner workorder] == 0 &&
          [barcode_scanner_parm_get $scanner workorder] == 0}
      {
          rpc_return fail barcode-sequence no-workorder {}
      }
      set result [action_log_process_stop \
      [barcode_scanner_parm_get $scanner log_id]]
          }
      }
      
      test
      ------snip--------
      
      #0  0x42073499 in free () from /lib/tls/libc.so.6
      #1  0x400f4437 in TclpFree () from
      /usr/local/lib/libtcl8.4.so
      #2  0x400fa5bd in Tcl_Free () from
      /usr/local/lib/libtcl8.4.so
      #3  0x401107f6 in TclFreeJumpFixupArray () from
      /usr/local/lib/libtcl8.4.so
      #4  0x4010906f in TclCompileIfCmd () from
      /usr/local/lib/libtcl8.4.so
      #5  0x4010e995 in TclCompileScript () from
      /usr/local/lib/libtcl8.4.so
      #6  0x4010fa4b in TclCompileCmdWord () from
      /usr/local/lib/libtcl8.4.so
      #7  0x40108bb6 in TclCompileIfCmd () from
      /usr/local/lib/libtcl8.4.so
      #8  0x4010e995 in TclCompileScript () from
      /usr/local/lib/libtcl8.4.so
      #9  0x4010e28e in TclSetByteCodeFromAny () from
      /usr/local/lib/libtcl8.4.so
      #10 0x4010e417 in SetByteCodeFromAny () from
      /usr/local/lib/libtcl8.4.so
      #11 0x40116fc3 in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #12 0x400f7474 in Tcl_EvalObjEx () from
      /usr/local/lib/libtcl8.4.so
      #13 0x401046a8 in Tcl_SwitchObjCmd () from
      /usr/local/lib/libtcl8.4.so
      #14 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #15 0x401179ab in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #16 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #17 0x40141bea in TclObjInterpProc () from
      /usr/local/lib/libtcl8.4.so
      #18 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #19 0x400f6f5d in Tcl_EvalEx () from
      /usr/local/lib/libtcl8.4.so
      #20 0x400f7447 in Tcl_EvalObjEx () from
      /usr/local/lib/libtcl8.4.so
      #21 0x401415ed in Tcl_UplevelObjCmd () from
      /usr/local/lib/libtcl8.4.so
      #22 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      ---Type <return> to continue, or q <return> to quit---
      #23 0x401179ab in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #24 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #25 0x40117a50 in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #26 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #27 0x40141bea in TclObjInterpProc () from
      /usr/local/lib/libtcl8.4.so
      #28 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #29 0x400f6f5d in Tcl_EvalEx () from
      /usr/local/lib/libtcl8.4.so
      #30 0x40147417 in AfterProc () from
      /usr/local/lib/libtcl8.4.so
      #31 0x40146cc7 in TclServiceIdle () from
      /usr/local/lib/libtcl8.4.so
      #32 0x40138d96 in Tcl_DoOneEvent () from
      /usr/local/lib/libtcl8.4.so
      #33 0x4011668a in Tcl_VwaitObjCmd () from
      /usr/local/lib/libtcl8.4.so
      #34 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #35 0x401179ab in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #36 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #37 0x400f7474 in Tcl_EvalObjEx () from
      /usr/local/lib/libtcl8.4.so
      #38 0x400fdb3d in Tcl_IfObjCmd () from
      /usr/local/lib/libtcl8.4.so
      #39 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #40 0x400f6f5d in Tcl_EvalEx () from
      /usr/local/lib/libtcl8.4.so
      #41 0x400f7447 in Tcl_EvalObjEx () from
      /usr/local/lib/libtcl8.4.so
      #42 0x400fb400 in Tcl_EvalObjCmd () from
      /usr/local/lib/libtcl8.4.so
      #43 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #44 0x401179ab in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #45 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      ---Type <return> to continue, or q <return> to quit---
      #46 0x40141bea in TclObjInterpProc () from
      /usr/local/lib/libtcl8.4.so
      #47 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #48 0x401179ab in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #49 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #50 0x40141bea in TclObjInterpProc () from
      /usr/local/lib/libtcl8.4.so
      #51 0x400f668d in TclEvalObjvInternal () from
      /usr/local/lib/libtcl8.4.so
      #52 0x401179ab in TclExecuteByteCode () from
      /usr/local/lib/libtcl8.4.so
      #53 0x4011706b in TclCompEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #54 0x400f7474 in Tcl_EvalObjEx () from
      /usr/local/lib/libtcl8.4.so
      #55 0x40122d3f in Tcl_RecordAndEvalObj () from
      /usr/local/lib/libtcl8.4.so
      #56 0x40122c27 in Tcl_RecordAndEval () from
      /usr/local/lib/libtcl8.4.so
      #57 0x400472fd in StdinProc () from
      /usr/local/lib/libtk8.4.so
      #58 0x4012a09f in Tcl_NotifyChannel () from
      /usr/local/lib/libtcl8.4.so
      #59 0x4015598a in FileHandlerEventProc () from
      /usr/local/lib/libtcl8.4.so
      #60 0x40138a64 in Tcl_ServiceEvent () from
      /usr/local/lib/libtcl8.4.so
      #61 0x40138d7e in Tcl_DoOneEvent () from
      /usr/local/lib/libtcl8.4.so
      #62 0x4003bf33 in Tk_MainLoop () from
      /usr/local/lib/libtk8.4.so
      #63 0x4004718b in Tk_MainEx () from
      /usr/local/lib/libtk8.4.so
      #64 0x080487f1 in main ()
      #65 0x42015574 in __libc_start_main () from
      /lib/tls/libc.so.6
      
      
    4. foundin initialized to: "obsolete: 8.4.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "Incorrect if syntax crashes tcl"
    11. type initialized to: "Bug"
  2. Ticket change [f894bf216b] (rid 91562) by msofer on 2003-07-15 21:12:31:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Contact info: submitted by alias mb in the tcl'ers chat
      (contact data there, I will not replicate it here without
      mb's permission)
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [6b18679765] (rid 128258) by msofer on 2003-07-15 21:33:04:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Crash confirmed, case reduced to
      
        proc test {} {
            if {[someLongNameIsApparentlyNecessary]  
      &&[longNamePossiblyNotTheSame]}
        } 
        test
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [78587bb696] (rid 89949) by msofer on 2003-07-15 21:33:29:

    1. priority changed to: "9 Immediate"
  5. Ticket change [b3f7c0b1ee] (rid 124937) by dgp on 2003-07-16 01:23:35:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      making no progress tracking this
      down.  It's a Heisenbug that
      goes away when I enable symbols.
      
      nasty memory corruption somewhere.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [b20f74cd16] (rid 98270) by dgp on 2003-07-16 03:15:35:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      FWIW, I can only reproduce
      the crash on Solaris using
      the original demo script, not
      the reduced one.
      
      Furthermore, the crash only
      shows up for Tcl 8.4.3 and
      the tip of the core-8-4-branch.
      Releases, Tcl 8.4.0, 8.4.1, 8.4.2
      do not crash.  
      
      That may or may not be meaningful.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [7a0714f437] (rid 90234) by hobbs on 2003-07-16 03:22:31:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      bug introduced by 711371 fix.  Assigning to dgp to correct.
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. username: "hobbs"
  8. Ticket change [56a30d2776] (rid 94352) by dgp on 2003-07-16 04:00:19:

    1. closedate changed to: "2003-07-15T21:00:19"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
      fix is attached patch, now committed
      to core-8-4-branch and HEAD.
      
      If testing fails, please re-open this bug.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"
  9. Add attachment "771613.patch" [4c8a9466a6] (rid 126908) by dgp on 2003-07-16 04:00:20.

  10. Ticket change [a6e298f1b0] (rid 98686) by dgp on 2003-07-16 04:00:21:

    1. icomment:
      
      
      File Added - 55909: 771613.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"