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

Double borrow in Box::padding_box_size #1926

Closed
Ms2ger opened this issue Mar 15, 2014 · 1 comment
Closed

Double borrow in Box::padding_box_size #1926

Ms2ger opened this issue Mar 15, 2014 · 1 comment

Comments

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Mar 15, 2014

STR: ./servo http://www.bing.com

Actual: task 'task 'task '<unnamed>' failed at '<unnamed>assertion failed: self.parent.borrow != WRITING && self.parent.borrow != UNUSED<unnamed>' failed at '' failed at 'RefCell<T> already mutably borrowed', ', RefCell<T> already mutably borrowed/src/compiler/rust/src/libstd/cell.rs/src/compiler/rust/src/libstd/cell.rs', :/src/compiler/rust/src/libstd/cell.rs248 ::135135 (sic)

(gdb) bt
#0  std::rt::unwind::Unwinder::begin_unwind::rust_fail () at /src/compiler/rust/src/libstd/rt/global_heap.rs:59
#1  0x00007ffff78c0663 in std::rt::unwind::Unwinder::begin_unwind (cause=..., self=<optimized out>)
    at /src/compiler/rust/src/libstd/rt/unwind.rs:183
#2  0x000000000045ce6a in rt::unwind::begin_unwind::h9db4a7f21e18372aab::v0.0 ()
#3  0x000000000056f471 in cell::RefCell::borrow::he05fa070c281e60fboaC::v0.0 ()
#4  0x000000000056f2cc in cell::RefCell::get::he1b6fbb93682951ePxaB::v0.0 ()
    at /src/components/main/layout/block.rs:1634
#5  0x00000000005979ae in servo::layout::box_::Box::padding_box_size (self=0x7fffd0078d60)
    at /src/components/main/layout/box_.rs:632
#6  0x000000000058598b in servo::layout::block::Flow$BlockFlow::generated_cb_size (self=0x7fffd0078bd0)
    at /src/components/main/layout/block.rs:1476
#7  0x000000000057c224 in servo::layout::block::BlockFlow::containing_block_size (self=0x7fffc005ae90, viewport_size=...)
    at /src/components/main/layout/block.rs:419
#8  0x0000000000572deb in servo::layout::block::WidthAndMarginsComputer$AbsoluteNonReplaced::containing_block_width (self=0x7fffc80a4710, 
    block=0x7fffc005ae90, ctx=0x7fffe8601228) at /src/components/main/layout/block.rs:1927
#9  0x0000000000572ea9 in servo::layout::block::WidthAndMarginsComputer::initial_computed_width<layout::block::AbsoluteNonReplaced> (
    self=0x7fffc80a4710, block=0x7fffc005ae90, parent_flow_width=..., ctx=0x7fffe8601228)
    at /src/components/main/layout/block.rs:1663
#10 0x00000000005726e2 in servo::layout::block::WidthAndMarginsComputer::compute_width_constraint_inputs<layout::block::AbsoluteNonReplaced> (
    self=0x7fffc80a4710, block=0x7fffc005ae90, parent_flow_width=..., ctx=0x7fffe8601228)
    at /src/components/main/layout/block.rs:1590
#11 0x00000000005740ff in servo::layout::block::WidthAndMarginsComputer::compute_used_width<layout::block::AbsoluteNonReplaced> (
    self=0x7fffc80a4710, block=0x7fffc005ae90, ctx=0x7fffe8601228, parent_flow_width=...)
    at /src/components/main/layout/block.rs:1681
#12 0x00000000005816c8 in servo::layout::block::Flow$BlockFlow::assign_widths (self=0x7fffc005ae90, ctx=0x7fffe8601228)
    at /src/components/main/layout/block.rs:1288
#13 0x00000000005ef6e8 in servo::layout::layout_task::PreorderFlowTraversal$AssignWidthsTraversal::process (self=0x7fffe1ff97f8, flow=...)
    at /src/components/main/layout/layout_task.rs:199
