Skip to content

LLVM recursion stack overflow when buildin fresh #150691

@madonuko

Description

@madonuko

If you are very energetic and wants to do something very challenging, well here comes a very difficult-to-repro issue:

https://gist.github.com/madonuko/8cb7959b33f9f31e8221f23d5e2a95a9

I know rust, but I didn't write the code, I just tried to package this into terrapkg/packages#8917.

rpmbuild │ error: rustc interrupted by SIGSEGV, printing backtrace
rpmbuild │ 
rpmbuild │ /lib64/librustc_driver-c19429d635bbd64e.so(+0x75afef) [0x7fd74f5c3fef]
rpmbuild │ /lib64/libc.so.6(+0x19f90) [0x7fd74ec8ff90]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a5e55) [0x7fd74a9a5e55]
rpmbuild │ 
rpmbuild │ ### cycle encountered after 3 frames with period 4
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7fd74a9a60d4]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7fd74a9a60d4]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7fd74a9a60d4]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7fd74a9a60d4]
rpmbuild │ ### recursed 63 times
rpmbuild │ 
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7fd74a9a60d4]
rpmbuild │ 
rpmbuild │ note: rustc unexpectedly overflowed its stack! this is a bug
rpmbuild │ note: maximum backtrace depth reached, frames may have been lost
rpmbuild │ note: we would appreciate a report at https://github.com/rust-lang/rust
rpmbuild │ help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
rpmbuild │ sccache: Compiler killed by signal 11
rpmbuild │ warning: [email protected]: Generated locale options with 12 locales
rpmbuild │ warning: [email protected]: Generated plugins/lib/fresh.d.ts with 103 ops and 21 interfaces
rpmbuild │ error: could not compile `fresh-editor` (lib)
rpmbuild │ 
rpmbuild │ Caused by:
rpmbuild │   process didn't exit successfully: `sccache /usr/bin/rustc --crate-name fresh --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 -C split-debuginfo=packed --cfg 'feature="default"' --cfg 'feature="embed-plugins"' --cfg 'feature="plugins"' --cfg 'feature="runtime"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("default", "dev-bins", "embed-plugins", "plugins", "runtime", "schema-only"))' -C metadata=3fed27ae5032d961 -C extra-filename=-25b9882c2da4b565 --out-dir /root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps -L dependency=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps --extern alacritty_terminal=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libalacritty_terminal-25b4782d25f019f1.rmeta --extern anyhow=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libanyhow-fc28200dd619b1a0.rmeta --extern arboard=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libarboard-e7b0c9d0742278e5.rmeta --extern async_trait=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libasync_trait-ee030a5354d34fec.so --extern chrono=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libchrono-e98223259a0b6c0a.rmeta --extern clap=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libclap-7d19fc781a035366.rmeta --extern crossterm=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libcrossterm-b23ae4fbf74367a0.rmeta --extern deno_ast=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libdeno_ast-74f62be517fa0a7a.rmeta --extern deno_core=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libdeno_core-c7a9e939e273e389.rmeta --extern deno_error=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libdeno_error-bc50f4569bf089c5.rmeta --extern dirs=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libdirs-f7d3d1621a815573.rmeta --extern ignore=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libignore-9f7eb26b5a11aa6e.rmeta --extern include_dir=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libinclude_dir-8f1dcb78fb120048.rmeta --extern libc=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/liblibc-0ff57ed2289b9b14.rmeta --extern libloading=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/liblibloading-f967c18aa754b10b.rmeta --extern lru=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/liblru-50e421b529f698e1.rmeta --extern lsp_types=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/liblsp_types-472ab56b0660d6ba.rmeta --extern nix=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libnix-e8e06d268004f03b.rmeta --extern once_cell=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libonce_cell-3baeb423f1cff178.rmeta --extern portable_pty=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libportable_pty-a28090ff13c7c6bb.rmeta --extern pulldown_cmark=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libpulldown_cmark-77361b4d79d1f20e.rmeta --extern ratatui=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libratatui-0f49aeddaf0bd900.rmeta --extern regex=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libregex-e169ad73ba8109b9.rmeta --extern rust_i18n=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/librust_i18n-16b218b72499cbc4.rmeta --extern schemars=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libschemars-f469a3eadbd91a16.rmeta --extern serde=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libserde-cdb8b972371602b8.rmeta --extern serde_json=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libserde_json-96783494a5888979.rmeta --extern sha2=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libsha2-d6c7622757ca7769.rmeta --extern syntect=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libsyntect-17bddcfbd248091d.rmeta --extern tempfile=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtempfile-ac6d14c62747d1b4.rmeta --extern tokio=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtokio-6845fd1b1469c928.rmeta --extern tracing=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtracing-fcfaad432a349d95.rmeta --extern tracing_subscriber=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtracing_subscriber-28dc4dd42ede4178.rmeta --extern trash=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtrash-e2cfcc970c5bb1bf.rmeta --extern tree_sitter=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter-87a5a856cfdddf82.rmeta --extern tree_sitter_bash=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_bash-6dc6da67099ab5b6.rmeta --extern tree_sitter_c=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_c-a6886e0c18252258.rmeta --extern tree_sitter_c_sharp=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_c_sharp-3fc8fabd8967cec1.rmeta --extern tree_sitter_cpp=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_cpp-0f1e88494233a51b.rmeta --extern tree_sitter_css=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_css-4fc8090d43921eac.rmeta --extern tree_sitter_go=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_go-0042f91bb118c490.rmeta --extern tree_sitter_highlight=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_highlight-ed2ff504bd2b62b7.rlib --extern tree_sitter_html=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_html-7e436c84a2159b5a.rmeta --extern tree_sitter_java=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_java-4b2ef41c43659fa0.rmeta --extern tree_sitter_javascript=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_javascript-782861e6c85517c0.rmeta --extern tree_sitter_json=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_json-c86724fbdb2c0bf4.rmeta --extern tree_sitter_lua=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_lua-04a37a6d092c859f.rmeta --extern tree_sitter_pascal=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_pascal-4f023e0334f911cb.rmeta --extern tree_sitter_php=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_php-f2c2695a912abd68.rmeta --extern tree_sitter_python=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_python-011ba246765436d2.rmeta --extern tree_sitter_ruby=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_ruby-5ed93ed443fc7a03.rmeta --extern tree_sitter_rust=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_rust-18012059d63a3c37.rmeta --extern tree_sitter_typescript=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libtree_sitter_typescript-e3e51f8f0db8ab82.rmeta --extern unicode_segmentation=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libunicode_segmentation-c39e81cb76dbf5f7.rmeta --extern unicode_width=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libunicode_width-2d3cb584ad27d583.rmeta --extern ureq=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/libureq-d92edfce76f063a8.rmeta --extern url=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/deps/liburl-974fd041defa123b.rmeta -Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn -C link-arg=-fuse-ld=mold -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/psm-0aca3e5615d4fab2/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/onig_sys-2269754da89e3ebd/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-194ad682058d723c/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-bash-daf98d35db8e1b1b/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-c-7b701f1cc2964ef5/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-c-sharp-15f02f6d4e4dee04/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-cpp-27e5738335cd46aa/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-css-f25e7c00fdf34d30/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-go-7e78fdf2138c635d/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-html-b7eebe0387fa8b96/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-java-8ee81d38e4e4c493/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-javascript-eeb8abc310331390/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-json-571f132699736d64/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-lua-66c01eab98cf9e63/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-pascal-06e5f70d5761dd1d/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-php-a1f13293db5acf40/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-python-8019467f1722427f/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-ruby-8520c05cff82d31c/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-rust-bb65ffdf5a7afc80/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/build/tree-sitter-typescript-3d9ae403f3b23e4d/out -L native=/root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpmbuild │ ing-b472b3c39cad7629/out -L /root/rpmbuild/BUILD/fresh-0.1.70-build/fresh-0.1.70/target/rpm/gn_out/obj` (exit status: 254)

