Tk Source Code

View Ticket
Login
Ticket UUID: 254981c11d4ecbb72049f707163b3d9584eb0e87
Title: Wayland branch: wish panics at startup if ~/.cache does not exist
Type: Bug Version: wayland
Submitter: serhiy.storchaka Created on: 2026-10-14 16:17:48
Subsystem: (unused) Assigned To: aku
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-22 17:22:35
Resolution: Fixed Closed By: serhiy.storchaka
    Closed on: 2026-10-15 07:27:25
Description:

On the wayland branch ([438c60c73f]), wish fails to start for a user without a ~/.cache directory, e.g. a new account or a CI container:

fopen failed on /home/user/.cache/tksend/appnames

and it aborts with Tcl_Panic in loadAppNameRegistry(), called from Tk_SetAppName().

SendInit() in wayland/tkWaylandSend.c creates $HOME/.cache/tksend with a single mkdir(), which fails if $HOME/.cache is missing, and the error is ignored. It should create the parent directories too, and it would be better to follow $XDG_CACHE_HOME (default $HOME/.cache). A crash is also possible if HOME is not set: strlen(getenv("HOME")). A failure to open the registry should make send unavailable rather than abort the application.

User Comments: serhiy.storchaka added on 2026-10-14 17:57:17:

Thanks. Merged into wayland in [d9b4f68fdd].


kevin_walzer added on 2026-10-14 17:43:27:
Confirmed the issue and confirmed your branch fixes the issue. Feel free to merge to wayland.

kevin_walzer added on 2026-10-14 17:43:05:
Confirmed the issue and confirmed your branch fixes the issue. Feel free to merge to wayland.

serhiy.storchaka added on 2026-10-14 17:21:04:

Proposed fix in branch wayland-send-registry-path, [de3ebd918b], based on the current wayland. The registry is now tksend/appnames in $XDG_CACHE_HOME (by default $HOME/.cache, the home directory from the password file if HOME is not set), and the missing directories are created. A registry which cannot be read or written no longer panics: send and winfo interps just do not find the other applications. Tested under headless sway with a home without .cache, with XDG_CACHE_HOME, without HOME and with a read-only .cache.

Separately: send between two applications fails with "no such file or directory" on the wayland branch, with or without this change, and every test file reports "mq_unlink: No such file or directory" at exit.


kevin_walzer added on 2026-10-14 16:27:13:
Can you provide a patch?