RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2226795 - rust 1.71.0 fails to compile tokio tests on s390x, crashes with SIGILL
Summary: rust 1.71.0 fails to compile tokio tests on s390x, crashes with SIGILL
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: llvm
Version: 9.3
Hardware: s390x
OS: Linux
unspecified
medium
Target Milestone: rc
: 9.3
Assignee: Tom Stellard
QA Contact: Jesus Checa
URL: https://koji.fedoraproject.org/koji/t...
Whiteboard:
Depends On: 2224885 2228944
Blocks: 2226529
TreeView+ depends on / blocked
 
Reported: 2023-07-26 14:41 UTC by Tulio Magno Quites Machado Filho
Modified: 2023-11-07 09:12 UTC (History)
22 users (show)

Fixed In Version: llvm-16.0.6-3.el9
Doc Type: No Doc Update
Doc Text:
Clone Of: 2224885
Environment:
Last Closed: 2023-11-07 08:25:58 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-163549 0 None None None 2023-07-26 14:45:39 UTC
Red Hat Product Errata RHBA-2023:6360 0 None None None 2023-11-07 08:26:17 UTC

Description Tulio Magno Quites Machado Filho 2023-07-26 14:41:36 UTC
+++ This bug was initially created as a clone of Bug #2224885 +++

The package for tokio v1.29.1 failed to build during the F39 mass rebuild with Rust 1.71 on s390x only, with a consistent and reproducible crash of rustc with SIGILL that happens when compiling the "time_rt" tests:

"""
error: could not compile `tokio` (test "time_rt")
Caused by:
  process didn't exit successfully: `/usr/bin/rustc --crate-name time_rt --edition=2021 tests/time_rt.rs (... compiler flags ellipsized here) (signal: 4, SIGILL: illegal instruction)
"""

koji task: https://koji.fedoraproject.org/koji/taskinfo?taskID=103766095

Reproducible: Always

Steps to Reproduce:
1. fedpkg clone rust-tokio
2. cd rust-tokio
3. fedpkg build --scratch
Actual Results:  
Rust compiler crashes on s390x.

Expected Results:  
Package builds successfully on all architectures.

The initial build of tokio v1.29.1 for rawhide was successful (two weeks before this failed build) with Rust 1.70.0:
https://koji.fedoraproject.org/koji/buildinfo?buildID=2229054

--- Additional comment from Josh Stone on 2023-07-24 21:45:36 UTC ---

I can reproduce this with rust-1.71.0-1.fc39, rust-1.70.0-1.fc39, and rust-1.69.0-3.fc39, but rust-1.69.0-2.fc39 passes. The big difference there is that -2 used LLVM 15, so it seems that all LLVM 16 builds have a problem.

GDB doesn't make much sense of it:

Thread 6 "opt time_rt.92c" received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x3ffd83218c0 (LWP 17420)]
0x000003ffe8dbb728 in ?? () from /lib64/libLLVM-16.so
(gdb) bt
#0  0x000003ffe8dbb728 in ?? () from /lib64/libLLVM-16.so
#1  0x000003ffeb37750c in computeKnownBits (V=0x3ffe0bc35b8, DemandedElts=..., Known=..., Depth=<optimized out>, Q=...) at /usr/src/debug/llvm-16.0.6-4.fc39.s390x/lib/Analysis/ValueTracking.cpp:2046
#2  0x0000000000000050 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

--- Additional comment from Josh Stone on 2023-07-24 23:02:54 UTC ---

I can also reproduce a crash with upstream Rust builds, and the upstream tokio git. It compiles with 1.69.0 (bundled llvm 15.0.7) and crashes with 1.70.0 (bundled llvm 16.0.2), but this time with SIGFPE.

https://github.com/tokio-rs/tokio/tree/a58beb3aca18e6ec4cb444b6c78d5a3373742998/tokio

$ RUSTFLAGS=-Ccodegen-units=1 cargo +1.70.0 build --release --test time_rt --all-features
...
error: could not compile `tokio` (test "time_rt")

