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

assertion failed: !self.scroll_roots.contains_key(&scroll_root.id) #14574

Closed
jdm opened this issue Dec 13, 2016 · 4 comments
Closed

assertion failed: !self.scroll_roots.contains_key(&scroll_root.id) #14574

jdm opened this issue Dec 13, 2016 · 4 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Dec 13, 2016

./mach run -d http://www3.lenovo.com/ca/en/laptops/thinkpad/thinkpad-x/ThinkPad-X1-Carbon-4th-Gen/p/22TP2TXX14G
assertion failed: !self.scroll_roots.contains_key(&scroll_root.id) (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(1) }, at /home/jdm/master-servo/components/layout/display_list_builder.rs:124)
(gdb) bt
#0  std::panicking::rust_panic () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:482
#1  0x000055555af77a8d in std::panicking::rust_panic_with_hook () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:467
#2  0x0000555559b41284 in std::panicking::begin_panic<&str> (msg="assertion failed: !self.scroll_roots.contains_key(&scroll_root.id)", 
    file_line=0x55555d31ca30 <layout::display_list_builder::DisplayListBuildState::add_scroll_root::_FILE_LINE::h6f9ddb45b668e4b0>)
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:413
#3  0x0000555559c79d14 in layout::display_list_builder::{{impl}}::add_scroll_root (self=0x7fffe7bf6ff0, scroll_root=ScrollRoot = {...}) at /home/jdm/master-servo/components/layout/display_list_builder.rs:124
#4  0x0000555559c893ca in layout::display_list_builder::{{impl}}::build_display_list_for_block (self=0x7fffd97f1b10, state=0x7fffe7bf6ff0, border_painting_mode=Separate)
    at /home/jdm/master-servo/components/layout/display_list_builder.rs:1997
#5  0x0000555559cdcee5 in layout::table::{{impl}}::build_display_list (self=0x7fffd97f1b10, state=0x7fffe7bf6ff0) at /home/jdm/master-servo/components/layout/table.rs:482
#6  0x0000555559cfc539 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:254
#7  0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#8  0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#9  0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#10 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#11 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#12 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#13 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#14 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#15 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#16 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#17 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#18 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#19 0x0000555559cfc683 in layout::traversal::{{impl}}::traverse (self=0x7fffe7bf6ff0, flow=&mut Flow) at /home/jdm/master-servo/components/layout/traversal.rs:259
#20 0x0000555559cd8a70 in layout::sequential::build_display_list_for_subtree (flow_root=&mut Flow, shared_layout_context=0x7fffe7bf9220) at /home/jdm/master-servo/components/layout/sequential.rs:85
#21 0x00005555565afcf4 in layout_thread::{{impl}}::compute_abs_pos_and_build_display_list::{{closure}} () at /home/jdm/master-servo/components/layout_thread/lib.rs:909
Python Exception <class 'ValueError'> invalid literal for int() with base 0: '0x7fffec8ed0c0 "http://www3.lenovo.com/ca/en/laptops/thinkpad/thinkpad-x/ThinkPad-X1-Carbon-4th-Gen/p/22TP2TXX14G"': 
#22 0x000055555639cd3a in profile_traits::time::profile<(),closure> (category=LayoutDispListBuild, meta=..., profiler_chan=ProfilerChan = {...}, callback=closure = {...})
    at /home/jdm/master-servo/components/profile_traits/time.rs:119
#23 0x00005555565af764 in layout_thread::{{impl}}::compute_abs_pos_and_build_display_list (self=0x7fffe7bfb3b8, data=0x7fffe7bfa510, query_type=Some = {...}, document=Some = {...}, layout_root=&mut Flow, 
    shared_layout_context=0x7fffe7bf9220, rw_data=0x7fffe5c6cfa0) at /home/jdm/master-servo/components/layout_thread/lib.rs:885
#24 0x00005555565b7157 in layout_thread::{{impl}}::perform_post_main_layout_passes (self=0x7fffe7bfb3b8, data=0x7fffe7bfa510, query_type=Some = {...}, document=Some = {...}, rw_data=0x7fffe5c6cfa0, 
    layout_context=0x7fffe7bf9220) at /home/jdm/master-servo/components/layout_thread/lib.rs:1455
#25 0x00005555565b6885 in layout_thread::{{impl}}::perform_post_style_recalc_layout_passes (self=0x7fffe7bfb3b8, data=0x7fffe7bfa510, query_type=Some = {...}, document=Some = {...}, rw_data=0x7fffe5c6cfa0, 
    layout_context=0x7fffe7bf9220) at /home/jdm/master-servo/components/layout_thread/lib.rs:1439
#26 0x00005555565b3909 in layout_thread::{{impl}}::handle_reflow (self=0x7fffe7bfb3b8, data=0x7fffe7bfa510, possibly_locked_rw_data=0x7fffe7bfb370) at /home/jdm/master-servo/components/layout_thread/lib.rs:1193
#27 0x00005555565ad29e in layout_thread::{{impl}}::handle_request_helper::{{closure}} () at /home/jdm/master-servo/components/layout_thread/lib.rs:648
Python Exception <class 'ValueError'> invalid literal for int() with base 0: '0x7fffec88b2a0 "http://www3.lenovo.com/ca/en/laptops/thinkpad/thinkpad-x/ThinkPad-X1-Carbon-4th-Gen/p/22TP2TXX14Gnf"': 
#28 0x000055555639d8bf in profile_traits::time::profile<(),closure> (category=LayoutPerform, meta=..., profiler_chan=ProfilerChan = {...}, callback=closure = {...})
    at /home/jdm/master-servo/components/profile_traits/time.rs:119
