View Ticket
2026-09-05
21:34 • Closed ticket [02fb67f4d3]: Crash on process shutdown plus 4 other changes artifact: d8679101cc user: bohagan
2026-08-02
21:43 • Ticket [02fb67f4d3]: 3 changes artifact: dc8ab81504 user: bohagan
20:06
Correct issue where at shutdown we free BioMethods before Tcl closes open channels. Fix for issue [02fb67f4d3]. check-in: 2a9aba281f user: bohagan tags: trunk, main
2026-07-30
01:21 • Ticket [02fb67f4d3] Crash on process shutdown status still Open with 5 other changes artifact: 507f438497 user: bohagan
2026-07-29
02:16 • New ticket [02fb67f4d3]. artifact: 67fd6dc463 user: anonymous

Ticket Hash: 02fb67f4d35b22b89ba627d28f24e65338b7e705
Title: Crash on process shutdown
Status: Closed Type: Code Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2026-09-05 21:34:47
24.9 days ago
Created: 2026-07-29 02:16:40
63.7 days ago
Version Found In: 2.0.1
User Comments:
anonymous added on 2026-07-29 02:16:40:

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, TclTLS crash - the fix, TclLS crash - verification.

Effectively, removing Tcl_CreateExitHandler() from generic/tls.c fixes the issue.


bohagan added on 2026-07-30 01:21:37:

Thanks for the report. AI sure is getting good now. I didn’t know about channels being closed after the exit handler runs. Sounds like a TCL issue too. I’ll get this fixed in the next few days. Thanks.


bohagan added on 2026-08-02 21:43:48:

This issue is fixed in trunk now. Rather than remove the Tcl_CreateExitHandler call, I made it a no-op so I can use it in the future.


bohagan added on 2026-09-05 21:34:47:
Fixed in [2a9aba281f740144].