No Stylo on i386

Jan Beich jbeich at FreeBSD.org
Wed Sep 27 10:08:49 UTC 2017


Firefox 57 plans to enable by default Rust-based CSS system[1]. It uses
rust-bindgen during build which works fine on amd64 but seems to crash
Cargo on i386.

FF56 Stylo had issues[2] on Linux i386 but those appear unrelated to
FreeBSD i386. OpenBSD i386 seems[3] to hit 32bit memory limit instead.

Can someone help? I don't know how to debug Rust apps.

  $ cd /usr/ports/www/firefox
  $ rm files/patch-bug1401093
  $ make
  <build-script-build dies with SIGSEGV>
  $ cd $(make -V MOZ_OBJDIR)/toolkit/library/rust/
  $ gmake
  [...]
  (gdb) r
  Starting program: /usr/local/bin/cargo build --jobs 1 --release --frozen --manifest-path /wrkdirs/usr/ports/www/firefox/work/firefox-56.0/toolkit/library/rust/Cargo.toml --lib --target=i686-unknown-freebsd --features servo\ bindgen\ cubeb_pulse_rust\ simd-accel\ no-static-ideograph-encoder-tables
     Compiling style v0.0.1 (file:///wrkdirs/usr/ports/www/firefox/work/firefox-56.0/servo/components/style)
  [New LWP 101736 of process 5718]
  [New LWP 101733 of process 5718]

  Thread 3 received signal SIGUSR1, User defined signal 1.
  [Switching to LWP 101733 of process 5718]
  _read () at _read.S:3
  3       PSEUDO(read)

  (gdb) info registers
  eax            0x4      4
  ecx            0xfbffcd97       -67121769
  edx            0x1      1
  ebx            0x2194e460       563405920
  esp            0xfbffcd04       0xfbffcd04
  ebp            0xfbffcd34       0xfbffcd34
  esi            0x5      5
  edi            0x1      1
  eip            0x21c258a7       0x21c258a7 <_read+7>
  eflags         0x287    [ CF PF SF IF ]
  cs             0x33     51
  ss             0x3b     59
  ds             0x3b     59
  es             0x3b     59
  fs             0x13     19
  gs             0x1b     27

  (gdb) thread apply all backtrace

  Thread 3 (LWP 101733 of process 5718):
  #0  _read () at _read.S:3
  #1  0x2193388d in __thr_read (fd=5, buf=0xfbffcd97, nbytes=1)
      at /usr/src/lib/libthr/thread/thr_syscalls.c:400
  #2  0x21a3ed15 in read (fd=5, buf=0xfbffcd97, nbytes=1) at /usr/src/lib/libc/sys/read.c:48
  #3  0x0149e912 in <&'a std::fs::File as std::io::Read>::read ()
  #4  0x0148fd56 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
  #5  0x0149051a in std::panicking::try::do_call ()
  #6  0x014bf218 in __rust_maybe_catch_panic ()
  #7  0x014932fc in <F as alloc::boxed::FnBox<A>>::call_box ()
  #8  0x014b0789 in std::sys::imp::thread::Thread::new::thread_start ()
  #9  0x2192e3ce in thread_start (curthread=0x232bb280) at /usr/src/lib/libthr/thread/thr_create.c:288
  #10 0x00000000 in ?? ()

  Thread 1 (LWP 101848 of process 5718):
  #0  0x2193ae89 in __pthread_mutex_lock (mutex=0x2261d008)
      at /usr/src/lib/libthr/thread/thr_mutex.c:444
  #1  0x0149af59 in std::thread::park_timeout ()
  #2  0x014a6b68 in std::sync::mpsc::blocking::WaitToken::wait_max_until ()
  #3  0x014934e3 in <std::sync::mpsc::oneshot::Packet<T>>::recv ()
  #4  0x01495225 in <jobserver::HelperThread as core::ops::Drop>::drop ()
  #5  0x0110c167 in core::ptr::drop_in_place ()
  #6  0x01241682 in cargo::ops::cargo_rustc::compile_targets ()
  #7  0x011d18b6 in cargo::ops::cargo_compile::compile_ws ()
  #8  0x011cf6ef in cargo::ops::cargo_compile::compile_with_exec ()
  #9  0x011cf555 in cargo::ops::cargo_compile::compile ()
  #10 0x0104f7e6 in cargo::try_execute_builtin_command ()
  #11 0x01046eb0 in cargo::execute ()
  #12 0x01039d10 in cargo::call_main_without_stdin ()
  #13 0x01045c06 in cargo::main ()
  #14 0x014a986f in std::sys_common::backtrace::__rust_begin_short_backtrace ()
  #15 0x014bf218 in __rust_maybe_catch_panic ()
  #16 0x014b1d8c in std::rt::lang_start ()
  #17 0x010b6fd1 in main ()

or

  $ pkg install python27
  $ hash git 2>/dev/null || pkg install mercurial
  $ hg clone https://hg.mozilla.org/mozilla-unified firefox ||
    git clone https://github.com/mozilla/gecko-dev firefox
  $ cd firefox
  $ git checkout origin/master || hg up central
  $ echo "ac_add_options --disable-debug-symbols" >>.mozconfig
  $ echo "export CC=clang40 CXX=clang++40 CPP=clang-cpp40" >>.mozconfig
  $ ./mach bootstrap # select Firefox for Desktop
  $ ./mach build
  <build-script-build dies with SIGSEGV>
  $ cd obj*/toolkit/library/rust/
  $ gmake
  [...]
  (gdb) r
  Starting program: /usr/local/bin/cargo rustc --jobs 1 --release --frozen --manifest-path /tmp/mozilla-central/toolkit/library/rust/Cargo.toml --lib --target=i686-unknown-freebsd --features servo\ bindgen\ quantum_render\ cubeb_pulse_rust\ no-static-ideograph-encoder-tables --
     Compiling style v0.0.1 (file:///tmp/mozilla-central/servo/components/style)
  [New LWP 100896 of process 20895]
  [New LWP 100815 of process 20895]

  Thread 3 received signal SIGUSR1, User defined signal 1.
  [Switching to LWP 100815 of process 20895]
  _read () at _read.S:3
  3       PSEUDO(read)

  (gdb) info registers
  eax            0x4      4
  ecx            0xfbffcd97       -67121769
  edx            0x1      1
  ebx            0x2194e460       563405920
  esp            0xfbffcd04       0xfbffcd04
  ebp            0xfbffcd34       0xfbffcd34
  esi            0x5      5
  edi            0x1      1
  eip            0x21c258a7       0x21c258a7 <_read+7>
  eflags         0x287    [ CF PF SF IF ]
  cs             0x33     51
  ss             0x3b     59
  ds             0x3b     59
  es             0x3b     59
  fs             0x13     19
  gs             0x1b     27

  (gdb) thread apply all backtrace

  Thread 3 (LWP 100815 of process 20895):
  #0  _read () at _read.S:3
  #1  0x2193388d in __thr_read (fd=5, buf=0xfbffcd97, nbytes=1)
      at /usr/src/lib/libthr/thread/thr_syscalls.c:400
  #2  0x21a3ed15 in read (fd=5, buf=0xfbffcd97, nbytes=1) at /usr/src/lib/libc/sys/read.c:48
  #3  0x0149e912 in <&'a std::fs::File as std::io::Read>::read ()
  #4  0x0148fd56 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
  #5  0x0149051a in std::panicking::try::do_call ()
  #6  0x014bf218 in __rust_maybe_catch_panic ()
  #7  0x014932fc in <F as alloc::boxed::FnBox<A>>::call_box ()
  #8  0x014b0789 in std::sys::imp::thread::Thread::new::thread_start ()
  #9  0x2192e3ce in thread_start (curthread=0x22d93100) at /usr/src/lib/libthr/thread/thr_create.c:288
  #10 0x00000000 in ?? ()

  Thread 1 (LWP 102123 of process 20895):
  #0  0x2165931f in symlook_init_from_req (dst=0xfffdf338, src=0xfffdf3a8)
      at /usr/src/libexec/rtld-elf/rtld.c:4902
  #1  0x21656161 in symlook_default (req=0xfffdf3a8, refobj=0x2167b000)
      at /usr/src/libexec/rtld-elf/rtld.c:3720
  #2  0x21655b6f in find_symdef (symnum=161, refobj=0x2167b000, defobj_out=0xfffdf478, flags=1,
      cache=0x0, lockstate=0xfffdf438) at /usr/src/libexec/rtld-elf/rtld.c:1577
  #3  0x21655902 in _rtld_bind (obj=0x2167b000, reloff=472) at /usr/src/libexec/rtld-elf/rtld.c:706
  #4  0x21651059 in _rtld_bind_start () at /usr/src/libexec/rtld-elf/i386/rtld_start.S:81
  #5  0x2167b000 in ?? ()
  #6  0x0149afec in std::thread::park_timeout ()
  #7  0x014a6b68 in std::sync::mpsc::blocking::WaitToken::wait_max_until ()
  #8  0x014934e3 in <std::sync::mpsc::oneshot::Packet<T>>::recv ()
  #9  0x01495225 in <jobserver::HelperThread as core::ops::Drop>::drop ()
  #10 0x0110c167 in core::ptr::drop_in_place ()
  #11 0x01241682 in cargo::ops::cargo_rustc::compile_targets ()
  #12 0x011d18b6 in cargo::ops::cargo_compile::compile_ws ()
  #13 0x011cf6ef in cargo::ops::cargo_compile::compile_with_exec ()
  #14 0x011cf555 in cargo::ops::cargo_compile::compile ()
  #15 0x0106d966 in cargo::try_execute_builtin_command ()
  #16 0x01046eb0 in cargo::execute ()
  #17 0x01039d10 in cargo::call_main_without_stdin ()
  #18 0x01045c06 in cargo::main ()
  #19 0x014a986f in std::sys_common::backtrace::__rust_begin_short_backtrace ()
  #20 0x014bf218 in __rust_maybe_catch_panic ()
  #21 0x014b1d8c in std::rt::lang_start ()
  #22 0x010b6fd1 in main ()

--
[1] https://wiki.mozilla.org/Quantum#Quantum_CSS
    Stylo in about:support, layout.css.servo.enabled in about:config
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1366050 (see Depends On)
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1401093


More information about the freebsd-gecko mailing list