[LLVMbugs] [Bug 13922] New: Including python API header crashes clang if optimization is on

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 25 19:03:26 PDT 2012


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

             Bug #: 13922
           Summary: Including python API header crashes clang if
                    optimization is on
           Product: new-bugs
           Version: 3.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: llvm at allthingslong.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9257
  --> http://llvm.org/bugs/attachment.cgi?id=9257
Command line and output from clang

Overview:

If I compile a file containing only:

#include "/usr/include/python2.6/Python.h"

with clang, clang crashes with:

clang:
/data/clong/llvm/llvm-3.1/tools/clang/lib/CodeGen/CodeGenModule.cpp:1758: void
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl):
Assertion `OldFn->isDeclaration() && "Shouldn't replace non-declaration"'
failed.

Steps to Reproduce:

1. Create a file (let's call it "conftest.c") and put the line

#include "/usr/include/python2.6/Python.h"

   in it.

2. Run "clang -c -O1 -v conftest.c"
3. clang crashes

Expected Results:

clang produces a .o file (conftest.o)

Build Date & Platform:

2012/09/25 clang 3.1 on CentOS release 5.8 (Final) on x86_64, with kernel
2.6.18-308.4.1.el5.

Additional Information:

* Also happens for Python 2.4.
* Can be prevented if you #include <sys/stat.h> first.

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