[LLVMbugs] [Bug 12252] New: Loading clang module crashes

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 12 06:56:56 PDT 2012


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

             Bug #: 12252
           Summary: Loading clang module crashes
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vvasilev at cern.ch
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


cat uses.cxx 
#include "HeaderWithNamespace.h"

cat moddir/Forwarder.h 
#ifndef EMPTY_HEADER
#define EMPTY_HEADER

#include <vector>

#endif // EMPTY_HEADER

cat moddir/HeaderWithNamespace.h 
namespace N {
   class A {
   public:
      virtual ~A() { }
   };
}

#ifndef EMPTY_HEADER
#include "Forwarder.h"
#endif


cat moddir/module.map 
module S { header "HeaderWithNamespace.h" }

clang -x c++ -Xclang -fmodules -Xclang -emit-module -Xclang -fmodule-name=S -o
S.pcm -I moddir -c moddir/module.map

clang++ -v -Xclang -fmodules -Imoddir -c uses.cxx

llvm/src/tools/clang/lib/Serialization/ASTReader.cpp:4927: static
bool<unnamed>::DeclContextNameLookupVisitor::visit(clang::serialization::ModuleFile&,
void*): Assertion `!This->Name.getCXXNameType().isNull() && "Name mismatch
without a type"' failed.
0  clang           0x00000000024c446d
1  clang           0x00000000024c4260
2  libpthread.so.0 0x00007f60173d38f0
3  libc.so.6       0x00007f60166c2a75 gsignal + 53
4  libc.so.6       0x00007f60166c65c0 abort + 384
5  libc.so.6       0x00007f60166bb941 __assert_fail + 241
6  clang           0x0000000000be522d
7  clang           0x0000000000cbee55
clang::serialization::ModuleManager::visit(bool
(*)(clang::serialization::ModuleFile&, void*), void*) + 355
8  clang           0x0000000000be54e3
clang::ASTReader::FindExternalVisibleDeclsByName(clang::DeclContext const*,
clang::DeclarationName) + 595
9  clang           0x00000000018337e9
clang::DeclContext::lookup(clang::DeclarationName) + 427
10 clang           0x0000000000c2ebbb
clang::ASTDeclReader::findExisting(clang::NamedDecl*) + 465
11 clang           0x0000000000c3812e void
clang::ASTDeclReader::mergeRedeclarable<clang::TagDecl>(clang::Redeclarable<clang::TagDecl>*,
clang::ASTDeclReader::RedeclarableResult&) + 132
12 clang           0x0000000000c20bd2
clang::ASTDeclReader::VisitTagDecl(clang::TagDecl*) + 688
13 clang           0x0000000000c20e59
clang::ASTDeclReader::VisitRecordDecl(clang::RecordDecl*) + 35
14 clang           0x0000000000c2602a
clang::ASTDeclReader::VisitCXXRecordDecl(clang::CXXRecordDecl*) + 36
15 clang           0x0000000000c3769e
16 clang           0x0000000000c1fedf clang::ASTDeclReader::Visit(clang::Decl*)
+ 51
17 clang           0x0000000000c2fe87 clang::ASTReader::ReadDeclRecord(unsigned
int) + 2595
18 clang           0x0000000000be4595 clang::ASTReader::GetDecl(unsigned int) +
389
19 clang           0x0000000000c37f8a clang::ASTDeclReader::RedeclarableResult
clang::ASTDeclReader::VisitRedeclarable<clang::TagDecl>(clang::Redeclarable<clang::TagDecl>*)
+ 90
20 clang           0x0000000000c2095f
clang::ASTDeclReader::VisitTagDecl(clang::TagDecl*) + 61
21 clang           0x0000000000c20e59
clang::ASTDeclReader::VisitRecordDecl(clang::RecordDecl*) + 35
22 clang           0x0000000000c2602a
clang::ASTDeclReader::VisitCXXRecordDecl(clang::CXXRecordDecl*) + 36
23 clang           0x0000000000c3769e
24 clang           0x0000000000c1fedf clang::ASTDeclReader::Visit(clang::Decl*)
+ 51
25 clang           0x0000000000c2fe87 clang::ASTReader::ReadDeclRecord(unsigned
int) + 2595
26 clang           0x0000000000be4595 clang::ASTReader::GetDecl(unsigned int) +
389
27 clang           0x0000000000be77f9
clang::ASTReader::ReadDynamicClasses(llvm::SmallVectorImpl<clang::CXXRecordDecl*>&)
+ 89
28 clang           0x0000000000c8c75d
29 clang           0x0000000000ee837e clang::Sema::ActOnEndOfTranslationUnit()
+ 98
30 clang           0x0000000000e757b8
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 300
31 clang           0x0000000000e7104a clang::ParseAST(clang::Sema&, bool) + 462
32 clang           0x0000000000b2e8b5 clang::ASTFrontendAction::ExecuteAction()
+ 265
33 clang           0x0000000000cc39cc clang::CodeGenAction::ExecuteAction() +
968
34 clang           0x0000000000b2e507 clang::FrontendAction::Execute() + 245
35 clang           0x0000000000b07633
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 679
36 clang           0x0000000000ad9ef9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 960
37 clang           0x0000000000ac8e13 cc1_main(char const**, char const**, char
const*, void*) + 1029
38 clang           0x0000000000ad53fe main + 499
39 libc.so.6       0x00007f60166adc4d __libc_start_main + 253
40 clang           0x0000000000ac8069
Stack dump:
0.    Program arguments:
/home/vvassilev/workspace/llvm/obj/Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
uses.cxx -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -coverage-file uses.o -resource-dir
/home/vvassilev/workspace/llvm/obj/Debug+Asserts/bin/../lib/clang/3.1 -I moddir
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/backward
-internal-isystem /usr/local/include -internal-isystem
/home/vvassilev/workspace/llvm/obj/Debug+Asserts/bin/../lib/clang/3.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/home/vvassilev/workspace/llvm/obj/clang-mod-str/reprod -ferror-limit 19
-fmessage-length 141 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -fmodules -o uses.o -x c++
uses.cxx 
1.    <eof> parser at end of file
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/uses-Yup5rk.ii
clang: note: diagnostic msg: /tmp/uses-Yup5rk.sh

 cat /tmp/uses-Yup5rk.ii 
# 1 "uses.cxx"
# 1 "uses.cxx" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 145 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "uses.cxx" 2

cat /tmp/uses-Yup5rk.sh 
 "[snip]llvm/obj/Debug+Asserts/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name uses.cxx -mrelocation-model
static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -momit-leaf-frame-pointer -coverage-file uses.o
-resource-dir
/home/vvassilev/workspace/llvm/obj/Debug+Asserts/bin/../lib/clang/3.1 -I moddir
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/backward
-internal-isystem /usr/local/include -internal-isystem
/home/vvassilev/workspace/llvm/obj/Debug+Asserts/bin/../lib/clang/3.1/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir
/home/vvassilev/workspace/llvm/obj/clang-mod-str/reprod -ferror-limit 19
-fmessage-length 141 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -fmodules -o uses.o -x c++
uses.cxx

Vassil

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