Artifacts Associated With Ticket f0b80a3d
Ticket change [ef22115051] (rid 245337) by sl1200mk2 on 2025-09-11 08:50:54:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
Hi, I would like to use Tcl in develop mode in order to print symbol and line numbers when a crash occur (Tk is crashing on macOS26 and I would like to report it). so on macOS I'm compiling Tcl like this: make -j 4 -C macosx develop CFLAGS="-fno-omit-frame-pointer -Og -g" $SUDO make -C macosx install-develop when I start my app it does not even start and crash like that: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18bac2388 __pthread_kill + 8 1 libsystem_pthread.dylib 0x18bafb88c pthread_kill + 296 2 libsystem_c.dylib 0x18ba04a3c abort + 124 3 libsystem_c.dylib 0x18ba03c70 __assert_rtn + 284 4 Tcl 0x10116cda4 <deduplicated_symbol> + 40 5 Tcl 0x101139fdc TclZipfs_TclLibrary + 4 (tclZipfs.c:4380) [inlined] 6 Tcl 0x101139fdc ZipFSTclLibraryObjCmd + 140 (tclZipfs.c:4413) 7 Tcl 0x10102fcf4 Dispatch + 104 (tclBasic.c:4640) 8 Tcl 0x10102dc28 TclNRRunCallbacks + 80 (tclBasic.c:4656) [inlined] 9 Tcl 0x10102dc28 Tcl_EvalObjv + 116 (tclBasic.c:4394) [inlined] 10 Tcl 0x10102dc28 TclEvalEx + 2216 (tclBasic.c:5495) 11 Tcl 0x1010cdbdc Tcl_Init + 128 (tclInterp.c:400) 12 DLight 0x1009b6eb8 Tk_AppInit + 48 13 DLight 0x1009b83a0 main + 288 best regards, nicolas
- foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "sl1200mk2"
- priority initialized to: "5 Medium"
- private_contact initialized to: "10e302b1a1ae78d60a0878d87bdb4b5f874b815e"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "sl1200mk2"
- subsystem initialized to: "53. Configuration and Build Tools"
- title initialized to: "macOS : crash when building Tcl in develop mode"
- type initialized to: "Bug"
Ticket change [d36be3fc08] (rid 245384) by chrstphrchvz on 2025-09-13 01:38:27:
- icomment:
I think there is enough information here to know where the crash is. It is due to this assertion failing in <tt>TclZipfs_TclLibrary()</tt> (tclZipfs.c near line 4380): <pre> assert(zipfs_tcl_library_init); </pre> This code was worked on very recently in [0081f10f13]. - login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [effe6695b8] (rid 245385) by apnadkarni on 2025-09-13 02:31:57:
- icomment:
Nicolas, as I already told you in the other ticket you filed, I don't think it is a good idea to override CFLAGS on the command line as you are doing. Having said that, the assertion failure is probably not related to that. More likely, I have not accounted properly for zipfs being broken on macOS. Not sure why the failure would not show up on github actions though. Will take a look.
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [6d2405e9b3] (rid 245386) by apnadkarni on 2025-09-13 02:37:28:
- icomment:
Nicolas, can you post the exact fossil commit you are building? A similar report was fixed earlier and want to make sure you are not running a later commit after the fix.
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [93953787a6] (rid 245387) by apnadkarni on 2025-09-13 06:00:04:
- icomment:
The assertion that is failing is checking that the zipfs init is done (irrespective of whether a zipfs archive is found or not found). On reviewing the code, I cannot see a path where that might happen. Furthermore, I don't quite understand the initial part of the stack trace in your post. ``` main->Tk_AppInit->Tcl_Init->TclEvalEx. ``` On Unix (I do not have a mac), I expect it to look like ``` main->Tk_MainEx->Tcl_AppInit->Tk_Init->Initialize->TclEvalEx ``` Even more puzzling, I do not find the symbol Tk_AppInit anywhere in the Tk sources. Are you running some custom application? What is the DLight module showing up in the trace?
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [7bd128aa71] (rid 245388) by sl1200mk2 on 2025-09-13 13:47:00:
- icomment:
Hi Ashok, Christopher, thank you for taking care of this. DLight is the name of my app which is a GUI app that use both Tcl and Tk. one of the user of the app have reported that he could make the app to crash on macOS26 (TK is crashing) so I would like to report to Tk devs where it crash exactly. When I want to post ticket to Tk about a crash I use to compile Tcl and Tk in 'develop' fashion (in order to have line where the crash occurs). I've followed your advice about not to override CFLAGS, so I've compiled bot Tcl and Tk with: make -j 4 -C macosx develop CFLAGS_OPTIMIZE="-fno-omit-frame-pointer -Og -g" $SUDO make -C macosx install-develop and result is the same, when I start my app I got this crash: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18bac2388 __pthread_kill + 8 1 libsystem_pthread.dylib 0x18bafb88c pthread_kill + 296 2 libsystem_c.dylib 0x18ba04a3c abort + 124 3 libsystem_c.dylib 0x18ba03c70 __assert_rtn + 284 4 Tcl 0x10529b700 <deduplicated_symbol> + 40 5 Tcl 0x105262da0 TclZipfs_TclLibrary + 4 (tclZipfs.c:4380) [inlined] 6 Tcl 0x105262da0 ZipFSTclLibraryObjCmd + 144 (tclZipfs.c:4413) 7 Tcl 0x105147d38 Dispatch + 104 (tclBasic.c:4642) 8 Tcl 0x105144270 TclNRRunCallbacks + 68 (tclBasic.c:4658) [inlined] 9 Tcl 0x105144270 Tcl_EvalObjv + 316 (tclBasic.c:4396) 10 Tcl 0x1051456b8 TclEvalEx + 2896 (tclBasic.c:5497) 11 Tcl 0x1051efc2c Tcl_Init + 128 (tclInterp.c:400) 12 DLight 0x1049e532c Tk_AppInit + 48 13 DLight 0x1049e6814 main + 288 on macOS I believe it's tcl/macosx/GNUmakefile which is responsible of the 'develop' style make ++ nicolas
- login: "sl1200mk2"
- mimetype: "text/plain"
- icomment:
Ticket change [48dae08acd] (rid 245392) by apnadkarni on 2025-09-15 06:54:09:
- icomment:
I am guessing your application main program does not call `TclZipfs_AppInit` at initialization time causing the assertion to fail. I had added that assertion to ensure that function was always called to check for embedded zip archives before any attempts to load Tcl libraries from zip archives. Reviewing the manpages and TIP's it appears although tclsh and wish always do this, there is no requirement documented that other applications that use their own main programs call that function. So I'll remove the assertion. Of course, it means embedded ZIPs will not work if `TclZipfs_AppInit` is not called and the application must use the "traditional" file system located libraries (which is anyways the case on macOS). Thanks for the report but I do wish you had stated up front this was a custom application and not a stock tclsh or wish build. It would have saved me considerable time reviewing code paths searching for the case where the zipfs-based Tcl library was not initialized.
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [e39b6e31f3] (rid 245397) by apnadkarni on 2025-09-15 07:44:41:
- icomment:
I have committed a fix for you to try in branch bug-f0b80a3db9
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [e433e44d50] (rid 245398) by sl1200mk2 on 2025-09-15 07:56:06:
- icomment:
Hi Ashok, thank you for your answer and sorry for the waste of time. in my code at the very start, before Tk_Main(argc, argv, Tk_AppInit); I do call TclZipfs_AppHook(&argc, &argv); but I only do that for Windows as on macOS, there's no zip added at the end of Tcl. I didn't realize that now it could be mandatory on macOS too !! because with TclZipfs_AppHook(&argc, &argv); call also fo macOS, there's no crash anymore. so once again I should have do this before writing this ticket... but it's hard to find that this call was now mandatory. best regards, nicolas
- login: "sl1200mk2"
- mimetype: "text/plain"
- icomment:
Ticket change [925a862e8a] (rid 245495) by apnadkarni on 2025-09-16 11:49:15:
- closedate changed to: "2460934.99254147"
- closer changed to: "apnadkarni"
- icomment:
Closing as I have removed the assertion for the reasons stated in the [commit message](https://core.tcl-lang.org/tcl/info/248af5b902363ab4). You debug build on macOS should now work (modulo other issues) irrespective of whether you call `TclZipfs_AppInit` or not.
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [69c431817f] (rid 245517) by apnadkarni on 2025-09-16 16:51:49:
- closedate changed to: "2460935.20265623"
- icomment:
@sl1200mk2, not your fault for not calling TclZipfs_AppHook. Nothing in the docs say it is mandatory so I assume it isn't. That is why I removed the assertion that checks that it's been called.
- login: "apnadkarni"
- mimetype: "text/plain"