Bug 1482447

Summary: ICE when compiling clang-sys inside upstream Firefox
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: rustAssignee: Josh Stone <jistone>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: ignatenko, jistone, rust-sig, TicoTimo
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Unspecified   
Whiteboard:
Fixed In Version: rust-1.20.0-2.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-20 22:53:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 1071880    

Description Dan Horák 2017-08-17 09:55:43 UTC
Description of problem:
The rust compiler crashes when compiling rust code inside Firefox

...
make[5]: Entering directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/toolkit/library/gtest/rust'
make[5]: Nothing to be done for 'target'.
make[5]: Leaving directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/toolkit/library/gtest/rust'
make[5]: Entering directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/toolkit/library/rust'
force-cargo-library-build
env   RUSTFLAGS=' -C debuginfo=2 '  CARGO_TARGET_DIR=/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/toolkit/library RUSTC=/usr/bin/rustc MOZ_SRC=/home/jenkins/workspace/Firefox/label/ppc64/firefox-src MOZ_DIST=/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/dist LIBCLANG_PATH="/usr/lib64" CLANG_PATH="/usr/bin/clang" PKG_CONFIG_ALLOW_CROSS=1 RUST_BACKTRACE=full MOZ_TOPOBJDIR=/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu MOZ_CARGO_WRAP_LDFLAGS="-lpthread -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,--build-id -Wl,-rpath-link,/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/dist/bin -Wl,-rpath-link,/usr/local/lib" MOZ_CARGO_WRAP_LD=" /usr/bin/gcc -std=gnu99" CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/build/cargo-linker /usr/bin/cargo rustc  --release --frozen --manifest-path /home/jenkins/workspace/Firefox/label/ppc64/firefox-src/toolkit/library/rust/Cargo.toml --lib --target=powerpc64-unknown-linux-gnu --features "servo bindgen quantum_render cubeb_pulse_rust no-static-ideograph-encoder-tables" -- 

   Compiling log v0.3.6
   Compiling fnv v1.0.5
   Compiling binary-space-partition v0.1.2
   Compiling term v0.4.5
   Compiling unicode-xid v0.0.4
   Compiling precomputed-hash v0.1.0
   Compiling bitflags v0.9.1
   Compiling webrender v0.48.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/gfx/webrender)
   Compiling stable_deref_trait v1.0.0
   Compiling lazy_static v0.2.2
   Compiling num-traits v0.1.37
   Compiling bitflags v0.8.2
   Compiling libc v0.2.24
   Compiling nsstring_vendor v0.1.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/servo/components/style/gecko_bindings/nsstring_vendor)
   Compiling semver-parser v0.7.0
   Compiling quote v0.3.14
   Compiling odds v0.2.25
   Compiling siphasher v0.2.1
   Compiling rayon-core v1.2.0
   Compiling smallvec v0.4.0
   Compiling regex-syntax v0.4.0
   Compiling libloading v0.4.0
   Compiling nom v1.2.4
   Compiling matches v0.1.4
   Compiling either v1.1.0
   Compiling vec_map v0.8.0
   Compiling void v1.0.2
   Compiling itoa v0.3.1
   Compiling same-file v0.1.3

   Compiling utf8-ranges v1.0.0
   Compiling futures v0.1.13
   Compiling pdqsort v0.1.2
   Compiling unicode-normalization v0.1.5
   Compiling bitflags v0.7.0
   Compiling unicode-segmentation v1.1.0
   Compiling smallvec v0.3.3
   Compiling atomic_refcell v0.1.0
   Compiling khronos_api v1.0.1
   Compiling byteorder v1.0.0
   Compiling ansi_term v0.9.0
   Compiling peeking_take_while v0.1.2
   Compiling toml v0.2.1
   Compiling rustc-serialize v0.3.22

   Compiling procedural-masquerade v0.1.1
   Compiling bit-vec v0.4.3
   Compiling pkg-config v0.3.9
   Compiling thread_profiler v0.1.1
   Compiling glob v0.2.11
   Compiling cfg-if v0.1.0

   Compiling heapsize v0.4.0
   Compiling strsim v0.6.0
   Compiling bitreader v0.3.0
   Compiling unicode-width v0.1.4
   Compiling percent-encoding v1.0.0
   Compiling scopeguard v0.3.2
   Compiling nsstring v0.1.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/xpcom/rust/nsstring)

   Compiling unreachable v0.1.1
   Compiling unicode-bidi v0.3.3
   Compiling owning_ref v0.3.3
   Compiling synom v0.11.2
   Compiling cubeb-ffi v0.0.1 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/media/libcubeb/cubeb-pulse-rs/cubeb-ffi)
   Compiling xml-rs v0.3.6
   Compiling itertools v0.5.10
   Compiling walkdir v1.0.7
   Compiling phf_shared v0.7.21

   Compiling fxhash v0.2.1
   Compiling encoding_rs v0.6.11
   Compiling gamma-lut v0.2.0
   Compiling coco v0.1.1
   Compiling num_cpus v1.2.1
   Compiling rand v0.3.15
   Compiling pulse-ffi v0.1.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/media/libcubeb/cubeb-pulse-rs/pulse-ffi)

   Compiling thread-id v3.0.0
   Compiling time v0.1.36
   Compiling freetype v0.3.0
   Compiling memchr v1.0.1
   Compiling bit-set v0.4.0
   Compiling nodrop v0.1.9
   Compiling atty v0.2.2
   Compiling term_size v0.3.0

   Compiling phf v0.7.21
   Compiling syn v0.11.11
   Compiling ordered-float v0.4.0
   Compiling num-integer v0.1.33
   Compiling mp4parse v0.8.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/media/libstagefright/binding/mp4parse)

   Compiling thread_local v0.3.3
   Compiling arrayvec v0.3.23
   Compiling arraydeque v0.2.3
   Compiling servo_arc v0.0.1 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/servo/components/servo_arc)
   Compiling cexpr v0.2.0
   Compiling aho-corasick v0.6.2

   Compiling semver v0.6.0
   Compiling clap v2.24.2

   Compiling clang-sys v0.19.0
   Compiling nserror v0.1.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/xpcom/rust/nserror)
   Compiling pulse v0.1.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/media/libcubeb/cubeb-pulse-rs/pulse-rs)

   Compiling phf_generator v0.7.21

   Compiling cubeb-pulse v0.0.1 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/media/libcubeb/cubeb-pulse-rs)
   Compiling idna v0.1.4
   Compiling parking_lot_core v0.2.1
   Compiling phf_codegen v0.7.21

   Compiling selectors v0.19.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/servo/components/selectors)

   Compiling mp4parse_capi v0.8.0 (file:///home/jenkins/workspace/Firefox/label/ppc64/firefox-src/media/libstagefright/binding/mp4parse_capi)

   Compiling parking_lot v0.4.4

note: link against the following native artifacts when linking against this static library

note: the order and any duplication can be significant on some platforms, and so may need to be preserved

note: library: util

note: library: dl

note: library: rt

note: library: pthread

note: library: gcc_s

note: library: c

note: library: m

note: library: rt

note: library: pthread

note: library: util

   Compiling rayon v0.8.1

   Compiling gl_generator v0.5.3

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'assertion failed: `(left == right)` (left: `Indirect`, right: `Direct`)', src/librustc_trans/abi.rs:444
stack backtrace:
   0:     0x3fff8328c3cf - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   1:     0x3fff8328696b - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   2:     0x3fff8329d46f - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   3:     0x3fff8329cd0f - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   4:     0x3fff8329dad3 - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   5:     0x3fff8329d937 - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   6:     0x3fff8329d80b - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
   7:     0x3fff823acc53 - rust_metadata_rustc_trans_25d9497a13d2c366f3bc42c04ab475aa
   8:     0x3fff823af0d7 - rust_metadata_rustc_trans_25d9497a13d2c366f3bc42c04ab475aa
   9:     0x3fff8241e06b - <unknown>
  10:     0x3fff823b0a7f - rust_metadata_rustc_trans_25d9497a13d2c366f3bc42c04ab475aa
  11:     0x3fff823e57b7 - <unknown>
  12:     0x3fff8241957f - <unknown>
  13:     0x3fff823bbc27 - rust_metadata_rustc_trans_25d9497a13d2c366f3bc42c04ab475aa
  14:     0x3fff834623f7 - <unknown>
  15:     0x3fff8342d5c7 - <unknown>
  16:     0x3fff8345b69f - <unknown>
  17:     0x3fff8344a363 - <unknown>
  18:     0x3fff8342a9fb - <unknown>
  19:     0x3fff8347243b - <unknown>
  20:     0x3fff8338e5f7 - <unknown>
  21:     0x3fff833900d7 - <unknown>
  22:     0x3fff832a986f - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
  23:     0x3fff833bc607 - <unknown>
  24:     0x3fff8329b98f - rust_metadata_std_d8eed34efffe0036f2d8c822e456436f
  25:     0x3fff8164bccf - <unknown>
  26:     0x3fff830e8fcf - <unknown>

error: Could not compile `clang-sys`.
Build failed, waiting for other jobs to finish...

error: build failed
make[5]: *** [/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/config/rules.mk:997: force-cargo-library-build] Error 101
make[5]: Leaving directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu/toolkit/library/rust'
make[4]: *** [/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/config/recurse.mk:73: toolkit/library/rust/target] Error 2
make[4]: Leaving directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu'
make[3]: *** [/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/config/recurse.mk:33: compile] Error 2
make[3]: Leaving directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu'
make[2]: *** [/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/config/rules.mk:453: default] Error 2
make[2]: Leaving directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/obj-powerpc64-unknown-linux-gnu'
make[1]: *** [/home/jenkins/workspace/Firefox/label/ppc64/firefox-src/client.mk:424: realbuild] Error 2
make[1]: Leaving directory '/home/jenkins/workspace/Firefox/label/ppc64/firefox-src'
make: *** [client.mk:175: build] Error 2
Build step 'Execute shell' marked build as failure
Finished: FAILURE



Version-Release number of selected component (if applicable):
rust-1.19.0-1.fc26.ppc64

How reproducible:
100%

Steps to Reproduce:
1. hg clone firefox
2. make -f client.mk MOZ_MAKE_FLAGS="-j1"

Comment 1 Josh Stone 2017-08-17 17:02:55 UTC
I've reported this ICE already from a failing test case:
https://github.com/rust-lang/rust/issues/42757

I'll try to make it a higher priority if it will block firefox soon...

Comment 2 Josh Stone 2017-08-24 18:22:15 UTC
It should be fixed in upstream rustc by this:
https://github.com/rust-lang/rust/pull/44066

If that merges soon, it will be in rust 1.21.  I can probably also backport it for 1.20 when that releases next week.

Comment 3 Fedora Update System 2017-09-12 16:58:22 UTC
cargo-0.21.1-1.fc26 rust-1.20.0-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d4dd77e88a

Comment 4 Fedora Update System 2017-09-13 06:22:14 UTC
cargo-0.21.1-1.fc26, rust-1.20.0-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d4dd77e88a

Comment 5 Fedora Update System 2017-09-20 22:53:48 UTC
cargo-0.21.1-1.fc26, rust-1.20.0-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.