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

Intermittent panic in RenderBackend::update_document (unwrapping a None value) #20271

Closed
jdm opened this issue Mar 11, 2018 · 9 comments
Closed

Intermittent panic in RenderBackend::update_document (unwrapping a None value) #20271

jdm opened this issue Mar 11, 2018 · 9 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Mar 11, 2018

Seen in #19203:

 ▶ CRASH [expected OK] /_mozilla/mozilla/servo-max-session-history.html
  │ 
  │ VMware, Inc.
  │ softpipe
  │ 3.3 (Core Profile) Mesa 17.3.0-devel
  │ called `Option::unwrap()` on a `None` value (thread WRRenderBackend#0, at libcore/option.rs:335)
  │ stack backtrace:
  │    0:     0x7f1f9164d53c - backtrace::backtrace::trace::hb73e73c3fa21d7b2
  │    1:     0x7f1f9164c6e2 - backtrace::capture::Backtrace::new::h8a585c120187c23d
  │    2:     0x7f1f8ecbc49b - servo::main::{{closure}}::h94a3eb87af054244
  │    3:     0x7f1f9165b2c5 - std::panicking::rust_panic_with_hook::haa00f5a9417cd684
  │                         at libstd/panicking.rs:577
  │    4:     0x7f1f9165b14e - std::panicking::begin_panic::ha956683198499384
  │                         at libstd/panicking.rs:537
  │    5:     0x7f1f9165b04a - std::panicking::begin_panic_fmt::h587e116719f14631
  │                         at libstd/panicking.rs:521
  │    6:     0x7f1f9165afe2 - rust_begin_unwind
  │                         at libstd/panicking.rs:497
  │    7:     0x7f1f9168fee0 - core::panicking::panic_fmt::h1d64949939b0af2f
  │                         at libcore/panicking.rs:71
  │    8:     0x7f1f9168fe06 - core::panicking::panic::hff3a520bb0e774b7
  │                         at libcore/panicking.rs:51
  │    9:     0x7f1f90b24157 - webrender::render_backend::RenderBackend::update_document::hb1bc502479eca76b
  │   10:     0x7f1f90b1ec2b - webrender::render_backend::RenderBackend::run::h8118c6351861f5e9
  │   11:     0x7f1f90ac1c21 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha5a4074d697be452
  │   12:     0x7f1f90a60be5 - _ZN3std9panicking3try7do_call17h5737d22537d6031dE.llvm.103B4C05
  │   13:     0x7f1f916845ce - __rust_maybe_catch_panic
  │                         at libpanic_unwind/lib.rs:102
  │   14:     0x7f1f90ac9dca - <F as alloc::boxed::FnBox<A>>::call_box::h3ad3034e11a37fa6
  │   15:     0x7f1f9166f2fb - <alloc::boxed::Box<alloc::boxed::FnBox<A, Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h13f1b0bf377a9f5b
  │                         at /checkout/src/liballoc/boxed.rs:798
  │                          - std::sys_common::thread::start_thread::hb5b6e0447b9691dc
  │                         at libstd/sys_common/thread.rs:24
  │                          - std::sys::unix::thread::Thread::new::thread_start::hcaff0bef1a01c624
  │                         at libstd/sys/unix/thread.rs:90
  │   16:     0x7f1f8dbdb183 - start_thread
  │   17:     0x7f1f8c4a303c - clone
  │   18:                0x0 - <unknown>
  │ ERROR:servo: called `Option::unwrap()` on a `None` value
@jdm
Copy link
Member Author

@jdm jdm commented Mar 16, 2018

I hit this panic when clicking on a search link from a duckduckgo result.

@jdm jdm added the A-webcompat label Mar 16, 2018
@jdm
Copy link
Member Author

@jdm jdm commented Mar 16, 2018

stack backtrace:
   0:        0x108821824 - backtrace::backtrace::trace::he85e571d613b7799
                        at /Users/jdm/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.2/src/backtrace/mod.rs:42
   1:        0x10881856c - backtrace::capture::Backtrace::new::hecff08116427632b
                        at /Users/jdm/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.2/src/capture.rs:64
   2:        0x10238598e - servo::main::_$u7b$$u7b$closure$u7d$$u7d$::h22bc2fe69f5e9980
                        at ports/servo/main.rs:147
   3:        0x10882d1d0 - std::panicking::rust_panic_with_hook::h47a0773bed022912
                        at libstd/panicking.rs:577
   4:        0x10882cfee - std::panicking::begin_panic::h357aa9770ebb9277
                        at libstd/panicking.rs:537
   5:        0x10882cf43 - std::panicking::begin_panic_fmt::h8146069d366cb090
                        at libstd/panicking.rs:521
   6:        0x10882ceb2 - rust_begin_unwind
                        at libstd/panicking.rs:497
   7:        0x1088635d3 - core::panicking::panic_fmt::hde64b9c715e999e9
                        at libcore/panicking.rs:71
   8:        0x1088634c6 - core::panicking::panic::h20ea4cd707703c38
                        at libcore/panicking.rs:51
   9:        0x106dfb289 - _$LT$core..option..Option$LT$T$GT$$GT$::unwrap::h868f838137e8f7e5
                        at /Users/travis/build/rust-lang/rust/src/libcore/macros.rs:20
  10:        0x106cd1b0e - webrender::render_backend::Document::render::ha86f8f2707c6864e
                        at /Users/jdm/.cargo/git/checkouts/webrender-c3596abe1cf4f320/6611df9/webrender/src/render_backend.rs:272
  11:        0x106cd71ed - webrender::render_backend::RenderBackend::update_document::h141442f39e1b890d
                        at /Users/jdm/.cargo/git/checkouts/webrender-c3596abe1cf4f320/6611df9/webrender/src/render_backend.rs:982
  12:        0x106cd5016 - webrender::render_backend::RenderBackend::process_api_msg::h2d702956ef62217d
                        at /Users/jdm/.cargo/git/checkouts/webrender-c3596abe1cf4f320/6611df9/webrender/src/render_backend.rs:885
  13:        0x106cd4a3c - webrender::render_backend::RenderBackend::run::h704402f7aad86129
                        at /Users/jdm/.cargo/git/checkouts/webrender-c3596abe1cf4f320/6611df9/webrender/src/render_backend.rs:732
  14:        0x106dd7584 - webrender::renderer::Renderer::new::_$u7b$$u7b$closure$u7d$$u7d$::hdda03bd313d46a96
                        at /Users/jdm/.cargo/git/checkouts/webrender-c3596abe1cf4f320/6611df9/webrender/src/renderer.rs:2253
  15:        0x106e7c904 - std::sys_common::backtrace::__rust_begin_short_backtrace::hbd35861b9a1d63f0
                        at /Users/travis/build/rust-lang/rust/src/libstd/sys_common/backtrace.rs:133
  16:        0x106f6fd2b - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::heb907b1cc7c8a9c9
                        at /Users/travis/build/rust-lang/rust/src/libstd/thread/mod.rs:406
  17:        0x106f5eb74 - _$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h53b3c78286ab8b25
                        at /Users/travis/build/rust-lang/rust/src/libstd/panic.rs:293
  18:        0x106f71234 - std::panicking::try::do_call::hf104e48489a3f2a9
                        at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:479
  19:        0x108857bfe - __rust_maybe_catch_panic
                        at libpanic_unwind/lib.rs:102
  20:        0x106f706fc - std::panicking::try::h4dde4871e46f941c
                        at /Users/travis/build/rust-lang/rust/src/libstd/panicking.rs:458
  21:        0x106f6e85c - std::panic::catch_unwind::h7abedf65172cfcbb
                        at /Users/travis/build/rust-lang/rust/src/libstd/panic.rs:358
  22:        0x106f6f868 - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::hba0f90527bcae686
                        at /Users/travis/build/rust-lang/rust/src/libstd/thread/mod.rs:405
  23:        0x106f78cf5 - _$LT$F$u20$as$u20$alloc..boxed..FnBox$LT$A$GT$$GT$::call_box::h21e3ddd4f40000ec
                        at /Users/travis/build/rust-lang/rust/src/liballoc/boxed.rs:788
  24:        0x108840857 - std::sys_common::thread::start_thread::h1ef8cf6b973abe77
                        at libstd/sys_common/thread.rs:24
  25:        0x108843c88 - std::sys::unix::thread::Thread::new::thread_start::h88d15e6243c319fe
                        at libstd/sys/unix/thread.rs:90
  26:     0x7fffaeb4393a - _pthread_body
  27:     0x7fffaeb43886 - _pthread_start
@jdm
Copy link
Member Author

@jdm jdm commented Mar 16, 2018

@nical This looks like a panic that originates from your async building work. Any suggestions for how to investigate it?

@jdm
Copy link
Member Author

@jdm jdm commented Mar 16, 2018

The render backend already checks if can_render is false at https://github.com/servo/webrender/blob/f7fc88cb81bd475bc28d2e290cf387171cd6350c/webrender/src/render_backend.rs#L968, but then we go ahead and attempt to render it later on in the method.

@nical
Copy link
Contributor

@nical nical commented Mar 16, 2018

The render backend already checks if can_render is false at https://github.com/servo/webrender/blob/f7fc88cb81bd475bc28d2e290cf387171cd6350c/webrender/src/render_backend.rs#L968, but then we go ahead and attempt to render it later on in the method.

Oh yeah looks like the branch that cancels the render and the one that checks for generate_frame should be inverted.

bors-servo added a commit to servo/webrender that referenced this issue Mar 19, 2018
Don't generate a frame when no scene is built.

The two branches were inverted, allowing frame building to happen in cases where we haven't yet received a scene, which caused servo/servo#20271 .

r? anyone

<!-- 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/2541)
<!-- Reviewable:end -->
@atouchet
Copy link
Contributor

@atouchet atouchet commented Mar 23, 2018

Has this been fixed? I believe the latest WebRender update included servo/webrender#2541.

@jdm jdm added the C-is-this-done label Mar 24, 2018
@jdm
Copy link
Member Author

@jdm jdm commented Feb 5, 2019

This is fixed.

@jdm jdm closed this Feb 5, 2019
@jdm jdm mentioned this issue Sep 23, 2019
4 of 4 tasks complete
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.

None yet
3 participants
You can’t perform that action at this time.