Caused by:
  process didn't exit successfully: `rustc --crate-name time_rt --edition=2021 tokio/tests/time_rt.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=251 --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --test --cfg 'feature="bytes"' --cfg 'feature="default"' --cfg 'feature="fs"' --cfg 'feature="full"' --cfg 'feature="io-std"' --cfg 'feature="io-util"' --cfg 'feature="libc"' --cfg 'feature="macros"' --cfg 'feature="mio"' --cfg 'feature="net"' --cfg 'feature="num_cpus"' --cfg 'feature="parking_lot"' --cfg 'feature="process"' --cfg 'feature="rt"' --cfg 'feature="rt-multi-thread"' --cfg 'feature="signal"' --cfg 'feature="signal-hook-registry"' --cfg 'feature="socket2"' --cfg 'feature="stats"' --cfg 'feature="sync"' --cfg 'feature="test-util"' --cfg 'feature="time"' --cfg 'feature="tokio-macros"' --cfg 'feature="tracing"' --cfg 'feature="windows-sys"' -C metadata=51c6600cbd7ec5c9 -C extra-filename=-51c6600cbd7ec5c9 --out-dir /root/tokio/target/release/deps -L dependency=/root/tokio/target/release/deps --extern async_stream=/root/tokio/target/release/deps/libasync_stream-0e1b47935e32e7db.rlib --extern bytes=/root/tokio/target/release/deps/libbytes-3bb1190b0cd2f392.rlib --extern futures=/root/tokio/target/release/deps/libfutures-aad19d8da72d3480.rlib --extern libc=/root/tokio/target/release/deps/liblibc-c0d20eccffc30c7c.rlib --extern mio=/root/tokio/target/release/deps/libmio-6e8b7fbee28df1d4.rlib --extern mockall=/root/tokio/target/release/deps/libmockall-ec54ec4ddca53892.rlib --extern nix=/root/tokio/target/release/deps/libnix-feb01785fb6919ee.rlib --extern num_cpus=/root/tokio/target/release/deps/libnum_cpus-ba7c2eeb3593e7d6.rlib --extern parking_lot=/root/tokio/target/release/deps/libparking_lot-4cfc0e3490b8ec10.rlib --extern pin_project_lite=/root/tokio/target/release/deps/libpin_project_lite-b655cdd536450e96.rlib --extern rand=/root/tokio/target/release/deps/librand-4a990bec2965395e.rlib --extern signal_hook_registry=/root/tokio/target/release/deps/libsignal_hook_registry-2bd0f6f22d781c8e.rlib --extern socket2=/root/tokio/target/release/deps/libsocket2-66a65b247261e899.rlib --extern tempfile=/root/tokio/target/release/deps/libtempfile-2ea631b395d5a10d.rlib --extern tokio=/root/tokio/target/release/deps/libtokio-a0091aabb9e0907e.rlib --extern tokio_macros=/root/tokio/target/release/deps/libtokio_macros-5709263f84331fbd.so --extern tokio_stream=/root/tokio/target/release/deps/libtokio_stream-e78a6ae35cbe7a71.rlib --extern tokio_test=/root/tokio/target/release/deps/libtokio_test-3627ae0030cdfd35.rlib -Ccodegen-units=1` (signal: 8, SIGFPE: erroneous arithmetic operation)


