Rust-GCC / Rust-GCC/gccrs

ICE: segfault when no source file is passed

Open
#3,523 3 comments 0 reactions 1 assignee View on GitHub

@shreyas-omkar is already working on this.

Since Oct 2, 2025.

bug good-first-pr
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
19h 55m
Merged PRs (30d)
67

Description

Meta

local build @ b4895dae9b30413d77024a445af37b3df12d8dfa

Error output

I tried to run my locally built crab1 but didn't pass a soure file
I got the command from https://github.com/Rust-GCC/gccrs?tab=readme-ov-file#running-gcc-rust
./gcc/crab1 -frust-debug -frust-dump-ast-pretty -Warray-bounds -dumpbase test.rs -mtune=generic -march=x86-64 -O0 -version -fdump-tree-gimple -o test.s -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -frust-incomplete-and-experimental-compiler-do-not-use -freport-bug
to my surprise this would already cause a segfault 😅

Backtrace

  compiled by GNU C version 14.2.1 20250207, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.27-GMP

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
options passed: -frust-debug -frust-dump-ast-pretty -mtune=generic -march=x86-64 -O0 -frust-incomplete-and-experimental-compiler-do-not-use -freport-bug
crab1: internal compiler error: Segmentation fault
0x14ffe4f crash_signal
  ../../gcc/toplev.cc:319
0x28b7d36 lrealpath
  ../../libiberty/lrealpath.c:215
0x28b696a canonical_filename_eq
  ../../libiberty/filename_cmp.c:216
0xad732d init_asm_output
  ../../gcc/toplev.cc:707
0xad732d lang_dependent_init
  ../../gcc/toplev.cc:1847
0xad732d do_compile
  ../../gcc/toplev.cc:2139
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.