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

Servo panics exactly after 144 navigations #7572

Closed
paulrouget opened this issue Sep 9, 2015 · 13 comments
Closed

Servo panics exactly after 144 navigations #7572

paulrouget opened this issue Sep 9, 2015 · 13 comments
Labels
I-perf-bloat Unnecessary memory usage.

Comments

@paulrouget
Copy link
Contributor

Just create this simple document:

<script>
  location.assign(location.href);
</script>

The page navigates 144 times (it's always 144 on my machine), and then:

thread 'PaintTask PipelineId(144)' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } }', src/libcore/result.rs:734
stack backtrace:
thread 'Constellation' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } }', src/libcore/result.rs:734
   1:        0x105977df0 - sys::backtrace::tracing::imp::write::hd0176e40ebe71d28Vks
   2:        0x10597aff9 - panicking::on_panic::h929e7e75bc4f2c31NXw
   3:        0x10596a192 - rt::unwind::begin_unwind_inner::h9d2d49cde66c0c4b0sw
   4:        0x10596a83d - rt::unwind::begin_unwind_fmt::h30d162ea92169f156rw
   5:        0x10597aa57 - rust_begin_unwind
   6:        0x10599fba0 - panicking::panic_fmt::ha85fd08dcab4df5d8PE
   7:        0x1049bdff8 - iter::Map<I, F>.Iterator::next::h2739781353065444127
   8:        0x1049b6049 - paint_task::WorkerThreadProxy::spawn::h09d210ec5810c6a5q3i
   9:        0x104753a00 - boxed::F.FnBox<A>::call_box::h8938302690982073553
  10:        0x104737602 - rt::unwind::try::try_fn::h7397073164000958079
  11:        0x10597aa08 - __rust_try
  12:        0x105976710 - rt::unwind::try::inner_try::h03cd26bf8e2ee1ceTow
  13:        0x1047377a7 - boxed::F.FnBox<A>::call_box::h9041483843375298480
  14:        0x105979dbd - sys::thread::Thread::new::thread_start::he62641fb2961f41aBNv
  15:     0x7fff8b2189b0 - _pthread_body
  16:     0x7fff8b21892d - _pthread_start
@jdm
Copy link
Member

jdm commented Sep 9, 2015

Probably something to do with resource exhaustion, since all of our old pipelines are never garbage collected.

@jdm jdm added the I-perf-bloat Unnecessary memory usage. label Sep 9, 2015
@paulrouget
Copy link
Contributor Author

It takes some more time now. And it crashes differently:

ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(201) }, at ../src/libcore/result.rs:788)
ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(202) }, at ../src/libcore/result.rs:788)
ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread ResourceManager, at ../src/libcore/result.rs:788)
ERROR:servo: called `Result::unwrap()` on an `Err` value: RecvError (thread LayoutWorker worker 1/3, at ../src/libcore/result.rs:788)
ERROR:servo: called `Result::unwrap()` on an `Err` value: RecvError (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(201) }, at ../src/libcore/result.rs:788)
ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread PaintThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(202) }, at ../src/libcore/result.rs:788)
ERROR:servo: called `Result::unwrap()` on an `Err` value: RecvError (thread LayoutWorker worker 1/3, at ../src/libcore/result.rs:788)
ERROR:constellation::constellation: about:failure failed
ERROR:servo: called `Result::unwrap()` on an `Err` value: RecvError (thread PaintWorker, at ../src/libcore/result.rs:788)
ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(203) }, at ../src/libcore/result.rs:788)
ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread PaintThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(203) }, at ../src/libcore/result.rs:788)
ERROR:servo: Thread spawn failed: Error { repr: Os { code: 35, message: "Resource temporarily unavailable" } } (thread Constellation, at ../src/libcore/result.rs:788)
ERROR:servo: called `Result::unwrap()` on an `Err` value: RecvError (thread LayoutWorker worker 1/3, at ../src/libcore/result.rs:788)
ERROR:servo: called `Result::unwrap()` on an `Err` value: RecvError (thread PaintWorker, at ../src/libcore/result.rs:788)
^CServo exited with return value -2

Would #11893 help?

@jdm
Copy link
Member

jdm commented Jan 3, 2017

I would expect #14312 to help here.

@paulrouget
Copy link
Contributor Author

Now, same error, but after 336 navigations.

@cbrewster
Copy link
Contributor

@paulrouget are you using a version after #14312 landed?

@paulrouget
Copy link
Contributor Author

@cbrewster yes.

@asajeffrey
Copy link
Member

@paulrouget can you try playing with --max-session-history=N and see if this makes a difference?

@asajeffrey
Copy link
Member

When I do this, the error I get is running out of file descriptors, not failing to spawn a thread:

called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 9, message: "Bad file descriptor" } } (thread <unnamed>, at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:845)
called `Result::unwrap()` on an `Err` value: IoError(Error { repr: Os { code: 104, message: "Connection reset by peer" } }) (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(0), index: PipelineIndex(193) }, at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:845)
stack backtrace:
   0:     0x56319a33c81d - backtrace::backtrace::trace::he26d3ea809136443
   1:     0x56319a33cee2 - backtrace::capture::Backtrace::new::hd6fb6e83f9059b0d
   2:     0x56319a1883dd - servo::main::{{closure}}::hbd42942b97f42442
   3:     0x56319c02b474 - std::panicking::rust_panic_with_hook
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:556
   4:     0x56319c02b2e4 - std::panicking::begin_panic<collections::string::String>
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:517
   5:     0x56319c02b259 - std::panicking::begin_panic_fmt
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:501
   6:     0x56319c02b1e7 - std::panicking::rust_begin_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:477
   7:     0x56319c0586bd - core::panicking::panic_fmt
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/panicking.rs:69
   8:     0x56319b4381ed - core::result::unwrap_failed::hcec1fc57665b213a
   9:     0x56319b47b5b3 - webrender::render_backend::RenderBackend::run::hfe42891a082aa8c1
  10:     0x56319b42980f - std::panicking::try::do_call::h7f342fb4bfcbecf0
  11:     0x56319c0323da - panic_unwind::__rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
  12:     0x56319b441907 - <F as alloc::boxed::FnBox<A>>::call_box::h468ea838a48e825a
  13:     0x56319c02a114 - alloc::boxed::{{impl}}::call_once<(),()>
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/liballoc/boxed.rs:615
                         - std::sys_common::thread::start_thread
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys_common/thread.rs:21
                         - std::sys::imp::thread::{{impl}}::new::thread_start
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys/unix/thread.rs:84
  14:     0x7fcf279cc709 - start_thread
  15:     0x7fcf274ef0ae - __clone
  16:                0x0 - <unknown>
...

@asajeffrey
Copy link
Member

Adding a 100ms delay in between navigations to give the OS time to reclaim resources changes the error message, but it's still file descriptors it's running out of:

Failed to create IPC channel!: Error { repr: Os { code: 24, message: "Too many open files" } } (thread Constellation, at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:845)

@asajeffrey
Copy link
Member

Try with #14860.

@paulrouget
Copy link
Contributor Author

@asajeffrey with #14860, no crash :)

@asajeffrey
Copy link
Member

That's good to know!

@asajeffrey
Copy link
Member

Closed by #14860.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-perf-bloat Unnecessary memory usage.
Projects
None yet
Development

No branches or pull requests

4 participants