[LLVMbugs] [Bug 6955] New: clang: crashes when compiling arch/x86/kernel/cpu/common.c from linux kernel

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 27 08:18:38 PDT 2010


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

           Summary: clang: crashes when compiling
                    arch/x86/kernel/cpu/common.c from linux kernel
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: stefan at datenfreihafen.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4747)
 --> (http://llvm.org/bugs/attachment.cgi?id=4747)
preprocessed code

Latest trunk of clang and latest linus HEAD gives me the following:

  CC      arch/x86/kernel/cpu/common.o
clang: CGExprConstant.cpp:82:
bool<unnamed>::ConstStructBuilder::AppendField(const clang::FieldDecl*,
uint64_t, llvm::Constant*): Assertion `NextFieldOffsetInBytes <=
FieldOffsetInBytes && "Field offset mismatch!"' failed.
0  clang           0x000000000127458f
1  clang           0x0000000001276482
stefan at excalibur:~/Projekte/kernel/linux-2.6$ make
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC      arch/x86/kernel/cpu/common.o
clang: CGExprConstant.cpp:82:
bool<unnamed>::ConstStructBuilder::AppendField(const clang::FieldDecl*,
uint64_t, llvm::Constant*): Assertion `NextFieldOffsetInBytes <=
FieldOffsetInBytes && "Field offset mismatch!"' failed.
0  clang           0x000000000127458f
1  clang           0x0000000001276482
2  libpthread.so.0 0x00002ae1fc11ba60
3  libc.so.6       0x00002ae1fcd0bf05 gsignal + 53
4  libc.so.6       0x00002ae1fcd0ed10 abort + 384
5  libc.so.6       0x00002ae1fcd04faa __assert_fail + 234
6  clang           0x00000000005806ee
7  clang           0x000000000058130d
8  clang           0x000000000057e39b
9  clang           0x000000000057f467
10 clang           0x000000000058130d
11 clang           0x000000000057e39b
12 clang           0x000000000057f467
13 clang           0x000000000058130d
14 clang           0x000000000057e39b
15 clang           0x0000000000581199
16 clang           0x000000000057e39b
17 clang           0x000000000057f467
18 clang           0x000000000058130d
19 clang           0x000000000057e39b
20 clang           0x000000000051d61b
21 clang           0x000000000051fb44
22 clang           0x0000000000520287
23 clang           0x00000000005205b7
24 clang           0x0000000000517381
25 clang           0x0000000000412884
26 clang           0x0000000000612665
27 clang           0x0000000000418d11
28 clang           0x0000000000409a16
29 clang           0x000000000040cb73 main + 2371
30 libc.so.6       0x00002ae1fccf8abd __libc_start_main + 253
31 clang           0x0000000000407399
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name common.c
-mrelocation-model static -mconstructor-aliases -mcode-model kernel
-disable-red-zone -target-cpu x86-64 -target-feature -sse -target-feature -mmx
-target-feature -sse2 -target-feature -3dnow -nostdinc -resource-dir
/usr/local/lib/clang/1.5 -dependency-file arch/x86/kernel/cpu/.common.o.d -MT
arch/x86/kernel/cpu/common.o -sys-header-deps -isystem include -include
include/generated/autoconf.h -D__KERNEL__ -DCONFIG_AS_CFI=1
-DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DKBUILD_STR(s)=#s
-DKBUILD_BASENAME=KBUILD_STR(common) -DKBUILD_MODNAME=KBUILD_STR(common)
-I/home/stefan/Projekte/kernel/linux-2.6/arch/x86/include -Iinclude -O2 -Wall
-Wundef -Wstrict-prototypes -Wno-trigraphs
-Werror-implicit-function-declaration -Wno-format-security -Wno-unused-value
-Wno-sign-compare -Wdeclaration-after-statement -Wno-pointer-sign -ferror-limit
19 -ftemplate-backtrace-limit 10 -fmessage-length 106 -fgnu-runtime -fno-common
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-nckBgP.s -x c
arch/x86/kernel/cpu/common.c 
1.      arch/x86/kernel/cpu/common.c:138:36: current parser token ';'
2.      arch/x86/kernel/cpu/common.c:86:1
<Spelling=arch/x86/kernel/cpu/common.c:86:46>: LLVM IR generation of
declaration 'gdt_page'
3.      arch/x86/kernel/cpu/common.c:86:1
<Spelling=arch/x86/kernel/cpu/common.c:86:46>: Generating code for declaration
'gdt_page'
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)
make[3]: *** [arch/x86/kernel/cpu/common.o] Error 250
make[2]: *** [arch/x86/kernel/cpu] Error 2
make[1]: *** [arch/x86/kernel] Error 2
make: *** [arch/x86] Error 2

-- 
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