Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9a6ec0f1679e2d5e6d795ebacd84a255cbb0ad4b
Ticket: 2001201fffffffffffffffffffffffffffffffff
Tcl_Exit() shouldn't call the full Tcl_Finalize() path
User & Date: georgeps on 2008-06-23 20:53:24
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Tcl_Exit() often results in segfaults on exit, when more than 1 thread is busy at the time of a Tcl_Exit().  The problem is that Tcl_Finalize cleans up the state used by active threads.  This problem has existed for a long time.  The comments in Tcl_Finalize indicate the expectation of 1 thread "there really should only be one thread alive at this moment."
    
    I propose this possible solution:
    1. move the invoking in Tcl_Finalize of Tcl exit handlers into TclInvokeExitHandlers();  
    
    2. Tcl_Finalize can call TclInvokeExitHandlers()  
    
    3. Tcl_Exit calls TclInvokeExitHandlers() instead of Tcl_Finalize().
    
    
    Tcl_Finalize will still work for those that wish to use it, and Tcl_Exit will work in the multiple active threads case.
    
  4. foundin changed to: "obsolete: 8.6a0"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "georgeps"
  10. subsystem changed to: "49. Threading"
  11. title changed to:
    Tcl_Exit() shouldn't call the full Tcl_Finalize() path
    
  12. type changed to: "Bug"