servo / servo/font-kit

Assertion failure in reset_freetype_face_char_size

Open
#133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
840
Forks
137
Avg merge
4h 56m
Merged PRs (30d)
1

Description


thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `23`,
 right: `0`', /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:1148:9
stack backtrace:
   0:     0x55f70db7e108 - backtrace::backtrace::libunwind::trace::hccf7fcb8c3efd6c9
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:     0x55f70db7e108 - backtrace::backtrace::trace_unsynchronized::hdc571c1189c74524
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:     0x55f70db7e108 - std::sys_common::backtrace::_print_fmt::ha340006a6f654784
                               at src/libstd/sys_common/backtrace.rs:77
   3:     0x55f70db7e108 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1edb2343f5ef9fa1
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x55f70dba4f3c - core::fmt::write::h5daa3012650ec288
                               at src/libcore/fmt/mod.rs:1052
   5:     0x55f70db7aa97 - std::io::Write::write_fmt::h1393c2aa40b28ea2
                               at src/libstd/io/mod.rs:1428
   6:     0x55f70db80855 - std::sys_common::backtrace::_print::h0e150e7c3dc63729
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x55f70db80855 - std::sys_common::backtrace::print::h9d3d00a79f010614
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x55f70db80855 - std::panicking::default_hook::{{closure}}::hd61a1ad6b6137da7
                               at src/libstd/panicking.rs:204
   9:     0x55f70db80596 - std::panicking::default_hook::h21ddd7c2447fb722
                               at src/libstd/panicking.rs:224
  10:     0x55f70db80eb2 - std::panicking::rust_panic_with_hook::he2460faa61118cbf
                               at src/libstd/panicking.rs:470
  11:     0x55f70db80a9b - rust_begin_unwind
                               at src/libstd/panicking.rs:378
  12:     0x55f70db80a0b - std::panicking::begin_panic_fmt::he0dc876ab7e2bfae
                               at src/libstd/panicking.rs:332
  13:     0x55f70d52a813 - font_kit::loaders::freetype::reset_freetype_face_char_size::h0391068e315091b8
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:1148
  14:     0x55f70d52a813 - font_kit::loaders::freetype::setup_freetype_face::h7ee5c2353b987cd5
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:1141
  15:     0x55f70d52a813 - font_kit::loaders::freetype::Font::from_bytes::{{closure}}::he1f6033884b0f4f8
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:146
  16:     0x55f70d52a813 - std::thread::local::LocalKey<T>::try_with::h2ee65874e39f60da
                               at /rustc/442ae7f04026c215a03b155eaaf9cde8bb5cf02a/src/libstd/thread/local.rs:262
  17:     0x55f70d52a813 - std::thread::local::LocalKey<T>::with::hde6561fef2ba6181
                               at /rustc/442ae7f04026c215a03b155eaaf9cde8bb5cf02a/src/libstd/thread/local.rs:239
  18:     0x55f70d528830 - font_kit::loaders::freetype::Font::from_bytes::h2983f62baec3d999
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:133
  19:     0x55f70d528830 - font_kit::loaders::freetype::Font::from_file::h8960a8fd369797e9
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:163
  20:     0x55f70d4af4d1 - <font_kit::loaders::freetype::Font as font_kit::loader::Loader>::from_file::ha3ee8c5920c512ba
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:997
  21:     0x55f70d4af4d1 - font_kit::loader::Loader::from_path::hd9c3d70da2e89a25
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loader.rs:90
  22:     0x55f70d4af4d1 - font_kit::loader::Loader::from_handle::h4b5ce9e5391bfb1e
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loader.rs:107
  23:     0x55f70d4d00c9 - font_kit::loaders::freetype::Font::from_handle::had441b0afe9cbe24
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/loaders/freetype.rs:206
  24:     0x55f70d4d00c9 - font_kit::source::Source::select_descriptions_in_family::hc9e7d10095fe80ff
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/source.rs:146
  25:     0x55f70d522384 - font_kit::source::Source::select_best_match::h7e292a7dcba443d2
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/source.rs:130
  26:     0x55f70d522384 - font_kit::sources::fontconfig::FontconfigSource::select_best_match::h897dbc4d8c1f8436
                               at /home/shui/.cargo/registry/src/github.com-1ecc6299db9ec823/font-kit-0.5.0/src/sources/fontconfig.rs:206

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting loaders/freetype.rs around reset_freetype_face_char_size at line 1148 and its call from setup_freetype_face. Reproduce the reported panic through Font::from_file or FontconfigSource::select_best_match, then determine what behavior should replace the assertion; done means the reported font-loading path no longer panics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.