Meta

rustc --version --verbose:

rustc 1.92.0 (ded5c06cf 2025-12-08) (Fedora 1.92.0-1.fc44)
binary: rustc
commit-hash: ded5c06cf21d2b93bffd5d884aa6e96934ee4234
commit-date: 2025-12-08
host: x86_64-unknown-linux-gnu
release: 1.92.0
LLVM version: 21.1.7
Backtrace

rpmbuild │ sccache: warning: The server looks like it shut down unexpectedly, compiling locally instead
rpmbuild │ error: rustc interrupted by SIGSEGV, printing backtrace
rpmbuild │ 
rpmbuild │ /lib64/librustc_driver-c19429d635bbd64e.so(+0x75afef) [0x7f07072fafef]
rpmbuild │ /lib64/libc.so.6(+0x19f90) [0x7f07069c6f90]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a5e55) [0x7f07026dce55]
rpmbuild │ 
rpmbuild │ ### cycle encountered after 3 frames with period 4
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7f07026dd0d4]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7f07026dd0d4]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7f07026dd0d4]
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7f07026dd0d4]
rpmbuild │ ### recursed 63 times
rpmbuild │ 
rpmbuild │ /lib64/libLLVM.so.21.1(+0x46a60d4) [0x7f07026dd0d4]
rpmbuild │ 
rpmbuild │ note: rustc unexpectedly overflowed its stack! this is a bug
rpmbuild │ note: maximum backtrace depth reached, frames may have been lost
rpmbuild │ note: we would appreciate a report at https://github.com/rust-lang/rust
rpmbuild │ help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions