Ticket Change Details
Overview

Artifact ID: 67fd6dc463f415d9558952aa80a31c3e0c8a638f98f893b79ac4197b957bcf3b
Ticket: 02fb67f4d35b22b89ba627d28f24e65338b7e705
Crash on process shutdown
User & Date: anonymous on 2026-07-29 02:16:40
Changes

  1. foundin changed to: "2.0.1"
  2. icomment:
    I got a crash running Tcl/Tk trunk (9.1b1) and tcltls 2.0.1, on linux x84_64, OpenSSL 3.0.13
    
    While I couldn't write a short script to repro, the setup is as follow:
    
    * tkcon runs a script from a modified version of jabberlib from the coccinella project.
    * the script connects to the tclers's chat using tls (tested with both tls::socket at port 5223 and tls::import at port 5222).
    * after successful connection, Tk is loaded in the interpreter with [package require Tk].
    * type [exit]
    
    The process segfaults at exit.
    
    The relevant lines from the backtrace are (tcltls built with --enable-symbols)
    
    ```
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff30ee500 in BIO_ctrl () from /lib/x86_64-linux-gnu/libcrypto.so.3
    (gdb) bt
    #0  0x00007ffff30ee500 in BIO_ctrl () at /lib/x86_64-linux-gnu/libcrypto.so.3
    #1  0x00007ffff3d79369 in ??? () at /lib/x86_64-linux-gnu/libssl.so.3
    #2  0x00007ffff30ee502 in BIO_ctrl () at /lib/x86_64-linux-gnu/libcrypto.so.3
    #3  0x00007ffff5e5d812 in TlsCloseProc ()
        at /usr/local/lib/tcltls2.0.1/libtcl9tls2.0.1.so
    #4  0x00007ffff7cff7b4 in TclFinalizeIOSubsystem ()
        at /usr/local/lib/libtcl9.1.so
    #5  0x00007ffff7cd0344 in FinalizeThread () at /usr/local/lib/libtcl9.1.so
    #6  0x00007ffff7cd10f3 in Tcl_Exit () at /usr/local/lib/libtcl9.1.so
    #7  0x00007ffff7c6ba01 in Tcl_ExitObjCmd () at /usr/local/lib/libtcl9.1.so
    #8  0x00007ffff7c5090a in TclNRRunCallbacks () at /usr/local/lib/libtcl9.1.so
    ```
    
    Steve Landers runs an analysis using Claude Opus 5 and it found these issues: [TclTLS crash - the problem](http://paste.tclers.tk/6232), [TclTLS crash - the fix](http://paste.tclers.tk/6233), [TclLS crash - verification](http://paste.tclers.tk/6234).
    
    Effectively, removing Tcl_CreateExitHandler() from generic/tls.c fixes the issue.
    
  3. login: "anonymous"
  4. mimetype: "text/x-markdown"
  5. severity changed to: "Critical"
  6. status changed to: "Open"
  7. title changed to: "Crash on process shutdown"
  8. type changed to: "Code Defect"