Skip to content

coreos-installer test segfaults on s390x-unknown-linux-gnu #77382

Closed
@cuviper

Description

@cuviper

xref: https://bugzilla.redhat.com/show_bug.cgi?id=1883457

In the Fedora build of coreos-installer 0.7.0, one of the tests crashed with SIGSEGV on s390x, while it passed on every other architecture. The reporter in Red Hat bugzilla found that it happens equally with system LLVM 11 or 10. The crate's Cargo.toml also has lto = true, but they didn't see any improvement after turning that off.

The distro builds run tests in release mode (to avoid recompiling from the main build) with flags in .cargo/config:

[build]
rustc = "/usr/bin/rustc"
rustdoc = "/usr/bin/rustdoc"
rustflags = ["-Copt-level=3", "-Cdebuginfo=2", "-Clink-arg=-Wl,-z,relro,-z,now", "-Ccodegen-units=1", "--cap-lints=warn", ]

The tests pass if we don't set -Ccodegen-units=1, which suggests to me that some relevant (mis)optimization is only triggered with the full unit.

The tests are also fine with Fedora's rust-1.45.2, only crashing on rust-1.46.0. I also reproduced the crash on rustup's stable 1.46.0, and I used cargo bisect-rustc to narrow down to nightly-2020-07-05 passing, while nightly-2020-07-06 crashes. That's 0cd7ff7...2753fab, which is just #73879 (cc @ecstatic-morse). I don't know if codegen-units would affect that, or if it's just triggering something new in LLVM.

Here's the reporter's backtrace:

#0  0x000002aa0c3616c4 in core::ptr::drop_in_place () at /builddir/build/BUILD/rustc-1.46.0-src/src/libcore/ptr/mod.rs:184
#1  core::ptr::drop_in_place () at /builddir/build/BUILD/rustc-1.46.0-src/src/libcore/ptr/mod.rs:184
#2  core::ptr::drop_in_place () at /builddir/build/BUILD/rustc-1.46.0-src/src/libcore/ptr/mod.rs:184
#3  core::ptr::drop_in_place () at /builddir/build/BUILD/rustc-1.46.0-src/src/libcore/ptr/mod.rs:184
#4  core::ptr::drop_in_place () at /builddir/build/BUILD/rustc-1.46.0-src/src/libcore/ptr/mod.rs:184
#5  <libcoreinst::source::FileLocation as libcoreinst::source::ImageLocation>::sources (self=0x3ffcc3fc4f8) at src/source.rs:135
#6  libcoreinst::download::tests::test_write_image_limit () at src/download.rs:489
  1. https://github.com/coreos/coreos-installer/blob/79b59763bd17afba9ac6b13dfdfef401e2d9bde9/src/source.rs#L135
  2. https://github.com/coreos/coreos-installer/blob/79b59763bd17afba9ac6b13dfdfef401e2d9bde9/src/download.rs#L489

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-codegenArea: Code generationC-bugCategory: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-SystemZTarget: SystemZ processors (s390x)O-linuxOperating system: LinuxP-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions