Skip to content

Multiprocess panics #10853

Closed
servo/saltfs
#341

Description

@asajeffrey
$ ./mach run --release --browser --multiprocess
/home/ajeffrey/github/asajeffrey/servo/target/release/build
thread '<main>' panicked at 'assertion failed: DEFAULT_OPTIONS.is_null()', /home/ajeffrey/github/asajeffrey/servo/components/util/opts.rs:865
stack backtrace:
   1:     0x55d57aca0360 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
   2:     0x55d57aca79ab - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
   3:     0x55d57aca7613 - std::panicking::default_hook::h08ad3bb09872855b
   4:     0x55d57a5bf4f6 - util::panicking::initiate_panic_hook::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h0e7bee18dea07167
   5:     0x55d57ac8d903 - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
   6:     0x55d579423a8f - std::sys_common::unwind::begin_unwind::h51df842978a11a26
   7:     0x55d57a5cd75c - util::opts::set_defaults::h098942ea84f16a68
   8:     0x55d5793cc55e - servo::run_content_process::hd4a30451af3ea9d0
   9:     0x55d5792a6389 - servo::main::h6924e5658370f6b5
  10:     0x55d57aca70b4 - std::sys_common::unwind::try::try_fn::hfe4b14ce00a3f42f
  11:     0x55d57ac9f53b - __rust_try
  12:     0x55d57aca6afb - std::rt::lang_start::h12d9b3310b48a726
  13:     0x7fe6823a4a3f - __libc_start_main
  14:     0x55d5792a58f8 - _start
  15:                0x0 - <unknown>