#29 0x00005555565ac8b9 in layout_thread::{{impl}}::handle_request_helper (self=0x7fffe7bfb3b8, request=Reflow = {...}, possibly_locked_rw_data=0x7fffe7bfb370)
    at /home/jdm/master-servo/components/layout_thread/lib.rs:645
#30 0x00005555565ab5dd in layout_thread::{{impl}}::handle_request (self=0x7fffe7bfb3b8, possibly_locked_rw_data=0x7fffe7bfb370) at /home/jdm/master-servo/components/layout_thread/lib.rs:584
#31 0x00005555565aa586 in layout_thread::{{impl}}::start (self=LayoutThread = {...}) at /home/jdm/master-servo/components/layout_thread/lib.rs:499
#32 0x00005555565a6b8e in layout_thread::{{impl}}::create::{{closure}}::{{closure}} () at /home/jdm/master-servo/components/layout_thread/lib.rs:282
#33 0x000055555639bfed in profile_traits::mem::{{impl}}::run_with_memory_reporting<closure,fn(profile_traits::mem::ReportsChan) -> script_layout_interface::message::Msg,script_layout_interface::message::Msg,std::sync::mpsc::Sender<script_layout_interface::message::Msg>> (self=0x7fffe7bfc6d0, f=closure = {...}, reporter_name="layout-reporter-(0,1)", 
    channel_for_reporter=Sender<script_layout_interface::message::Msg> = {...}, msg=0x7fffe7bfbe30) at /home/jdm/master-servo/components/profile_traits/mem.rs:63
#34 0x00005555565a7229 in layout_thread::{{impl}}::create::{{closure}} () at /home/jdm/master-servo/components/layout_thread/lib.rs:281
#35 0x000055555658005b in std::panic::{{impl}}::call_once<(),closure> (self=AssertUnwindSafe<closure> = {...}, _args=0)
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:295
#36 0x0000555556410b59 in std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()> (data=0x7fffe7bfd028 "\001")
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:356
#37 0x000055555af804db in panic_unwind::__rust_maybe_catch_panic () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
#38 0x000055555640f18a in std::panicking::try<(),std::panic::AssertUnwindSafe<closure>> (f=AssertUnwindSafe<closure> = {...})
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:332
#39 0x000055555640de75 in std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()> (f=AssertUnwindSafe<closure> = {...})
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:351
#40 0x000055555640ed5d in std::thread::{{impl}}::spawn::{{closure}}<closure,()> () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/mod.rs:287
#41 0x000055555649bc8a in alloc::boxed::{{impl}}::call_box<(),closure> (self=0x7fffea2690c0, args=0) at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:595
#42 0x000055555af76695 in alloc::boxed::{{impl}}::call_once<(),()> () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:605
#43 std::sys_common::thread::start_thread () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys_common/thread.rs:21
#44 std::sys::imp::thread::{{impl}}::new::thread_start () at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/thread.rs:84
#45 0x00007ffff60dc70a in start_thread (arg=0x7fffe7bfe700) at pthread_create.c:333
#46 0x00007ffff5bfc82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

cc @mrobinson

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Dec 14, 2016

This seems to be an issue where a particular node is producing more than one Flow and also starting a scroll root. I didn't realize this could happen. I believe I have a solution that will both fix this issue and also make possibly make incremental display list construction possible. This also fits in well with work that I'm already doing, so I hope to have a PR for this issue soon.

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Jan 4, 2017

Okay. I did some more digging with this issue. The root of the problem is that a table on the page somehow has it's overflow style resolved to "auto." This causes Servo to attempt to create a scrolling root for the table wrapper as well as the table. Judging by https://bugzilla.mozilla.org/show_bug.cgi?id=26617 it seems that tables should never respect overflow:scroll or overflow:auto, so I think there's a deeper issue here. Quite likely, we should just avoid respecting those properties when they are applied to tables.

@jdm jdm added the A-webcompat label Jan 4, 2017
@mrobinson
Copy link
Member

@mrobinson mrobinson commented Jan 9, 2017

Here's a reduced test case:

<table style="overflow: scroll;"> </table>

I'm testing a fix for this now.

mrobinson added a commit to mrobinson/servo that referenced this issue Jan 10, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

Fixes servo#14574.
@mrobinson
Copy link
Member

@mrobinson mrobinson commented Jan 10, 2017

A fix is available in the branch at https://github.com/mrobinson/servo/tree/scroll-roots-when-necessary, but it depends on #14603. Hopefully I can get that reviewed today or tomorrow.

mrobinson added a commit to mrobinson/servo that referenced this issue Jan 10, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes servo#14574.
mrobinson added a commit to mrobinson/servo that referenced this issue Jan 10, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes servo#14574.
mrobinson added a commit to mrobinson/servo that referenced this issue Jan 11, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes servo#14574.
mrobinson added a commit to mrobinson/servo that referenced this issue Jan 12, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes servo#14574.
mrobinson added a commit to mrobinson/servo that referenced this issue Jan 12, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes servo#14574.
mrobinson added a commit to mrobinson/servo that referenced this issue Jan 17, 2017
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes servo#14574.
bors-servo added a commit that referenced this issue Jan 17, 2017
Only create scrolling overflow regions when necessary

Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes #14574.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14574 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14979)
<!-- 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.

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