#0  0x000003ffeec97152 in llvm::MVT::getVT(llvm::Type*, bool) [clone .localalias.70] () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so                                                [0/1855]
#1  0x000003ffeec97d7e in llvm::EVT::getEVT(llvm::Type*, bool) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#2  0x000003ffedb25472 in llvm::TargetLoweringBase::getValueType(llvm::DataLayout const&, llvm::Type*, bool) const () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#3  0x000003ffedbf2c10 in llvm::SystemZTTIImpl::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&, llvm::OptimizationRemarkEmitter*) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#4  0x000003ffedbe64b6 in llvm::TargetTransformInfo::Model<llvm::SystemZTTIImpl>::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&, llvm::OptimizationRemarkEmitter*) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#5  0x000003ffef677b90 in llvm::TargetTransformInfo::getUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo::UnrollingPreferences&, llvm::OptimizationRemarkEmitter*) const ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#6  0x000003ffeeeb11fa in llvm::gatherUnrollingPreferences(llvm::Loop*, llvm::ScalarEvolution&, llvm::TargetTransformInfo const&, llvm::BlockFrequencyInfo*, llvm::ProfileSummaryInfo*, llvm::OptimizationRemarkEmitter&, int, std::optional<unsigned int>, std::optional<unsigned int>, std::optional<bool>, std::optional<bool>, std::optional<bool>, std::optional<unsigned int>) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#7  0x000003ffeeeb7088 in tryToUnrollLoop(llvm::Loop*, llvm::DominatorTree&, llvm::LoopInfo*, llvm::ScalarEvolution&, llvm::TargetTransformInfo const&, llvm::AssumptionCache&, llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*, llvm::ProfileSummaryInfo*, bool, int, bool, bool, std::optional<unsigned int>, std::optional<unsigned int>, std::optional<bool>, std::optional<bool>, std::optional<bool>, std::optional<bool>, std::optional<bool>, std::optional<unsigned int>) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#8  0x000003ffeeeb835a in llvm::LoopFullUnrollPass::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#9  0x000003ffede25f0e in llvm::detail::PassModel<llvm::Loop, llvm::LoopFullUnrollPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#10 0x000003ffeee632bc in llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::runWithoutLoopNestPasses(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#11 0x000003ffeee61d80 in llvm::PassManager<llvm::Loop, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&>::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#12 0x000003ffeee65110 in llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#13 0x000003ffede23ea2 in llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#14 0x000003ffedd2bbe4 in llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#15 0x000003ffef3ea0b8 in llvm::CGSCCToFunctionPassAdaptor::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#16 0x000003ffede23e76 in llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::CGSCCToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#17 0x000003ffef3e35a0 in llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#18 0x000003ffede23e06 in llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::PassManager<llvm::LazyCallGraph::SCC, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCall
Graph&, llvm::CGSCCUpdateResult&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#19 0x000003ffef3e6c28 in llvm::DevirtSCCRepeatedPass::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#20 0x000003ffede23e3e in llvm::detail::PassModel<llvm::LazyCallGraph::SCC, llvm::DevirtSCCRepeatedPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&>::run(llvm::LazyCallGraph::SCC&, llvm::AnalysisManager<llvm::LazyCallGraph::SCC, llvm::LazyCallGraph&>&, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#21 0x000003ffef3e5094 in llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#22 0x000003ffede23dca in llvm::detail::PassModel<llvm::Module, llvm::ModuleToPostOrderCGSCCPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#23 0x000003ffefa788f2 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#24 0x000003ffee2035d2 in llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#25 0x000003ffede236aa in llvm::detail::PassModel<llvm::Module, llvm::ModuleInlinerWrapperPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#26 0x000003ffefa788f2 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) ()
   from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#27 0x000003ffedad98ae in LLVMRustOptimize () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so
#28 0x000003ffedab7460 in rustc_codegen_llvm[9e81a53351863c9d]::back::write::llvm_optimize () from /root/.rustup/toolchains/1.70.0-s390x-unknown-linux-gnu/bin/../lib/librustc_driver-b1d432d6f4de30ea.so

--- Additional comment from Josh Stone on 2023-07-25 00:13:22 UTC ---

Crashes "opt -disable-output -O3", both on a native s390x host and cross from x86_64. It does not crash with -O2.

--- Additional comment from Tulio Magno Quites Machado Filho on 2023-07-25 20:36:42 UTC ---

Interestingly, I can reproduce this issue only on rawhide.
It works well on F38.

--- Additional comment from Tulio Magno Quites Machado Filho on 2023-07-26 13:00:58 UTC ---

As my previous comment implies: this bug doesn't seem to affect LLVM 16.0 upstream.
I was able to bisect the issue started with llvm-16.0.6-4 on Rawhide.

I was able to reproduce this issue with llvm-16.0.6-1.el9.s390x on CentOS Stream 9 development.

Comment 1 Tulio Magno Quites Machado Filho 2023-08-03 17:30:15 UTC
A merge has been created at https://gitlab.com/redhat/centos-stream/rpms/llvm/-/merge_requests/49

Comment 7 errata-xmlrpc 2023-11-07 08:25:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (python-lit, lldb, lld, libomp, compiler-rt, clang, and llvm update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6360


Note You need to log in before you can comment on or make changes to this bug.