Skip to content
Tcl Source Code History Of Ticket 88aef05cda
Login

History Of Ticket 88aef05cda

Artifacts Associated With Ticket 88aef05cda

  1. Ticket change [426b792b57] (rid 134396) by anonymous on 2013-09-30 03:25:53:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      The following code causes the Tcl interpreter to crash. Note the code is buggy (recursively enters the blocking proc via chan configure. But should not cause an interpreter crash.
      
      namespace eval demo {}
      proc demo::initialize {chan mode} {
          return {initialize finalize watch blocking read write configure cget cgetall}
      }
      
      proc demo::finalize {chan} {
      }
      
      proc demo::blocking {chan mode} {
          chan configure $chan -blocking $mode
          return
      }
      
      
      namespace eval demo {
          namespace export initialize finalize blocking 
          namespace ensemble create
      }
      
      set ch [chan create {read write} demo]
      chan configure $ch -blocking 0
      
      -> crash
      
    5. foundin initialized to: "8.6.0"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "ccd5cde62dd01c9e5ba22e6d69d341245556ac4c"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "25. Channel System"
    15. title initialized to:
      Script level application bug in refchan causes Tcl crash
      
    16. type initialized to: "Bug"
  2. Ticket change [c13acb90eb] (rid 134436) by dgp on 2013-09-30 15:19:40:

    1. assignee changed to: "aku"
    2. foundin changed to: "8.5.15"
    3. icomment:
      Confirmed the segfault.
      
      Also crashes in 8.5.15 and 8.5.0, so
      this is not a recent regression.
      
      Passing on to the refchan maintainer for
      a deeper look.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. priority changed to: "7 High"
  3. Ticket change [68f437734f] (rid 134741) by aku on 2013-10-17 16:20:44:

    1. icomment:
      Most likely some data structure not getting properly preserved and/or locked against bad re-entrance.
      
      Likely also in the 8.6 branch, and novem
      
    2. login: "aku"
    3. mimetype: "text/plain"
    4. username: "aku"
  4. Ticket change [47c5be4fe4] (rid 137463) by dgp on 2014-04-02 02:40:10:

    1. icomment:
      This one is pretty ugly.
      
      The problem arises because the reflected
      channel builds the command to be evaluated
      in an array within the reflected channel
      data structure, rcPtr->argv .  This is presumably
      so that the cost of allocating a new eval array
      doesn't have to be paid each time.
      
      The problem is if there is one argv array per
      reflected channel, then there can only be one
      InvokeTclMethod() call operating on each
      reflected channel at a time.  As soon as you 
      try to do two concurrently -- such as when 
      one nests in the other -- they will stomp on
      each other's argument words, and crashing is
      about the nicest thing to expect.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  5. Ticket change [7a9537f4d6] (rid 137482) by aku on 2014-04-02 16:17:48:

    1. icomment:
      > This is presumably so that the cost of allocating
      > a new eval array doesn't have to be paid each time.
      
      I am very sure that this is what is was thinking at the time.
      
      > can only be InvokeTclMethod() call operating on each
      > reflected channel at a time.
      
      Yes. Also something I was definitely _not_ seeing when writing the code.
      
      So, possible solutions ...
      
      (1) Dynamically (de)allocate the damn array in each call of InvokeTclMethod()
      (2) Flatly forbid the recursive entry of InvokeTclMethod().
      
      In terms of implementation both possibilities seem to be equivalent in difficulty, i.e. while not trivial, at least easy.
      
      In light of other data structures needing to be preserved for such calls, as demonstrated by related bug reports I currently trend towards preferring (2).
      
    2. login: "aku"
    3. mimetype: "text/plain"
  6. Ticket change [8bf7ab0a60] (rid 137604) by dgp on 2014-04-15 16:11:53:

    1. assignee changed to: "dgp"
    2. icomment:
      Fix committed to 8.5 branch.
      
      Additional cleanup and improvements pending.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  7. Ticket change [9541053ec4] (rid 137605) by dgp on 2014-04-15 17:26:23:

    1. closedate changed to: "2456763.22666485"
    2. closer changed to: "dgp"
    3. icomment: "fix merged to trunk."
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"