gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

ICE: segfault when no source file is passed

Open matthiaskrgr opened this issue 9 months ago • 3 comments

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.

matthiaskrgr avatar Mar 23 '25 13:03 matthiaskrgr

Wierd this crash is in main GCC code but doesnt happen for ./gcc/cc1

Ahhhh it defaults to reading from stdin with other compilers...

philberty avatar Mar 25 '25 16:03 philberty

If nobody is working on this issue, can you please assign this to me?

shreyas-omkar avatar Oct 02 '25 13:10 shreyas-omkar

@philberty whats the expected behaviour?? If it is graceful error handling, I have already raised a PR. If it is to take input from stdin please let me know.

shreyas-omkar avatar Oct 12 '25 06:10 shreyas-omkar