Assertion failed (unshare) when starting with multiprocess and sandboxing.
Open
Nobody has claimed this yet.
I-panic
P-linux
- Dominant language
- Rust
- Stars
- 38k
- Forks
- 3.8k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 465
Description
assertion failed: unshare(CLONE_NEWUSER | CLONE_NEWPID) == 0 (thread Constellation, at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:193)
stack backtrace:
0: 0x561a381159a1 - backtrace::backtrace::libunwind::trace
at /home/emilio/projects/moz/servo-2/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54
- backtrace::backtrace::trace<closure>
at /home/emilio/projects/moz/servo-2/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70
1: 0x561a38116550 - backtrace::capture::{{impl}}::new
at /home/emilio/projects/moz/servo-2/target/debug/build/backtrace-3bc1ff360ebb00cb/out/capture.rs:79
2: 0x561a343470e9 - servo::main::{{closure}}
at /home/emilio/projects/moz/servo-2/components/servo/main.rs:121
3: 0x561a39027567 - std::panicking::rust_panic_with_hook::h105c3d42fcd2fb5e
4: 0x561a38d97293 - {{inlined-root}}::begin_panic<&str>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:338
5: 0x561a38da7eba - gaol::platform::linux::namespace::prepare_user_and_pid_namespaces
at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:3
6: 0x561a38da8ebe - gaol::platform::linux::namespace::start
at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:243
7: 0x561a38dab5f4 - gaol::platform::linux::{{impl}}::start
at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/mod.rs:72
8: 0x561a37b67d6c - constellation::pipeline::{{impl}}::spawn_multiprocess
at /home/emilio/projects/moz/servo-2/components/constellation/pipeline.rs:516
9: 0x561a345548ec - {{inlined-root}}::spawn<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/pipeline.rs:253
10: 0x561a348001ad - {{inlined-root}}::new_pipeline<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:556
11: 0x561a34805671 - {{inlined-root}}::handle_init_load<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:1154
12: 0x561a3481b7c1 - {{inlined-root}}::handle_request_from_compositor<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:776
13: 0x561a348022b5 - {{inlined-root}}::handle_request<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:704
14: 0x561a3481f88a - {{inlined-root}}::run<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:522
15: 0x561a348492b6 - _<constellation..constellation..Constellation<Message, LTF, STF>>::start::_$u7b$$u7b$closure$u7d$$u7d$::h7bd448c71c8e77e7
16: 0x561a34827eca - {{inlined-root}}::call_once<(),closure>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:256
17: 0x561a3483fc20 - std::panicking::try::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hd84f6aed7b455625
18: 0x561a346961cc - {{inlined-root}}::call<closure>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:282
19: 0x561a3902f916 - __rust_maybe_catch_panic
20: 0x561a3483fb2e - std::panicking::try::_$u7b$$u7b$closure$u7d$$u7d$::hdb1e99496431e590
21: 0x561a346b0035 - {{inlined-root}}::with<core::cell::Cell<usize>,closure,core::result::Result<(), Box<Any>>>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
22: 0x561a3469611d - {{inlined-root}}::try<(),std::panic::AssertUnwindSafe<closure>>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:245
23: 0x561a34694924 - {{inlined-root}}::catch_unwind<std::panic::AssertUnwindSafe<closure>,()>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:312
24: 0x561a3483f2a1 - std::thread::Builder::spawn::_$u7b$$u7b$closure$u7d$$u7d$::hf58edf765494b6e8
25: 0x561a34740689 - {{inlined-root}}::call_box<(),closure>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:587
26: 0x561a390258d2 - std::sys::thread::Thread::new::thread_start::h8f3bd45211e9f5ea
27: 0x7f2df9700453 - start_thread
28: 0x7f2df922c7de - __GI___clone
29: 0x0 - <unknown>
ERROR:servo: assertion failed: unshare(CLONE_NEWUSER | CLONE_NEWPID) == 0
assertion failed: libc::read(pipe_fds[0], &mut grandchild_pid as *mut i32 as *mut c_void,
mem::size_of::<pid_t>() as size_t) ==
(mem::size_of::<pid_t>() as ssize_t) (thread Constellation, at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:271)
stack backtrace:
0: 0x561a381159a1 - backtrace::backtrace::libunwind::trace
at /home/emilio/projects/moz/servo-2/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54
- backtrace::backtrace::trace<closure>
at /home/emilio/projects/moz/servo-2/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70
1: 0x561a38116550 - backtrace::capture::{{impl}}::new
at /home/emilio/projects/moz/servo-2/target/debug/build/backtrace-3bc1ff360ebb00cb/out/capture.rs:79
2: 0x561a343470e9 - servo::main::{{closure}}
at /home/emilio/projects/moz/servo-2/components/servo/main.rs:121
3: 0x561a39027567 - std::panicking::rust_panic_with_hook::h105c3d42fcd2fb5e
4: 0x561a38d97293 - {{inlined-root}}::begin_panic<&str>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:338
5: 0x561a38da908d - gaol::platform::linux::namespace::start
at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/namespace.rs:3
6: 0x561a38dab5f4 - gaol::platform::linux::{{impl}}::start
at /home/emilio/projects/moz/servo-2/.cargo/git/checkouts/gaol-c3a1e33941376f84/master/platform/linux/mod.rs:72
7: 0x561a37b67d6c - constellation::pipeline::{{impl}}::spawn_multiprocess
at /home/emilio/projects/moz/servo-2/components/constellation/pipeline.rs:516
8: 0x561a345548ec - {{inlined-root}}::spawn<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/pipeline.rs:253
9: 0x561a348001ad - {{inlined-root}}::new_pipeline<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:556
10: 0x561a34805671 - {{inlined-root}}::handle_init_load<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:1154
11: 0x561a3481b7c1 - {{inlined-root}}::handle_request_from_compositor<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:776
12: 0x561a348022b5 - {{inlined-root}}::handle_request<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:704
13: 0x561a3481f88a - {{inlined-root}}::run<script_layout_interface::message::Msg,layout_thread::LayoutThread,script::script_thread::ScriptThread>
at /home/emilio/projects/moz/servo-2/components/constellation/constellation.rs:522
14: 0x561a348492b6 - _<constellation..constellation..Constellation<Message, LTF, STF>>::start::_$u7b$$u7b$closure$u7d$$u7d$::h7bd448c71c8e77e7
15: 0x561a34827eca - {{inlined-root}}::call_once<(),closure>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:256
16: 0x561a3483fc20 - std::panicking::try::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hd84f6aed7b455625
17: 0x561a346961cc - {{inlined-root}}::call<closure>
at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:282
18: 0x561a3902f916 - __rust_maybe_catch_panic
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing multiprocess startup with sandboxing on Linux, then trace components/constellation/pipeline.rs:516 into gaol's platform/linux/namespace.rs, especially the unshare and pipe-read assertions shown in the backtrace. Determine the failure conditions and define completion as startup no longer aborting for the affected configuration, with a regression check if an existing test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100