Skip to content

Servo panics exactly after 144 navigations #7572

Closed

Description

@paulrouget

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

Activity

  1. jdm commented on Sep 9, 2015

    @jdm
    Member

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

  2. added
    I-perf-bloat
    on Sep 9, 2015
  3. paulrouget commented on Aug 15, 2016

    @paulrouget
    ContributorAuthor

    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?

  4. jdm commented on Jan 3, 2017

    @jdm
    Member

    I would expect #14312 to help here.

  5. paulrouget commented on Jan 5, 2017

    @paulrouget
    ContributorAuthor

    Now, same error, but after 336 navigations.

  6. cbrewster commented on Jan 5, 2017

    @cbrewster
    Contributor

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

  7. paulrouget commented on Jan 5, 2017

    @paulrouget
    ContributorAuthor
  8. asajeffrey commented on Jan 5, 2017

    @asajeffrey
    Contributor

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

  9. asajeffrey commented on Jan 5, 2017

    @asajeffrey
    Contributor

    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>
    ...
    
  10. asajeffrey commented on Jan 5, 2017

    @asajeffrey
    Contributor

    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)
    
  11. asajeffrey commented on Jan 5, 2017

    @asajeffrey
    Contributor

    Try with #14860.

  12. paulrouget commented on Jan 6, 2017

    @paulrouget
    ContributorAuthor

    @asajeffrey with #14860, no crash :)

  13. asajeffrey commented on Jan 6, 2017

    @asajeffrey
    Contributor

    That's good to know!

  14. asajeffrey commented on Jan 6, 2017

    @asajeffrey
    Contributor

    Closed by #14860.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-perf-bloat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions