servo/rust-cssparser

cssparser fails to compile on armv7hl

igor-raits opened this issue · 4 comments

BUILDSTDERR:    Compiling cssparser-macros v0.3.5
BUILDSTDERR:      Running `/usr/bin/rustc --crate-name build_script_build build.rs --color never --crate-type bin --emit=dep-info,link -C opt-level=3 -C metadata=4bd9c9d35bb2feea -C extra-filename=-4bd9c9d35bb2feea --out-dir /builddir/build/BUILD/cssparser-0.25.2/target/release/build/cssparser-4bd9c9d35bb2feea -L dependency=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps --extern proc_macro2=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libproc_macro2-fb9fbf266a2c18b9.rlib --extern quote=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libquote-91abe56d76f8728a.rlib --extern syn=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libsyn-a49a74fa2d529dea.rlib -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
BUILDSTDERR:      Running `/usr/bin/rustc --crate-name cssparser_macros /usr/share/cargo/registry/cssparser-macros-0.3.5/lib.rs --color never --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C metadata=91ec3e2d0fb1fbff -C extra-filename=-91ec3e2d0fb1fbff --out-dir /builddir/build/BUILD/cssparser-0.25.2/target/release/deps -L dependency=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps --extern phf_codegen=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libphf_codegen-c9f9e6874c810688.rlib --extern proc_macro2=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libproc_macro2-fb9fbf266a2c18b9.rlib --extern procedural_masquerade=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libprocedural_masquerade-60a396ef71adadaa.rlib --extern quote=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libquote-91abe56d76f8728a.rlib --extern syn=/builddir/build/BUILD/cssparser-0.25.2/target/release/deps/libsyn-a49a74fa2d529dea.rlib --cap-lints allow -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
BUILDSTDERR:      Running `/builddir/build/BUILD/cssparser-0.25.2/target/release/build/cssparser-4bd9c9d35bb2feea/build-script-build`
BUILDSTDERR: error: failed to run custom build command for `cssparser v0.25.2 (/builddir/build/BUILD/cssparser-0.25.2)`
BUILDSTDERR: process didn't exit successfully: `/builddir/build/BUILD/cssparser-0.25.2/target/release/build/cssparser-4bd9c9d35bb2feea/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
BUILDSTDERR: --- stdout
BUILDSTDERR: cargo:rustc-cfg=rustc_has_pr45225
BUILDSTDERR: cargo:rerun-if-changed=/builddir/build/BUILD/cssparser-0.25.2/src/tokenizer.rs

I'm not sure if there is a bug in compiler or in cssparser. Please help ;)

What does gdb say about the stack trace? :)

Can you repro this cross-compiling or something? Though I suspect this is a compiler bug.

That's hard... I just tried to run valgrind and gdb in chroot and both failed:

<mock-chroot> sh-4.4# valgrind cargo build -j8
==19== Memcheck, a memory error detector
==19== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==19== Command: cargo build -j8
==19==
==19== Invalid write of size 4
==19==    at 0x4000A80: ??? (in /usr/lib/ld-2.29.so)
==19==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==19==
==19==
==19== Process terminating with default action of signal 11 (SIGSEGV)
==19==  Access not within mapped region at address 0x0
==19==    at 0x4000A80: ??? (in /usr/lib/ld-2.29.so)
==19==  If you believe this happened as a result of a stack
==19==  overflow in your program's main thread (unlikely but
==19==  possible), you can try to increase the size of the
==19==  main thread stack using the --main-stacksize= flag.
==19==  The main thread stack size used in this run was 8388608.
==19==
==19== HEAP SUMMARY:
==19==     in use at exit: 0 bytes in 0 blocks
==19==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==19==
==19== All heap blocks were freed -- no leaks are possible
==19==
==19== For counts of detected and suppressed errors, rerun with: -v
==19== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
<mock-chroot> sh-4.4# gdb --args cargo build
GNU gdb (GDB) Fedora 8.2.50.20190120-15.fc30
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "armv7hl-redhat-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from cargo...
(No debugging symbols found in cargo)
Missing separate debuginfos, use: dnf debuginfo-install cargo-1.32.0-2.fc30.armv7hl
(gdb) r
Starting program: /usr/bin/cargo build
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0xb6cc5688 in ?? () from /lib/libcrypto.so.1.1
(gdb) bt
#0  0xb6cc5688 in ?? () from /lib/libcrypto.so.1.1
#1  0xb6cbf258 in ?? () from /lib/libcrypto.so.1.1
#2  0xb6fde188 in call_init.part () from /lib/ld-linux-armhf.so.3
#3  0xb6fde298 in _dl_init () from /lib/ld-linux-armhf.so.3
#4  0xb6fceac4 in _dl_start_user () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I think I got it a bit..

(gdb) bt full
#0  0xb6f81af0 in __pthread_timedjoin_ex () from /lib/libpthread.so.0
No symbol table info available.
#1  0x005edeac in std::sys::unix::thread::Thread::join ()
No symbol table info available.
#2  0x004af7b4 in <std::thread::JoinInner<T>>::join (self=0xbefff398) at /builddir/build/BUILD/rustc-1.32.0-src/src/libstd/thread/mod.rs:1298
No locals.
#3  <std::thread::JoinHandle<T>>::join (self=...) at /builddir/build/BUILD/rustc-1.32.0-src/src/libstd/thread/mod.rs:1431
No locals.
#4  0x00491e40 in build_script_build::codegen::main () at build.rs:40
        handle = <optimized out>
        output = <optimized out>
        input = <optimized out>
        manifest_dir = <optimized out>
#5  0x0040f790 in std::rt::lang_start::{{closure}} () at /builddir/build/BUILD/rustc-1.32.0-src/src/libstd/rt.rs:74
        main = <optimized out>
#6  0x005fc270 in std::panicking::try::do_call ()
No symbol table info available.
#7  0x006051d0 in __rust_maybe_catch_panic ()
No symbol table info available.
#8  0x005fb808 in std::panic::catch_unwind ()
No symbol table info available.
#9  0x005ee45c in std::rt::lang_start_internal ()
No symbol table info available.
#10 0x00429edc in main ()
No symbol table info available.
#11 0xb6e1587c in __libc_start_main () from /lib/libc.so.6
No symbol table info available.
#12 0x00405034 in _start ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)