Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic on linux #14

Closed
dvc94ch opened this issue Jan 8, 2022 · 2 comments
Closed

panic on linux #14

dvc94ch opened this issue Jan 8, 2022 · 2 comments

Comments

@dvc94ch
Copy link

dvc94ch commented Jan 8, 2022

playing around with piet-gpu and parley using your piet-gpu integration. however I haven't gotten it to work yet. my guess is that since fount mentions it only supports windows and macos that this is currently expected.

MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

thread 'main' panicked at 'range end index 1 out of range for slice of length 0', /home/dvc/cloudpeer/parley/src/layout/line/greedy.rs:510:26
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
   2: core::slice::index::slice_end_index_len_fail
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/slice/index.rs:41:5
   3: <core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/slice/index.rs:240:13
   4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/slice/index.rs:15:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/alloc/src/vec/mod.rs:2496:9
   6: parley::layout::line::greedy::commit_line
             at /home/dvc/cloudpeer/parley/src/layout/line/greedy.rs:510:26
   7: parley::layout::line::greedy::BreakLines<B>::break_next
             at /home/dvc/cloudpeer/parley/src/layout/line/greedy.rs:222:12
   8: parley::layout::line::greedy::BreakLines<B>::break_remaining
             at /home/dvc/cloudpeer/parley/src/layout/line/greedy.rs:257:15
   9: parley::layout::Layout<B>::break_all_lines
             at /home/dvc/cloudpeer/parley/src/layout/mod.rs:110:9
  10: <piet_parley::ParleyTextLayoutBuilder as piet::text::TextLayoutBuilder>::build
             at /home/dvc/cloudpeer/parley/piet-parley/src/lib.rs:148:9
  11: engine_rs::render
             at ./main.rs:201:18
  12: engine_rs::main::{{closure}}
             at ./main.rs:93:17
  13: winit::platform_impl::platform::sticky_exit_callback
             at /home/dvc/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:753:5
  14: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_return
             at /home/dvc/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/wayland/event_loop/mod.rs:394:21
  15: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run
             at /home/dvc/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/wayland/event_loop/mod.rs:209:9
  16: winit::platform_impl::platform::EventLoop<T>::run
             at /home/dvc/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:669:56
  17: winit::event_loop::EventLoop<T>::run
             at /home/dvc/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/event_loop.rs:154:9
  18: engine_rs::main
             at ./main.rs:50:5
  19: core::ops::function::FnOnce::call_once
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@dfrg
Copy link
Collaborator

dfrg commented Jan 9, 2022

Yes, your guess is absolutely correct. Though I would have expected it to panic well before line breaking, perhaps when it was unable to select a fallback font. There's some code in there that ensures a single line/run always exists to support proper line and caret metrics for an empty layout and that's probably causing an odd interaction with the missing font leading to a panic at that point.

@dvc94ch
Copy link
Author

dvc94ch commented Jan 9, 2022

the weird thing is that I am loading a font and only trying to render a latin string. shouldn't that work even if fount doesn't support a platform?

Never mind, apparently loaded fonts only work if the family is specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants