Skip to content
Tcl Source Code History Of Ticket 1988779fffffffff
Login

History Of Ticket 1988779fffffffff

Artifacts Associated With Ticket 1988779fffffffff

  1. Ticket change [32735f3e23] (rid 93612) by cnassau on 2008-06-09 10:30:30:

    1. assignee initialized to: "vasiljevic"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      We're occasionally seeing panics with Thread.2.6.5 and Tcl.8.5.2:
      
         Tcl_SetStringObj called with shared object
      
      A typical stack trace is
      
      IOT/Abort trap in pthread_kill at 0xd005aaf4 ($t8)
      0xd005aaf4 (pthread_kill+0xa8) 80410014        lwz   r2,0x14(r1)
      (dbx) where
      pthread_kill(??, ??) at 0xd005aaf4
      _p_raise(??) at 0xd005a100
      raise.raise(??) at 0xd01e367c
      abort.abort() at 0xd01f2280
      Tcl_PanicVA() at 0xd4f14c78
      Tcl_Panic() at 0xd4f14cf4
      Tcl_SetStringObj() at 0xd4f3293c
      ThreadSend() at 0xd5ded484
      ThreadSendObjCmd() at 0xd5dea548
      TclEvalObjvInternal() at 0xd4f4b1c8
      (...)
      
      The implementation of ThreadSend in file thread2.6.5/generic/threadCmd.c contains the lines
      
          code = resultPtr->code;
          Tcl_SetStringObj(Tcl_GetObjResult(interp), resultPtr->result, -1);
      
      which seems suspicious. I see no compelling reason why Tcl_GetObjResult(interp) should be unshared at that point, so a plain
      
          Tcl_SetResult(interp, resultPtr->result, TCL_VOLATILE);
      
      should be used instead.
      
      Note: there's also a similar line in SvObjObjCmd in file 
      thread2.6.5/generic/threadSvCmd.c
      
       
      
    4. foundin initialized to: "obsolete: 8.5.2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "cnassau"
    10. subsystem initialized to: "80. Thread Package"
    11. title initialized to: "Tcl_SetStringObj called with shared object"
    12. type initialized to: "Bug"
  2. Ticket change [754d6065b1] (rid 105366) by dkf on 2008-06-10 20:30:21:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      I prefer this:
      Tcl_SetObjResult(interp, Tcl_NewStringObj(resultPtr->result, -1));
      though I'd even more strongly prefer it if the resultPtr pointed to a structure that knew the length of the string being transferred.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [10dab16309] (rid 95032) by vasiljevic on 2008-06-12 11:19:11:

    1. icomment:
      Logged In: YES 
      user_id=95086
      Originator: NO
      
      I personally do not care as long as it works. I believe this pattern is left
      in the code by mistake as I tried to change that behaviour long time ago.
      
      And, I haven't sucked it out of my finger. This stood (perhaps still stays)
      in the Tcl docs as a preffered way how to handle result object. Do not ask
      me where and when I read that. I can't remember. I just now I read that
      and wrote it accodring to the recomendation, just to find out that this
      brought lots of problems down the road. So I wholesale changed all
      my code to scrap those out. Obviously in the threading extension there
      are places where this is still used. I will go thru and remove all those
      parts. 
      
      Instead of 
      Tcl_SetStringObj(Tcl_GetObjResult(interp), resultPtr->result, -1);
      
      it will read
      Tcl_SetObjResult(interp, Tcl_NewStringObj(resultPtr->result, -1));
      
      The original "idea" was that the former should save us the need to
      create new Tcl_Obj as Tcl result should already point to a good one.
      And that one should not be shared. This is sometimes not true for
      whatever reasons, I do not know.
      
      Thanks for the report. 
      Zoran
      
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  4. Ticket change [71f845828b] (rid 100784) by hobbs on 2008-11-04 06:47:47:

    1. icomment:
      Fixed to use safest Tcl_SetObjResult(interp, Tcl_NewStringObj(...))
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  5. Ticket change [bb36c6eca6] (rid 129446) by hobbs on 2008-11-04 06:47:51:

    1. closedate changed to: "2008-11-03T23:47:51"
    2. closer changed to: "hobbs"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"