#14 0x0000000000649ff8 in servo::layout::parallel::ParallelPreorderFlowTraversal::run_parallel_helper<layout::layout_task::AssignWidthsTraversal<'static>> (self=0x7fffe1ff97f8, unsafe_flow=..., proxy=0x7fffe1ff9980, top_down_func=
    {void (struct (uint,uint,uint), struct util::workqueue::WorkerProxy<,*mut layout::context::LayoutContext,(uint,uint,uint)> *)} 0x7fffe1ff9748, 
    bottom_up_func=
    {void (struct (uint,uint,uint), struct util::workqueue::WorkerProxy<,*mut layout::context::LayoutContext,(uint,uint,uint)> *)} 0x7fffe1ff9740)
    at /src/components/main/layout/parallel.rs:197
#15 0x0000000000649f41 in servo::layout::parallel::ParallelPreorderFlowTraversal$AssignWidthsTraversal::run_parallel (self=0x7fffe1ff97f8, 
    unsafe_flow=..., proxy=0x7fffe1ff9980) at /src/components/main/layout/parallel.rs:223
#16 0x000000000064a61d in servo::layout::parallel::assign_widths (unsafe_flow=..., proxy=0x7fffe1ff9980)
    at /src/components/main/layout/parallel.rs:391
#17 0x000000000060d60b in workqueue::WorkerThread::start::hef848ab645e05bfamOaZ::v0.0 ()
    at /src/components/main/compositing/compositor_layer.rs:257
#18 0x000000000060cc32 in workqueue::WorkQueue::new::anon::expr_fn::KXa7aL ()
    at /src/components/main/compositing/compositor_layer.rs:257
#19 0x00007ffff7009a68 in fn6736 () at /src/compiler/rust/src/libnative/task.rs:85
#20 0x00007ffff79617e8 in finally (self=<optimized out>, dtor=<optimized out>)
    at /src/compiler/rust/src/libstd/unstable/finally.rs:53
#21 fn47863 () at /src/compiler/rust/src/libstd/rt/task.rs:128
#22 0x00007ffff7968edc in rust_try ()
   from /x86_64-unknown-linux-gnu/src/compiler/rust/x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-3e5aeb83-0.9.so
#23 0x00007ffff796158e in put<rt::task::Task> (sched=<optimized out>)
    at /src/compiler/rust/src/libstd/rt/local_ptr.rs:102
#24 put (value=<optimized out>) at /src/compiler/rust/src/libstd/rt/local.rs:29
#25 std::rt::task::Task::run (f={void ()} 0x7fffe1ff9ce8, self=<optimized out>)
    at /src/compiler/rust/src/libstd/rt/task.rs:121
#26 0x00007ffff7009688 in fn6725 () at /src/compiler/rust/src/libnative/task.rs:85
#27 0x00007ffff7963374 in rt::thread::thread_start::h1c6c4d06897b01b3ax::v0.9 ()
    at /src/compiler/rust/src/libstd/rt/thread.rs:48
#28 0x00007ffff4c64e9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#29 0x00007ffff51733fd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#30 0x0000000000000000 in ?? ()
@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Apr 4, 2014

This does not happen when parallel layout is disabled (-y 1)

bors-servo pushed a commit that referenced this issue Apr 4, 2014
…metajack

Until we land a fix for #1926, set the default number of threads for parallel layout to 1 to avoid races, a double-borrow, and task failure resulting in all cores spinning indefinitely.

r? @metajack
bors-servo pushed a commit that referenced this issue May 2, 2014
layout: Re-enable parallel layout by removing all `RefCell` instances from `Flow`s; in the process, remove `InlineInfo` in favor of the range-based design that was originally planned and halfway implemented.

Now, the DOM tree structure for inline flows is reflected not by a
series of arrays but instead by a flat list of ranges into the list of
boxes. As part of this, the `border` and `padding` fields, which were
incorrect in the case of inlines and necessitated separate
`noncontent_inline_foo` methods, have been merged into a single
`border_padding` field that is always guaranteed to be correct after
width assignment, even for inlines.

r? @SimonSapin and/or @larsbergstrom

Closes #1280 
Closes #1926
Closes #1999 
Closes #2013
Closes #2018
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.