kickoff icon indicating copy to clipboard operation
kickoff copied to clipboard

"Couldn't find font" - crash

Open daneov opened this issue 4 years ago • 14 comments

When running kickoff I receive the following stacktrace:

Daneo-XPS% RUST_BACKTRACE=full kickoff
thread 'tokio-runtime-worker' panicked at 'Couldn't find font', /home/daneo/.cargo/registry/src/github.com-1ecc6299db9ec823/kickoff-0.5.0/src/font.rs:22:45
stack backtrace:
   0:     0x560c05e79435 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h18674753585b8cc5
   1:     0x560c05cb53bc - core::fmt::write::h650970577346edc1
   2:     0x560c05e77ef4 - std::io::Write::write_fmt::hcdbe4458fe2ebdfb
   3:     0x560c05e785eb - std::panicking::default_hook::{{closure}}::h2b3ca2e1a25274db
   4:     0x560c05e7799a - std::panicking::rust_panic_with_hook::habc6079310c0728a
   5:     0x560c05e987e8 - std::panicking::begin_panic_handler::{{closure}}::ha449aee990d62948
   6:     0x560c05e98766 - std::sys_common::backtrace::__rust_end_short_backtrace::h54cc540f2a5a6bf2
   7:     0x560c05e98722 - rust_begin_unwind
   8:     0x560c05c73930 - core::panicking::panic_fmt::he85288327cd30385
   9:     0x560c05cb6120 - core::panicking::panic_display::h78973eb85f3c7fcb
  10:     0x560c05c73b8b - core::option::expect_failed::h8b4000216a5a1a81
  11:     0x560c05cfe8ec - kickoff::font::Font::new::h0d46d20d8c63056a
  12:     0x560c05d27c2c - tokio::runtime::task::harness::poll_future::heb5b6ecccf7dde17
  13:     0x560c05c92464 - tokio::runtime::task::raw::poll::hf3706922d73ca782
  14:     0x560c05ebabde - tokio::runtime::thread_pool::worker::Context::run_task::h904c87cce3ecce93
  15:     0x560c05ea7a80 - tokio::runtime::task::raw::poll::h941af331f075f74b
  16:     0x560c05eb4a45 - tokio::runtime::blocking::pool::Inner::run::h55390d55cd0c82dc
  17:     0x560c05eacb0e - std::sys_common::backtrace::__rust_begin_short_backtrace::h42b1c0ea489b853e
  18:     0x560c05ebc02d - core::ops::function::FnOnce::call_once{{vtable.shim}}::h11780ba8122bdbd3
  19:     0x560c05ea1af5 - std::sys::unix::thread::Thread::new::thread_start::h2582dd3e3de2d3c5
  20:     0x7f2d6bd83eae - start_thread
                               at /builddir/glibc-2.32/nptl/pthread_create.c:463:8
  21:     0x7f2d6bb6c2ff - __GI___clone
                               at /builddir/glibc-2.32/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  22:                0x0 - <unknown>
Error: JoinError::Panic(...)

My config file:

Daneo-XPS% cat .config/kickoff/config.toml
# Kickoff default config

# Characters shown in front of the query.
prompt = ''

# space between window border and the content in pixel
padding = 100

fonts = ['Liberation Mono']        # otf or ttf only
font_size = 32.0

[history]
decrease_interval = 48 # interval to decrease the number of launches

[colors]
# color format: rgb or rgba, if transparency is desired
background = '#282c34aa'
prompt = '#abb2bfff'
text = '#ffffffff'          # for search results
text_query = '#e5c07bff'    # for the search query
text_selected = '#61afefff' # for the currently selected result

[keybindings]
# keybindings syntax: ctrl/shift/alt/logo as modifiers and a key joined by '+' signs
# A list of available keys can be found here: https://docs.rs/crate/x11-keysymdef/0.2.0/source/src/keysym.json
paste = ["ctrl+v"]
execute = ["KP_Enter", "Return"]
delete = ["KP_Delete", "Delete", "BackSpace"]
delete_word = ["ctrl+KP_Delete", "ctrl+Delete", "ctrl+BackSpace"]
complete = ["Tab"]
nav_up = ["Up"]
nav_down = ["Down"]
exit = ["Escape"]

Confirmation that the font is installed:

Daneo-XPS% fc-list -v | grep -B10 ttf | grep fullname
	fullname: "Liberation Mono"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Serif Bold Italic"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Sans Italic"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Sans"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Mono Italic"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Mono Bold Italic"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Serif Italic"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Sans Bold"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Serif Bold"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Sans Bold Italic"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Serif"(s)
	fullnamelang: "en"(s)
	fullname: "Twitter Color Emoji SVGinOT"(s)
	fullnamelang: "en"(s)
	fullname: "Liberation Mono Bold"(s)
	fullnamelang: "en"(s)

Any ideas? Or things I can help to determine where this goes wrong?

Thanks!

daneov avatar Mar 30 '22 11:03 daneov

What Version are you using? I recently changed some things regarding font rendering.

j0ru avatar Apr 02 '22 11:04 j0ru

The latest available at the time this issue was created, installed via cargo install kickoff. Running kickoff with --version or version doesn't give any response, immediate crash.

daneov avatar Apr 03 '22 12:04 daneov

Okay, that's using the latest font loading code :/ Could you build a debug version from the latest main and post the output of RUST_BACKTRACE=full cargo run

j0ru avatar Apr 04 '22 12:04 j0ru

Sure. I just tried to execute cargo build, but it returns:

  = note: /bin/ld: cannot find -lxkbcommon
          collect2: error: ld returned 1 exit status
error: could not compile `kickoff` due to previous error
Even though I have it installed (click to expand)
> Daneo-XPS% sudo xbps-query libxkbcommon
architecture: x86_64
automatic-install: yes
filename-sha256: 1a2def214305c54e26e99f4c49722cdd50058469c2aa4b98b708b0191cf4bcf5
filename-size: 135KB
homepage: https://xkbcommon.org/
install-date: 2022-03-07 21:27 CET
installed_size: 292KB
license: MIT
maintainer: Isaac Freund <[email protected]>
metafile-sha256: 772522711148c51affb13eb6bf7c10cb0d43747d137f54fea4e87cbac48bb45a
pkgname: libxkbcommon
pkgver: libxkbcommon-1.3.1_1
repository: https://alpha.de.repo.voidlinux.org/current
run_depends:
	xkeyboard-config>=0
	glibc>=2.32_1
shlib-provides:
	libxkbcommon.so.0
shlib-requires:
	libc.so.6
short_desc: Library to handle keyboard descriptions
source-revisions: libxkbcommon:8da18c61c3
state: installed

Do you have any tips on how to proceed?

daneov avatar Apr 06 '22 19:04 daneov

Unfortunately I have no experience with void linux and at the moment not the time to learn it. It is weird that the compile fails with missing xkbcommon, that dependencies has been present from the beginning of this project and previous compiles have worked on your system. Maybe that's something to look at.

I'm open for PR's but I don't intend to build void support myself for now.

j0ru avatar Apr 07 '22 13:04 j0ru