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

History Of Ticket 597575ffffffffff

Artifacts Associated With Ticket 597575ffffffffff

  1. Ticket change [87b245fa33] (rid 131741) by andreas_kupries on 2002-08-20 02:47:32:

    1. assignee initialized to: "vasiljevic"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      When executing the script below the tcl interpreter may
      crash every once in a while (I usually have to execute
      it once or twice for the problem to happen).
      
      -----------------
      package require Thread
      
      puts [info loaded]
      puts [pwd]
      
      set t [::thread::create]
      after 5000 "::thread::send $t exit"
      -----------------
      
      Basically the interpreter is shutdown from inside the
      created thread, and not the main-thread, and the main
      thread is running an after. Timing-depending, it seems
      that the exit killed the Tcl_Release-data structure
      before the after in the main thread is completely done
      with its interpreter, causing it to try to release the
      structure with nothing being there anymore.
      
      Stack trace: attached, to prevent it from taking up
      space in the notification mails.
      
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "8"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "andreas_kupries"
    9. subsystem initialized to: "49. Threading"
    10. title initialized to: "[exit] in sub-thread may crash."
    11. type initialized to: "Bug"
  2. Add attachment "st" [231ab9441f] (rid 130860) by andreas_kupries on 2002-08-20 09:47:32.

  3. Ticket change [8d73f0c0e9] (rid 127937) by andreas_kupries on 2002-08-20 09:47:33:

    1. icomment:
      
      
      File Added - 29400: st
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  4. Ticket change [906d020388] (rid 120450) by andreas_kupries on 2002-08-20 09:51:05:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      I forgot that the script contains a 'vwait forever' to wait
      for the after.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  5. Ticket change [2ef87e68aa] (rid 92974) by andreas_kupries on 2002-08-20 10:00:55:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      Guess I should also note that I consider this problem ...
      diificult ... to fix, expecially with the current system for
      finalizing things. Because of this I am absolutely willing
      to live with the problem, if this is properly documented,
      like below, or similar.
      
      In a threaded environment the main thread of a script, i.e.
      the thread created together with the tcl process is special.
      Do not exit the application from one of the threads created
      by the script. alsways use the main thread for this, and
      only after all sub-threads have exited. Otherwise crashes
      may occur during process tear-down.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  6. Ticket change [35a122c6bf] (rid 106971) by dgp on 2002-08-20 21:48:29:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Would it a reasonable solution to 
      not define [exit] in interps that
      are in threads other than the main
      one?  Or perhaps to define [exit]
      in those threads to something
      that deletes the interp, and/or exits the
      thread?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [b3448f8732] (rid 98502) by vasiljevic on 2002-08-20 23:55:48:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      Please visit the:
      Bug ID: 486399
      Category 80. Thread package
      
      We did already discussed this matter.
      but never really got to a solution.
      As AK says, if properly documented,
      one should be able to live with this.
      Otherwise, we must revise the finalization
      stuff and add some reference counting
      and things like that. 
      
      Zoran
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  8. Ticket change [acb50700a2] (rid 101342) by andreas_kupries on 2002-08-21 00:00:02:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      Ah. Thanks. I was wondering if we had that encountered 
      before, but was not sure. I guess we can close this as a 
      duplicate then.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  9. Ticket change [6f21452253] (rid 100260) by dgp on 2002-08-21 00:02:46:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      I don't know anything about the details involved
      here, but the issue seems similar in spirit to me
      to the problem of [exit] in a slave interp
      
          http://mini.net/tcl/894
      
      The solution that feels right to me is that [exit]
      should have appropriate behavior for the context
      it is in.  In a master interp, ok exit the application,
      but in a slave, just destroy that one interp.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [e748f308da] (rid 104430) by hobbs on 2003-02-22 01:57:00:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Zoran - what is the status of this one?
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  11. Ticket change [83ba1098c8] (rid 117430) by vasiljevic on 2003-02-22 15:59:02:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      Pending. As AK (se below) correctly stated, this one is 
      pretty difficult to solve. We ought to change the way the 
      core is finalizing various subsytems. We'd need to  
      introduce refcounts on those subsystems and do the tear 
      down on the last-thread exit. Now, they are finalized on the 
      main-thread exit which obviously affects other thread in the 
      process still using the Tcl library. 
       
      I'd say, that this should still be left open, as a reminder.  
      I also think that in the process of the Tcl Thread API revamp 
      (which we (I) should do) this issue might be addressed. 
        
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  12. Ticket change [242f964a1b] (rid 131071) by dgp on 2003-11-13 08:07:37:

    1. foundin changed to: "obsolete: 8.4.4"
  13. Ticket change [52b9edb1dd] (rid 126366) by dgp on 2006-03-10 11:37:26:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      There's been a lot of changes
      in Tcl's finalization sequence
      in the last 3 years.
      
      Any chance some of those changes
      fixed this bug?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [8f9f9e3caf] (rid 120309) by vasiljevic on 2006-03-10 20:03:48:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      No chances. 
      Please look at the comment I just added to Bug #486399.
      
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  15. Ticket change [a17d584a05] (rid 109720) by georgeps on 2008-08-15 10:23:03:

    1. icomment:
      Logged In: YES 
      user_id=585068
      Originator: NO
      
      bug report 2001201 has a patch to fix this.
      
      "We ought to change the way the core is finalizing various subsytems. We'd need to introduce refcounts on those subsystems and do the tear down on the last-thread exit."
      
      Why would we need that to fix the Tcl_Exit problem?  Why not just remove the full Tcl_Finalize from Tcl_Exit, as the patch associated with 2001201 does?
      
      I agree we need the reference count solution if we want Tcl_Finalize to work in the multiple-Tcl-thread case, which it doesn't currently, but I don't know if that's reasonable or doable when Tcl_Finalize cleans up global state for all Tcl threads, and 1 or more of the threads that are not calling Tcl_Finalize may be in unknown states.  It seems simpler and more maintainable to just have threads join/exit and cleanup via Tcl_Finalize when all other threads have exited.
      
      
      
    2. login: "georgeps"
    3. mimetype: "text/plain"
    4. username: "georgeps"
  16. Ticket change [9ba9f7b16b] (rid 111167) by ferrieux on 2009-06-16 04:54:42:

    1. icomment:
      I strongly suspect this is a dup of 2001201 indeed.
      Please review George's updated patch there.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  17. Ticket change [aa77a291fa] (rid 100933) by ferrieux on 2009-06-18 03:02:59:

    1. icomment:
      Since the patch in 2001201 has been applied, please test.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  18. Ticket change [1b21f5a037] (rid 123094) by dkf on 2009-06-18 15:18:23:

    1. assignee changed to: "ferrieux"
    2. closedate changed to: "2009-06-18T08:18:23"
    3. closer changed to: "dkf"
    4. icomment:
      
      
      allow_comments - 1
      
      Works with HEAD when I test with repeated runs of this line...
      echo 'load /System/Library/Tcl/thread2.6/libthread2.6.dylib;set t [::thread::create]; puts [info patch],[info loaded],[package require Thread],$t;after 2000 "puts sending...;thread::send $t exit"; vwait forever' | make -C unix shell
      
      Looks to me like you and GPS have nailed it. Great!
      
      
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "dkf"