Activity

  1. added
    I-panic
    on Apr 26, 2016
  2. self-assigned this
    on Apr 26, 2016
  3. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    @jdm in IRC suggests a connection to #10497.

  4. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    A backtrace from a debug build:

    $ ./mach run --dev --browser --multiprocess
    /home/ajeffrey/github/asajeffrey/servo/target/debug/build
    thread '<main>' panicked at 'assertion failed: DEFAULT_OPTIONS.is_null()', /home/ajeffrey/github/asajeffrey/servo/components/util/opts.rs:865
    stack backtrace:
       1:     0x555c60258ba0 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
       2:     0x555c602601eb - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
       3:     0x555c6025fe53 - std::panicking::default_hook::h08ad3bb09872855b
       4:     0x555c5fa80cc2 - util::panicking::initiate_panic_hook::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h0e7bee18dea07167
                            at /home/ajeffrey/github/asajeffrey/servo/components/util/panicking.rs:71
       5:     0x555c60246123 - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
       6:     0x555c5fa4fad7 - std::sys_common::unwind::begin_unwind::h51df842978a11a26
                            at ../src/libstd/sys/common/unwind/mod.rs:219
       7:     0x555c5fa7dddf - util::opts::set_defaults::h098942ea84f16a68
                            at /home/ajeffrey/github/asajeffrey/servo/components/servo/<std macros>:3
       8:     0x555c5d204841 - servo::run_content_process::hd4a30451af3ea9d0
                            at /home/ajeffrey/github/asajeffrey/servo/components/servo/lib.rs:253
       9:     0x555c5ceb89ba - servo::main::h6924e5658370f6b5
                            at /home/ajeffrey/github/asajeffrey/servo/components/servo/main.rs:60
      10:     0x555c6025f8f4 - std::sys_common::unwind::try::try_fn::hfe4b14ce00a3f42f
      11:     0x555c60257d7b - __rust_try
      12:     0x555c6025f33b - std::rt::lang_start::h12d9b3310b48a726
      13:     0x555c5cfd4889 - main
      14:     0x7f37df51ba3f - __libc_start_main
      15:     0x555c5ceb8528 - _start
      16:                0x0 - <unknown>
    
  5. changed the title [-]Multiprocess browser.html panics[/-] [+]Multiprocess panics[/+] on Apr 26, 2016
  6. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    The problem is util::opts::set_defaults, which contains a failing assert:

    pub fn set_defaults(opts: Opts) {
        unsafe {
            assert!(DEFAULT_OPTIONS.is_null());
            assert!(DEFAULT_OPTIONS != INVALID_OPTIONS);
            let box_opts = box opts;
            DEFAULT_OPTIONS = Box::into_raw(box_opts);
        }
    }
  7. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    In fact, you don't need browser.html, just multiprocess:

    $ ./mach run --dev --multiprocess
    thread '<main>' panicked at 'assertion failed: DEFAULT_OPTIONS.is_null()', /home/ajeffrey/github/asajeffrey/servo/components/util/opts.rs:865
    stack backtrace:
       1:     0x55b8193a3ba0 - std::sys::backtrace::tracing::imp::write::h714760a4c8c0cdd8
       2:     0x55b8193ab1eb - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hff309ab1d83ffd90
       3:     0x55b8193aae53 - std::panicking::default_hook::h08ad3bb09872855b
       4:     0x55b818bcbcc2 - util::panicking::initiate_panic_hook::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h0e7bee18dea07167
                            at /home/ajeffrey/github/asajeffrey/servo/components/util/panicking.rs:71
       5:     0x55b819391123 - std::sys_common::unwind::begin_unwind_inner::h406d5f1a330b854b
       6:     0x55b818b9aad7 - std::sys_common::unwind::begin_unwind::h51df842978a11a26
                            at ../src/libstd/sys/common/unwind/mod.rs:219
       7:     0x55b818bc8ddf - util::opts::set_defaults::h098942ea84f16a68
                            at /home/ajeffrey/github/asajeffrey/servo/components/servo/<std macros>:3
       8:     0x55b81634f841 - servo::run_content_process::hd4a30451af3ea9d0
                            at /home/ajeffrey/github/asajeffrey/servo/components/servo/lib.rs:253
       9:     0x55b8160039ba - servo::main::h6924e5658370f6b5
                            at /home/ajeffrey/github/asajeffrey/servo/components/servo/main.rs:60
      10:     0x55b8193aa8f4 - std::sys_common::unwind::try::try_fn::hfe4b14ce00a3f42f
      11:     0x55b8193a2d7b - __rust_try
      12:     0x55b8193aa33b - std::rt::lang_start::h12d9b3310b48a726
      13:     0x55b81611f889 - main
      14:     0x7f228e7e9a3f - __libc_start_main
      15:     0x55b816003528 - _start
      16:                0x0 - <unknown>
    
  8. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    Well this would be the problem...

    In servo/main.rs:

    fn main() {
        // Parse the command line options and store them globally
        let opts_result = opts::from_cmdline_args(&*args());
        ...
        if let Some(token) = content_process_token {
            return servo::run_content_process(token)
        }
        ...
    }

    in servo/lib.rs:

    pub fn run_content_process(token: String) {
        ...
        opts::set_defaults(unprivileged_content.opts());
        ...
    }

    so main() calls opts::from_cmdline_args which sets DEFAULT_OPTIONS, then run_content_process calls opts::set_defaults after the options have been set, and boom.

  9. kaksmet commented on Apr 26, 2016

    @kaksmet
    Contributor

    In content processes opts::from_cmdline_args doesn't actually set any opts, see this comment.

    I think this regressed with #10572.
    The issue is with the content process calling initiate_panic_hook() before run_content_process().
    initiate_panic_hook calls opts::get() which cases opts::OPTIONS to get initialized and opts::DEFAULT_OPTIONS gets set to INVALID_OPTIONS. Then run_content_process is run and calls opts::set_defaults, causing assert!(DEFAULT_OPTIONS != INVALID_OPTIONS) to fail.

  10. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    @kaksmet yes, just noticed the return statement, and that comment. So your theory is now winning!

  11. asajeffrey commented on Apr 26, 2016

    @asajeffrey
    ContributorAuthor

    It looks like this is fixed by #10824, since that removes the problematic use of opts.

  12. added a commit that references this issue on Apr 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

I-panic

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions