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

'wrench show reftests/text/diacritics.yaml' panics with Pathfinder enabled #2749

Closed
jimblandy opened this issue May 11, 2018 · 6 comments
Closed

Comments

@jimblandy
Copy link

@jimblandy jimblandy commented May 11, 2018

On Linux, after adding "pathfinder" to the list of features in wrench/Cargo.toml, the command

cargo run -- show reftests/text/diacritics.yaml 

panics, complaining "Didn't find a cached resource with that ID!", as shown below. Note that reftests/text/diacritics-ref.yaml, which is identical except for the absence of the U+302 COMBINING CIRCUMFLEX ACCENT character following the 'x', displays without a problem.

Full output:

$ pwd
/home/jimb/rust/webrender/wrench
$ git diff --cached Cargo.toml
diff --git a/wrench/Cargo.toml b/wrench/Cargo.toml
index cbed03a5..f09eda25 100644
--- a/wrench/Cargo.toml
+++ b/wrench/Cargo.toml
@@ -25,7 +25,7 @@ time = "0.1"
 crossbeam = "0.2"
 osmesa-sys = { version = "0.1.2", optional = true }
 osmesa-src = { git = "https://github.com/jrmuizel/osmesa-src", optional = true, branch = "serialize" }
-webrender = {path = "../webrender", features=["capture","replay","debugger","png","profiler"]}
+webrender = {path = "../webrender", features=["capture","replay","debugger","png","profiler","pathfinder"]}
 webrender_api = {path = "../webrender_api", features=["serialize","deserialize"]}
 serde = {version = "1.0", features = ["derive"] }
 
$ RUST_BACKTRACE=full cargo run -- show reftests/text/diacritics.yaml 
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `/home/jimb/rust/webrender/target/debug/wrench show reftests/text/diacritics.yaml`
OpenGL version 4.5 (Core Profile) Mesa 17.2.4, Mesa DRI Intel(R) HD Graphics P530 (Skylake GT2) 
hidpi factor: 1 (native 1)
Shader override path: None
thread 'WRRenderBackend#0' panicked at 'Didn't find a cached resource with that ID!', libcore/option.rs:917:5
stack backtrace:
   0:     0x55f0d9198413 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h09c1ee131a74b1c4
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55f0d9192744 - std::sys_common::backtrace::_print::h47a337b62b6d5e9e
                               at libstd/sys_common/backtrace.rs:71
   2:     0x55f0d919711d - std::panicking::default_hook::{{closure}}::h945a649c9017832e
                               at libstd/sys_common/backtrace.rs:59
                               at libstd/panicking.rs:380
   3:     0x55f0d9196e22 - std::panicking::default_hook::hcc534c2d30fbcda3
                               at libstd/panicking.rs:396
   4:     0x55f0d9197590 - std::panicking::rust_panic_with_hook::h09a7a3a353dc2f38
                               at libstd/panicking.rs:576
   5:     0x55f0d919744e - std::panicking::begin_panic::h8327f16bde15df70
                               at libstd/panicking.rs:537
   6:     0x55f0d9197349 - std::panicking::begin_panic_fmt::h42ff1d37404632d6
                               at libstd/panicking.rs:521
   7:     0x55f0d91972d2 - rust_begin_unwind
                               at libstd/panicking.rs:497
   8:     0x55f0d91de380 - core::panicking::panic_fmt::h0bd854df201d1baf
                               at libcore/panicking.rs:71
   9:     0x55f0d91de3f8 - core::option::expect_failed::hfa0c8a51e07f7adc
                               at libcore/option.rs:917
  10:     0x55f0d7eeae22 - <core::option::Option<T>>::expect::h4659738bac1053d8
                               at /checkout/src/libcore/option.rs:302
  11:     0x55f0d80e6085 - <webrender::resource_cache::ResourceClassCache<K, V, U>>::get::h762567f18ca3ff17
                               at webrender/src/resource_cache.rs:186
  12:     0x55f0d8197039 - webrender::glyph_rasterizer::pathfinder::<impl webrender::glyph_rasterizer::GlyphRasterizer>::get_cache_item_for_glyph::hda9f188b3a911481
                               at webrender/src/glyph_rasterizer/pathfinder.rs:101
  13:     0x55f0d80e71b8 - webrender::resource_cache::ResourceCache::fetch_glyphs::h5394e77b6bb56a78
                               at webrender/src/resource_cache.rs:739
  14:     0x55f0d83a88a6 - webrender::batch::AlphaBatchBuilder::add_prim_to_batch::hb1433b38aa9fd9fc
                               at webrender/src/batch.rs:1123
  15:     0x55f0d83a4ee9 - webrender::batch::AlphaBatchBuilder::add_run_to_batch::h4894682fa6d92f01
                               at webrender/src/batch.rs:553
  16:     0x55f0d83a41f8 - webrender::batch::AlphaBatchBuilder::add_pic_to_batch::h5c852d391480f0a5
                               at webrender/src/batch.rs:471
  17:     0x55f0d83a77b3 - webrender::batch::AlphaBatchBuilder::add_prim_to_batch::hb1433b38aa9fd9fc
                               at webrender/src/batch.rs:984
  18:     0x55f0d83a4ee9 - webrender::batch::AlphaBatchBuilder::add_run_to_batch::h4894682fa6d92f01
                               at webrender/src/batch.rs:553
  19:     0x55f0d83a41f8 - webrender::batch::AlphaBatchBuilder::add_pic_to_batch::h5c852d391480f0a5
                               at webrender/src/batch.rs:471
  20:     0x55f0d80f958e - <webrender::tiling::ColorRenderTarget as webrender::tiling::RenderTarget>::build::hc89c0ac326f7bd47
                               at webrender/src/tiling.rs:355
  21:     0x55f0d80fb54b - webrender::tiling::RenderPass::build::hbe1ce2dc5701636a
                               at webrender/src/tiling.rs:795
  22:     0x55f0d8793271 - webrender::frame_builder::FrameBuilder::build::h3e8d9bf4ea978346
                               at webrender/src/frame_builder.rs:383
  23:     0x55f0d82a8e99 - webrender::render_backend::Document::render::h345b7b6951974bf6
                               at webrender/src/render_backend.rs:280
  24:     0x55f0d82afaa7 - webrender::render_backend::RenderBackend::update_document::hf9c585e3de6fbc66
                               at webrender/src/render_backend.rs:1056
  25:     0x55f0d82ad138 - webrender::render_backend::RenderBackend::process_api_msg::hcf15c6e02273323d
                               at webrender/src/render_backend.rs:948
  26:     0x55f0d82ac327 - webrender::render_backend::RenderBackend::run::h68f42093f44e2748
                               at webrender/src/render_backend.rs:771
  27:     0x55f0d80be501 - webrender::renderer::Renderer::new::{{closure}}::h7b9458efd7516641
                               at webrender/src/renderer.rs:1699
  28:     0x55f0d8779154 - std::sys_common::backtrace::__rust_begin_short_backtrace::h70e4b86cf712f1c1
                               at /checkout/src/libstd/sys_common/backtrace.rs:136
  29:     0x55f0d81d48db - std::thread::Builder::spawn::{{closure}}::{{closure}}::hd165fa150b1f40f2
                               at /checkout/src/libstd/thread/mod.rs:406
  30:     0x55f0d8743ed4 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hc21de56712043478
                               at /checkout/src/libstd/panic.rs:293
  31:     0x55f0d83a1544 - std::panicking::try::do_call::h0240e92a7a0a5f4d
                               at /checkout/src/libstd/panicking.rs:479
  32:     0x55f0d91a2c8e - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  33:     0x55f0d83a141c - std::panicking::try::hc867c13f2fa7f6a4
                               at /checkout/src/libstd/panicking.rs:458
  34:     0x55f0d8743fdc - std::panic::catch_unwind::h68cc17a7a942281f
                               at /checkout/src/libstd/panic.rs:358
  35:     0x55f0d81d4068 - std::thread::Builder::spawn::{{closure}}::h10703a77c38410fa
                               at /checkout/src/libstd/thread/mod.rs:405
  36:     0x55f0d81d4ae5 - <F as alloc::boxed::FnBox<A>>::call_box::h5fd94e46fd21f02d
                               at /checkout/src/liballoc/boxed.rs:788
  37:     0x55f0d919ab8b - std::sys::unix::thread::Thread::new::thread_start::h711c51a13a158afa
                               at /checkout/src/liballoc/boxed.rs:798
                               at libstd/sys_common/thread.rs:24
                               at libstd/sys/unix/thread.rs:90
  38:     0x7fa755ac336c - start_thread
  39:     0x7fa7555e0b4e - __clone
  40:                0x0 - <unknown>
