Anyone experiencing crashes with ghostty?

Lately, ghostty has become unusable on my machine (archlinux x86_64), and I’m not sure how to investigate.

The terminal crashes when opening some TUI apps such as impala or jj commit --interactive. All I get is this report when starting ghostty from another terminal

info: ghostty version=1.3.1-arch2
info: ghostty build optimize=ReleaseFast
info: runtime=.gtk
info: font_backend=.fontconfig_freetype
info: dependency harfbuzz=14.2.1
info: dependency fontconfig=21801
info: renderer=renderer.generic.Renderer(renderer.OpenGL)
info: libxev default backend=io_uring
info(os_locale): setlocale from env result=C
info(gtk): GTK version build=4.22.2 runtime=4.22.4
info(gtk): libadwaita version build=1.9.0 runtime=1.9.1
info: reading configuration file path=/home/tom/.config/ghostty/config
info(config): default shell src=passwd value=/usr/bin/fish
info(config): default working directory src=passwd value=/home/tom
warning(gtk_ghostty_application): setting GDK_DEBUG=
warning(gtk_ghostty_application): setting GDK_DISABLE=gles-api,vulkan
warning(glib): WARNING: Adwaita: The resource style-dark.css is deprecated and shouldn't be used anymore. Use style.css with media queries instead.
warning(glib): WARNING: Adwaita: The resource style-hc.css is deprecated and shouldn't be used anymore. Use style.css with media queries instead.
warning(glib): WARNING: Adwaita: The resource style-hc-dark.css is deprecated and shouldn't be used anymore. Use style.css with media queries instead.
info(opengl): loaded OpenGL 4.6
info(io_exec): found Ghostty resources dir: /usr/share/ghostty
info(io_exec): shell integration automatically injected shell=.fish
warning(gtk_ghostty_application): unimplemented action=.cell_size
info(io_exec): started subcommand path=/bin/sh pid=218804
free(): invalid pointer
fish: Job 1, 'ghostty' terminated by signal SIGABRT (Abandon)

Has anyone else experienced this? ghostty +crash-report gives no crash report.

EDIT: also, I tried to revert to an older version of ghostty, but I get the same crash, so I’m not sure if the culprit is ghostty, or a dependency, or the arch package…

I am using Ghostty 1.3.1-arch2 on Omarchy, pretty up-to-date from the repo, and have seen no issues like this at all.

The invalid pointer comes at the time that the surface is created.
Try to display all the ghostty related logs together:

journalctl --user -g 'ghostty'

I didn’t know I could catch such logs with journalctl, thanks for the tip!

juin 15 12:30:45 toolbox systemd[919]: Started app-ghostty-surface-transient-227321.scope.
juin 15 12:30:51 toolbox systemd-coredump[227362]: [🡕] Process 227293 (ghostty) of user 1000 dumped core.

                                                   Stack trace of thread 227319:
                                                   #0  0x00007f6cf529a29c n/a (libc.so.6 + 0x9a29c)
                                                   #1  0x00007f6cf523e7d0 raise (libc.so.6 + 0x3e7d0)
                                                   #2  0x00007f6cf5225681 abort (libc.so.6 + 0x25681)
                                                   #3  0x00007f6cf5226700 n/a (libc.so.6 + 0x26700)
                                                   #4  0x00007f6cf52a47cc n/a (libc.so.6 + 0xa47cc)
                                                   #5  0x00007f6cf52a47e4 n/a (libc.so.6 + 0xa47e4)
                                                   #6  0x00007f6cf6a13042 FcLangSetHasLang (libfontconfig.so.1 + 0x28042)
                                                   #7  0x000055775b71af44 n/a (ghostty + 0x138ff44)
                                                   ELF object binary architecture: AMD x86-64

EDIT: if I’m reading this correctly, my fontconfig configuration triggers a situation where FcLangSetHasLang returns something that is not properly handled by ghostty?

@dimdin thanks for steering me in the right direction, it helped me write a bug report on ghostty’s github.

1 Like

For the record I found the culprit. Thanks to strace, I discovered that fontconfig was failing at opening a file in $HOME/.cache/fontconfig, and this triggered a null pointer that wasn’t checked in ghostty’s codebase. Cleaning the cache solved the problem.

1 Like