gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

GCCRS fails to handle invalid nested attributes syntax and crashes with SIGKILL (processing time exceeded)

Open starbugs-qurong opened this issue 8 months ago • 0 comments

Summary

When compiling the attached Rust code containing invalid nested inner attributes and delimiter mismatches, GCCRS enters an infinite loop or excessive resource consumption, leading to a SIGKILL termination. In contrast, Rustc (both nightly and beta) correctly reports syntax errors without crashing.

Reproducer

I tried this code:

#[derive(A)]
struct S {
    d: [u32; {
        #![cfg] {
            #![w,)

Does the code make use of any (1.49) nightly feature ?

  • [ ] Nightly

Godbolt link

https://godbolt.org/z/qx1bWx77x

Actual behavior

GCCRS is killed due to processing time exceeded: Killed - processing time exceeded Program terminated with signal: SIGKILL Compiler returned: 143

Expected behavior

A clear syntax error message about mismatched delimiters and unclosed blocks.

GCC Version

14.2

starbugs-qurong avatar Apr 10 '25 08:04 starbugs-qurong