thread 'main' panicked at 'assertion failed: thread::panicking() || self.id == 0', webrender/src/device.rs:502:9
stack backtrace:
   0:     0x55f0d9198413 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h09c1ee131a74b1c4
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55f0d9192744 - std::sys_common::backtrace::_print::h47a337b62b6d5e9e
                               at libstd/sys_common/backtrace.rs:71
   2:     0x55f0d919711d - std::panicking::default_hook::{{closure}}::h945a649c9017832e
                               at libstd/sys_common/backtrace.rs:59
                               at libstd/panicking.rs:380
   3:     0x55f0d9196e22 - std::panicking::default_hook::hcc534c2d30fbcda3
                               at libstd/panicking.rs:396
   4:     0x55f0d9197590 - std::panicking::rust_panic_with_hook::h09a7a3a353dc2f38
                               at libstd/panicking.rs:576
   5:     0x55f0d83a0f17 - std::panicking::begin_panic::h43abe581d2e8e575
                               at /checkout/src/libstd/panicking.rs:537
   6:     0x55f0d7cc8beb - <webrender::device::Texture as core::ops::drop::Drop>::drop::h0249a4c04aea33b1
                               at webrender/src/device.rs:502
   7:     0x55f0d8298144 - core::ptr::drop_in_place::hc82f4f4ecdc93b8c
                               at /checkout/src/libcore/ptr.rs:59
   8:     0x55f0d82990c4 - core::ptr::drop_in_place::hd0ef06d9b3829b39
                               at /checkout/src/libcore/ptr.rs:59
   9:     0x55f0d8050758 - webrender::renderer::Renderer::deinit::h197cf1cac8469aa4
                               at webrender/src/renderer.rs:3874
  10:     0x55f0d7c1048d - wrench::main::h73033f1860630573
                               at wrench/src/main.rs:678
  11:     0x55f0d79a5d61 - std::rt::lang_start::{{closure}}::he13dfb22568c5a16
                               at /checkout/src/libstd/rt.rs:74
  12:     0x55f0d9197237 - std::panicking::try::do_call::hd12baa704e255980
                               at libstd/rt.rs:59
                               at libstd/panicking.rs:479
  13:     0x55f0d91a2c8e - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  14:     0x55f0d9197a53 - std::rt::lang_start_internal::h764d480f090a00ea
                               at libstd/panicking.rs:458
                               at libstd/panic.rs:358
                               at libstd/rt.rs:58
  15:     0x55f0d79a5d41 - std::rt::lang_start::h28f177b01db59e98
                               at /checkout/src/libstd/rt.rs:74
  16:     0x55f0d7c10e4d - main
  17:     0x7fa7554f0889 - __libc_start_main
  18:     0x55f0d77210c9 - _start
  19:                0x0 - <unknown>
$ 
@gw3583
Copy link
Collaborator

@gw3583 gw3583 commented May 11, 2018

@nc4rrillo
Copy link
Contributor

@nc4rrillo nc4rrillo commented May 26, 2018

I'm seeing thread 'main' panicked at 'assertion failed: thread::panicking() || self.id == 0', webrender/src/device.rs:503:9 on Windows with Pathfinder enabled when running any text reftest

@pekim
Copy link

@pekim pekim commented May 28, 2018

I'm seeing something remarkably similar in a project of mine when I enable the pathfinder feature.

thread '<unnamed>' panicked at 'assertion failed: thread::panicking() || self.id == 0', /home/mike/.cargo/git/checkouts/webrender-c3596abe1cf4f320/52ba116/webrender/src/device.rs:503:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:463
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:397
   6: <webrender::device::Texture as core::ops::drop::Drop>::drop
             at /home/mike/.cargo/git/checkouts/webrender-c3596abe1cf4f320/52ba116/webrender/src/device.rs:503
   7: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
   8: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
   9: webrender::renderer::Renderer::deinit
             at /home/mike/.cargo/git/checkouts/webrender-c3596abe1cf4f320/52ba116/webrender/src/renderer.rs:3957
  10: tonbridge_webrender::render::web_render_context::WebRenderContext::deinit
             at src/render/web_render_context.rs:72
  11: <tonbridge_webrender::window::Window as core::ops::drop::Drop>::drop
             at src/window.rs:23
  12: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  13: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  14: tb_destroy_window
             at src/window.rs:193
  15: <unknown>
             at /usr/local/go/src/runtime/asm_amd64.s:688
@gw3583
Copy link
Collaborator

@gw3583 gw3583 commented May 28, 2018

This looks like WR device is asserting on shutdown that a GL texture resource has not been cleaned up. cc @pcwalton

@pcwalton
Copy link
Collaborator

@pcwalton pcwalton commented May 29, 2018

I think the first bug is FreeType-specific, as it works on Mac.

@pcwalton
Copy link
Collaborator

@pcwalton pcwalton commented May 30, 2018

@pekim Please file a separate issue. That is a separate bug.

pcwalton added a commit to pcwalton/webrender that referenced this issue May 30, 2018
fetched from the font.

Closes servo#2749. We should fix the problem in Pathfinder in the first
place, but we need to be resilient here anyhow.
bors-servo added a commit that referenced this issue May 30, 2018
Write `Blank` into the glyph key cache if glyph dimensions can't be fetched from the font.

Closes #2749. We should fix the problem in Pathfinder in the first
place, but we need to be resilient here anyhow.

r? @glennw

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2790)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.