Repository: rust
Issue: ICE: rustc interrupted by SIGSEGV while compiling in release mode
Labels: I-crash,A-LLVM,T-compiler,C-bug

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->
### Code

Repository:
https://github.com/astraly-labs/madara

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->
`rustc --version --verbose`:
```
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7
```

### Error output

When doing;
```bash
cargo run --release -- --devnet --chain-config-path ./configs/presets/devnet.yaml
```

```
error: rustc interrupted by SIGSEGV, printing backtrace
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(+0x32b0323)[0x7f87470b0323]
/lib/x86_64-linux-gnu/libc.so.6(+0x3f590)[0x7f8743c55590]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.81.0-stable(+0x5e74ff4)[0x7f8742074ff4]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.81.0-stable(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0xad5)[0x7f8741f0ed15]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.81.0-stable(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x2f)[0x7f8741f0e185]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.81.0-stable(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x260)[0x7f87424b0ea0]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(LLVMRustWriteOutputFile+0x190)[0x7f87492624d0]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(+0x54620df)[0x7f87492620df]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(+0x545f5f0)[0x7f874925f5f0]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(+0x545f25e)[0x7f874925f25e]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(+0x545dbee)[0x7f874925dbee]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/librustc_driver-3f4ebb066deec3c0.so(+0x545d1a9)[0x7f874925d1a9]
/home/akhercha/.rustup/toolchains/1.81-x86_64-unknown-linux-gnu/lib/libstd-1c4b19562077c20d.so(rust_metadata_std_1f2242ed6435445e+0xc75fb)[0x7f874a98c5fb]
/lib/x86_64-linux-gnu/libc.so.6(+0x8c6c2)[0x7f8743ca26c2]
/lib/x86_64-linux-gnu/libc.so.6(+0x107128)[0x7f8743d1d128]
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=16777216
   Compiling madara v0.7.0 (/home/akhercha/Programming/pragma/madara/crates/node)
^C  Building [=======================> ] 885/886: madara(bin)

# It works fine after this.
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
// The full backtrace should be included here when running with RUST_BACKTRACE=1
```

</p>
</details>

Additional Context:
- Adding `RUST_MIN_STACK=16777216` didn't change anything, the error is still here.
- It shows an error but the code looks like it's executing normally.