[LLVMbugs] [Bug 5474] New: clang packed struct crash

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Nov 12 09:01:38 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5474

           Summary: clang packed struct crash
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, chenyang at cs.utah.edu


Valgrind says it's a null ptr deref.

regehr at john-home:~/volatile/tmp237$ clang -v
clang version 1.1 (trunk 86913)
Target: i386-pc-linux-gnu
Thread model: posix

regehr at john-home:~/volatile/tmp237$ clang small.c

0  clang-cc 0x09017e48
Stack dump:
0.      Program arguments:
/home/regehr/z/tmp/llvm-gcc-r86913-install/bin/../libexec/clang-cc -triple
i386-pc-linux-gnu -S -disable-free -main-file-name small.c --relocation-model
static --disable-fp-elim --unwind-tables=0 --mcpu=pentium4 --fmath-errno=1
-fmessage-length 80 -fexceptions=0 -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cc-wcDdUE.s -x c small.c 
1.      <eof> parser at end of file
2.      small.c:22:11: LLVM IR generation of declaration 'g'
3.      small.c:22:11: Generating code for declaration 'g'
clang: error: compiler command failed due to signal 11 (use -v to see
invocation)

regehr at john-home:~/volatile/tmp237$ cat small.c

struct S0
{
  long long f0;
};

#pragma pack(push)
#pragma pack(1)
struct S2
{
  struct S0 f0;
};
#pragma pack(pop)

struct S4
{
  short f0;
  unsigned f1;
  short f3;
  const volatile struct S2 f4;
};

struct S4 g = {
  6L, 0L, 0xFD52280335900B08LL, 0
};


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list