[LLVMbugs] [Bug 129] NEW: [llvm-gcc] Crashes on invalid C input

bugzilla-daemon at zion.cs.uiuc.edu bugzilla-daemon at zion.cs.uiuc.edu
Tue Nov 18 13:45:47 PST 2003


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=129

           Summary: [llvm-gcc] Crashes on invalid C input
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: sabre at nondot.org
        ReportedBy: brukman+bugs at uiuc.edu


This is the result of CVS update with conflicts. :) Among other things, it
demonstrates that the CFE crashes on invalid C input. This may be a bug in GCC
itself, and not in the LLVM translation, but who knows. Reduced from
linux-2.4.22/arch/llvm/kernel/traps.c :)

<<<<<<< traps.c
typedef int (*initcall_t)(void);

void show_regs(struct pt_regs *regs) {
 return 0;
>>>>>>> 1.2
}

static spinlock_t die_lock = (spinlock_t) { };
void __die(const char * str, struct pt_regs * regs, const char * file,
    const char * func, unsigned long line)

void show_stack(unsigned long *esp) {
 do { if (1); } ; (void)(&die_lock); } while (0);
}

OUTPUT:

traps5.i:1: error: parse error before '<<' token
traps5.i:4: warning: "struct pt_regs" declared inside parameter list
traps5.i:4: warning: its scope is only this definition or declaration, which is
probably not what you want
traps5.i: In function `show_regs':

traps5.i:5: warning: `return' with a value, in function returning void
traps5.i:6: error: parse error before '>>' token
traps5.i: In function `__die':

traps5.i:13: error: parse error before '{' token
traps5.i:14: error: old-style parameter declarations in prototyped function
definition
traps5.i:14: error: old-style parameter declarations in prototyped function
definition
traps5.i:14: error: old-style parameter declarations in prototyped function
definition
traps5.i:15: error: old-style parameter declarations in prototyped function
definition
traps5.i:15: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.cs.uiuc.edu> for instructions.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list