rust-lang / rust-lang/rust

[ICE]: regression causes stackoverflow/SIGSEGV in test on s390x

Open
#161,742 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-ICE needs-triage T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Analysis

After #160535 we saw a regression in tests/ui/match/match-stack-overflow-72933-.rs on s390x targets. It seems that the default stack-size of 16MB is not enough for this test on s390x.

This highlights actually multiple problems:

  • the default stack size of 16MB on s390x is not enough. -> I will create a PR and set it so the test wont fail any more.
  • IMHO RUST_MIN_STACK is misleading. This variable actually fixes the stack size to at least this value but will not allow growth beyond (as there is no RUST_MAX_STACK i understood its meaning very fast).
  • increasing the stack size with ulimit -s did not help. this was surprising, but i guess it makes sense that the compiler will not take such value from the OS but rely on proven good defaults.
Links
  • #160535
  • #160275
  • rust-lang/compiler-team#1011
Code

https://github.com/rust-lang/rust/blob/26747db4f50d83f3670834410ac16fbd39c14c15/tests/ui/match/match-stack-overflow-72933-.rs#L1-L5209

Meta

rustc --version --verbose:

current HEAD

rustc 1.97.0-nightly (66da6cae1 2026-04-20)
binary: rustc
commit-hash: 66da6cae1a6f12e9585493ab8f8f19cf753091fd
commit-date: 2026-04-20
host: s390x-unknown-linux-gnu
release: 1.97.0-nightly
LLVM version: 22.1.2
Error output
Building test helpers for s390x-unknown-linux-gnu
Testing stage1 with compiletest suite=ui mode=ui (s390x-unknown-linux-gnu)

running 1 tests

[ui] tests/ui/match/match-stack-overflow-72933-.rs ... F


failures:

---- [ui] tests/ui/match/match-stack-overflow-72933-.rs stdout ----

error: test compilation failed although it shouldn't!
status: signal: 11 (SIGSEGV) (core dumped)
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/bin/rustc" "/home3/eddy/src/rust/tests/ui/match/match-stack-overflow-72933-.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore
-directory-in-diagnostics-source-blocks=/home/eddy/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home3/eddy/src/rust/vendor" "--sysroot" "/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1" "--target=s390x-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-
incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/test/ui/match/match-stack-overflow-72933-" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes
" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: rustc interrupted by SIGSEGV, printing backtrace

/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0xee4fee) [0x3ffaa3e4fee]
linux-vdso.so.1(__kernel_sigreturn+0x0) [0x3ffca6fe4d8]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x65018ee) [0x3ffafa018ee]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x651dec0) [0x3ffafa1dec0]

### cycle encountered after 4 frames with period 5
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x651db80) [0x3ffafa1db80]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x644030e) [0x3ffaf94030e]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x657775c) [0x3ffafa7775c]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x651a948) [0x3ffafa1a948]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x651de6e) [0x3ffafa1de6e]
### recursed 50 times

/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x651db80) [0x3ffafa1db80]
/home3/eddy/src/rust/build/s390x-unknown-linux-gnu/stage1/lib/librustc_driver-bf213c6416d65d01.so(+0x644030e) [0x3ffaf94030e]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=33554432
------------------------------------------

---- [ui] tests/ui/match/match-stack-overflow-72933-.rs stdout end ----

failures:
    [ui] tests/ui/match/match-stack-overflow-72933-.rs

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 22106 filtered out; finished in 1.54s

Some tests failed in compiletest suite=ui mode=ui host=s390x-unknown-linux-gnu target=s390x-unknown-linux-gnu
Build completed unsuccessfully in 0:00:02

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing tests/ui/match/match-stack-overflow-72933-.rs on the s390x target and read the linked issues #160535 and #160275 for the regression context. Inspect where the s390x compiler test stack size is configured; done means this test compiles successfully on s390x without SIGSEGV while preserving behavior on other targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.