Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2c3bc9ddd2185c4fc6d66be2a42b37e72037e4e7
Ticket: 35a839cba8a4e6bbdcd9567f958d56076fe5bd0f
Can not reinitialize Tcl after Tcl_Finalize()
User & Date: anonymous on 2014-04-14 16:38:04
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Initialize Tcl and then call Tcl_Finalize().
    Now try to re-initialize Tcl, with Tcl_FindExecutable()
    This gives "TclInitSubsystems called while exiting" followed by an abort().
    
    This used to work prior to Tcl/Tk 8.6.
    
    Looking at the code, my guess is that this is related to the variable "inExit" in tclEvent.c (not in 8.5.15). Its comment says "This variable is set to 1 when Tcl_Exit is called" and it is never reset to zero.
    
    In 8.5.15, there is a similar variable "inFinalize" (gone in 8.6.1) with the comment "This variable is set to 1 when Tcl_Finalize is called, and at the end of its work, it is reset to 0.".
    
    Note the difference, the new variable "inExit" is never reset to 0.
    
    The backtrace says:
    0   libsystem_kernel.dylib        	0x00007fff91445ce2 __pthread_kill + 10
    1   libsystem_c.dylib             	0x00007fff8ec8a7d2 pthread_kill + 95
    2   libsystem_c.dylib             	0x00007fff8ec7ba7a abort + 143
    3   Tcl                           	0x0000000107f88c92 Tcl_PanicVA + 449
    4   Tcl                           	0x0000000107f88d34 Tcl_Panic + 162
    5   Tcl                           	0x0000000107f50927 TclInitSubsystems + 30
    6   Tcl                           	0x0000000107f47de3 Tcl_FindExecutable + 17
    
  5. foundin changed to: "8.6.1"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "703c0a7e584f2f45023961b4a76843affe777033"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "50. Embedding Support"
  15. title changed to: "Can not reinitialize Tcl after Tcl_Finalize()"
  16. type changed to: "Bug"