Artifacts Associated With Ticket d1554fca55e91bac
Ticket change [4fec757363] (rid 217051) by kevin_walzer on 2023-08-07 15:32:33:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
] kevin_walzer % package require http 2.10b1 % package require tls 1.7.23 % http::register https 443 [list ::tls::socket -autoservername true -require true ] 443 {::tls::socket -autoservername true -require true} % set tok [http::geturl https://www.tcl.tk/] Segmentation fault: 11 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 0x0 ??? 1 Tcl 0x104d01be4 Tcl_UnregisterChannel + 348 The crash happens with the tcltls extension, but touches Tcl's core channel code, so I am opening this ticket under Tcl. - foundin initialized to: "Tip of Tcl 9"
- is_private initialized to: "0"
- login: "kevin_walzer"
- priority initialized to: "5 Medium"
- private_contact initialized to: "fd9290ae5f1a8509202a94b7afe132a13188e0cd"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "kevin_walzer"
- subsystem initialized to: "25. Channel System"
- title initialized to: "Crash with ::tls::socket"
- type initialized to: "Bug"
Ticket change [15f939f4b6] (rid 217052) by kevin_walzer on 2023-08-07 15:34:57:
- comment changed to:
kevin_walzer % package require http 2.10b1 % package require tls 1.7.23 % http::register https 443 [list ::tls::socket -autoservername true -require true ] 443 {::tls::socket -autoservername true -require true} % set tok [http::geturl https://www.tcl.tk/] Segmentation fault: 11 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 0x0 ??? 1 Tcl 0x104d01be4 Tcl_UnregisterChannel + 348 The crash happens with the tcltls extension, but touches Tcl's core channel code, so I am opening this ticket under Tcl. - login: "kevin_walzer"
- mimetype: "text/plain"
- comment changed to:
Ticket change [07005aa384] (rid 217053) by kevin_walzer on 2023-08-07 15:35:32:
- comment changed to:
% package require http 2.10b1 % package require tls 1.7.23 % http::register https 443 [list ::tls::socket -autoservername true -require true ] 443 {::tls::socket -autoservername true -require true} % set tok [http::geturl https://www.tcl.tk/] Segmentation fault: 11 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 0x0 ??? 1 Tcl 0x104d01be4 Tcl_UnregisterChannel + 348 The crash happens with the tcltls extension, but touches Tcl's core channel code, so I am opening this ticket under Tcl. - login: "kevin_walzer"
- mimetype: "text/plain"
- comment changed to:
Ticket change [6dd4fa3178] (rid 217148) by kevin_walzer on 2023-08-11 01:56:25:
- icomment:
So after running tclsh with symbols switched on, I have traced the crash to this call: if ((flags & (TCL_READABLE | TCL_WRITABLE)) == 0) { return TclClose(interp, chan); } in tclIO.c, line 3636. It's an invalid instruction fetch. Not sure what to do with this info or where to debug further. - login: "kevin_walzer"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [6e16edb16d] (rid 217149) by chrstphrchvz on 2023-08-11 07:01:56:
- icomment:
[https://core.tcl-lang.org/tips/doc/trunk/tip/562.md|TIP 562] means that the channel function <tt>closeProc()</tt> is deprecated, and <tt>close2Proc()</tt> is mandatory in Tcl 9. But TclTLS only implements a <tt>closeProc()</tt>, and not a <tt>close2Proc()</tt> (nor am I aware of any efforts to implement one). So <tt>TclClose()</tt> assumes <tt>close2Proc()</tt> is available, and crashes since the function pointer for it is <tt>NULL</tt> (which it was set to by <tt>memset()</tt> in <tt>Tls_ChannelType()</tt>).
- login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [6309030dea] (rid 217150) by kevin_walzer on 2023-08-11 11:16:37:
- icomment:
Thank you for this insight - I will review the code base of tcltls in more detail to see if we can implement this. TIP 562 has a basic implementation example.
- login: "kevin_walzer"
- mimetype: "text/plain"
- icomment:
Ticket change [a319e1e6f0] (rid 217156) by kevin_walzer on 2023-08-11 20:46:44:
- icomment:
This pointed me in the right direction. I was able to implement a close2Proc for Tcltls and the package now runs as expected in Tcl 9 without crashing. Thank you for your assistance.
- login: "kevin_walzer"
- mimetype: "text/plain"
- icomment:
Ticket change [922e53e466] (rid 217157) by kevin_walzer on 2023-08-11 20:47:16:
- assignee changed to: "kevin_walzer"
- closedate changed to: "2460168.36616667"
- closer changed to: "kevin_walzer"
- login: "kevin_walzer"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- resolution changed to: "Fixed"
- status changed to: "Closed"