Skip to content

Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file llvm/include/llvm/Support/Casting.h, line 194 #10604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Jun 30, 2011 · 5 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@llvmbot
Copy link
Member

llvmbot commented Jun 30, 2011

Bugzilla Link 10232
Resolution FIXED
Resolved on Aug 02, 2012 07:47
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@nlewycky

Extended Description

I am trying to compile a project that I am working on using clang. I've got the latest trunk from svn:

clang version 3.0 (trunk 134187)
Target: x86_64-apple-darwin10.7.4
Thread model: posix

I am encountering the error pasted below. Please let me know if I can provide any other information that can be useful:

Assertion failed: (isa(Val) && "cast() argument of incompatible type!"), function cast, file llvm/include/llvm/Support/Casting.h, line 194.
0 clang 0x00000001019146f2 llvm::SmallVectorTemplateBase<llvm_regmatch_t, false>::grow(unsigned long) + 754
1 clang 0x0000000101915543 llvm::SmallVectorTemplateBase<llvm_regmatch_t, false>::grow(unsigned long) + 4419
2 libSystem.B.dylib 0x00007fff801cc66a _sigtramp + 26
3 libSystem.B.dylib 0x000000010281d600 _sigtramp + 2187661232
4 clang 0x000000010001a732 std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* >::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**, std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* > >, llvm::PassRegistrationListener* const&) + 4146
5 clang 0x00000001004a479d llvm::cast_retty<clang::Decl, clang::DeclContext*>::ret_type llvm::cast_or_null<clang::Decl, clang::DeclContext>(clang::DeclContext*) + 147805
6 clang 0x00000001004a49c7 llvm::cast_retty<clang::Decl, clang::DeclContext*>::ret_type llvm::cast_or_null<clang::Decl, clang::DeclContext>(clang::DeclContext*) + 148359
7 clang 0x000000010037d5ab clang::PragmaOpenCLExtensionHandler::~PragmaOpenCLExtensionHandler() + 18411
8 clang 0x000000010037e219 clang::PragmaOpenCLExtensionHandler::~PragmaOpenCLExtensionHandler() + 21593
9 clang 0x000000010037e6b0 clang::PragmaOpenCLExtensionHandler::~PragmaOpenCLExtensionHandler() + 22768
10 clang 0x0000000100329852 llvm::CrashRecoveryContextDeleteCleanupclang::Sema::~CrashRecoveryContextDeleteCleanup() + 2498
11 clang 0x0000000100329238 llvm::CrashRecoveryContextDeleteCleanupclang::Sema::~CrashRecoveryContextDeleteCleanup() + 936
12 clang 0x000000010034d937 clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope() + 44231
13 clang 0x000000010034f4ba clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope() + 51274
14 clang 0x00000001003386cc clang::Parser::ConsumeAnyToken() + 50604
15 clang 0x00000001003866e6 clang::Sema::NameClassification::getType() const + 19446
16 clang 0x0000000100387702 clang::Sema::NameClassification::getType() const + 23570
17 clang 0x0000000100387af1 clang::Sema::NameClassification::getType() const + 24577
18 clang 0x000000010033e069 clang::Parser::ConsumeAnyToken() + 73545
19 clang 0x0000000100397158 llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument, false>::grow(unsigned long) + 62344
20 clang 0x0000000100397d7a llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument, false>::grow(unsigned long) + 65450
21 clang 0x0000000100328a5b clang::ABIArgInfo::getCoerceToType() const + 523
22 clang 0x00000001002f371c llvm::DenseMap<clang::GlobalDecl, long long, llvm::DenseMapInfoclang::GlobalDecl, llvm::DenseMapInfo >::grow(unsigned int) + 2188
23 clang 0x0000000100059ad1 llvm::DenseMap<clang::IdentifierInfo const*, unsigned int, llvm::DenseMapInfo<clang::IdentifierInfo const*>, llvm::DenseMapInfo >::grow(unsigned int) + 9073
24 clang 0x0000000100024f27 llvm::raw_ostream::operator<<(char const*) + 1687
25 clang 0x000000010001ba51 std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* >::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**, std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* > >, llvm::PassRegistrationListener* const&) + 9041
26 clang 0x0000000100023d5e std::vector<std::string, std::allocatorstd::string >::operator=(std::vector<std::string, std::allocatorstd::string > const&) + 13390
27 clang 0x000000010001ae84 std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* >::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**, std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* > >, llvm::PassRegistrationListener* const&) + 6020
Stack dump:
0. Program arguments: software/clang/bin/clang -cc1 -triple x86_64-apple-macosx10.6.7 -emit-obj -mrelax-all -disable-free -main-file-name Partitioner.C -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 123.2 -coverage-file .libs/Partitioner.o -resource-dir software/clang/bin/../lib/clang/3.0 -D HAVE_CONFIG_H -D BOOST_REGEX_MATCH_EXTRA -D PIC -I . -I ../../../../src/frontend/Disassemblers -I ../../.. -I ../../../src/roseSupport -I ../../../src/frontend/SageIII -I ../../../../src -I ../../../../src/frontend/SageIII -I ../../../../src/frontend/SageIII/astFixup -I ../../../../src/frontend/SageIII/astPostProcessing -I ../../../../src/frontend/SageIII/astMerge -I ../../../../src/frontend/SageIII/astVisualization -I ../../../../src/frontend/SageIII/astFileIO -I ../../../../src/frontend/SageIII/sageInterface -I ../../../../src/frontend/SageIII/virtualCFG -I ../../../../src/frontend/SageIII/astTokenStream -I ../../../../src/frontend/SageIII/astHiddenTypeAndDeclarationLists -I ../../../src/frontend/SageIII/astFileIO -I ../../../../src/frontend/SageIII/astFromString -I ../../../../src/frontend/OpenFortranParser_SAGE_Connection -I ../../../../src/frontend/ECJ_ROSE_Connection -I ../../../../src/frontend/PHPFrontend -I ../../../../src/frontend/PythonFrontend -I ../../../../src/frontend/BinaryDisassembly -I ../../../../src/frontend/BinaryFormats -I ../../../../src/frontend/BinaryLoader -I ../../../../src/frontend/Disassemblers -I ../../../../src/backend/unparser -I ../../../../src/backend/unparser/formatSupport -I ../../../../src/backend/unparser/languageIndependenceSupport -I ../../../../src/backend/unparser/CxxCodeGeneration -I ../../../../src/backend/unparser/JavaCodeGeneration -I ../../../../src/backend/unparser/FortranCodeGeneration -I ../../../../src/backend/unparser/PHPCodeGeneration -I ../../../../src/backend/unparser/PythonCodeGeneration -I ../../../../src/backend/asmUnparser -I ../../../../src/util -I ../../../../src/util/support -I ../../../../src/util/graphs -I ../../../../src/util/stringSupport -I ../../../../src/util/commandlineProcessing -I ../../../../src/midend/abstractHandle -I ../../../../src/midend/astDiagnostics -I ../../../../src/midend/programTransformation/astInlining -I ../../../../src/midend/programTransformation/astOutlining -I ../../../../src/midend/astProcessing -I ../../../../src/midend/astQuery -I ../../../../src/midend/astRewriteMechanism -I ../../../../src/midend/astUtil/annotation -I ../../../../src/midend/astUtil/astInterface -I ../../../../src/midend/astUtil/astSupport -I ../../../../src/midend/astUtil/symbolicVal -I ../../../../src/midend/binaryAnalyses -I ../../../../src/midend/binaryAnalyses/dataflowanalyses -I ../../../../src/midend/binaryAnalyses/instructionSemantics -I ../../../../src/midend/programTransformation/loopProcessing/computation -I ../../../../src/midend/programTransformation/loopProcessing/depGraph -I ../../../../src/midend/programTransformation/loopProcessing/depInfo -I ../../../../src/midend/programTransformation/loopProcessing/driver -I ../../../../src/midend/programTransformation/loopProcessing/outsideInterface -I ../../../../src/midend/programTransformation/loopProcessing/prepostTransformation -I ../../../../src/midend/programTransformation/ompLowering -I ../../../../src/midend/programAnalysis -I ../../../../src/midend/programAnalysis/annotationLanguageParser -I ../../../../src/midend/programAnalysis/CFG -I ../../../../src/midend/programAnalysis/CallGraphAnalysis -I ../../../../src/midend/programAnalysis/OAWrap -I ../../../../src/midend/programAnalysis/dataflowAnalysis -I ../../../../src/midend/programAnalysis/defUseAnalysis -I ../../../../src/midend/programAnalysis/distributedMemoryAnalysis -I ../../../../src/midend/programAnalysis/dominanceAnalysis -I ../../../../src/midend/programAnalysis/graphAnalysis -I ../../../../src/midend/programAnalysis/pointerAnal -I ../../../../src/midend/programAnalysis/staticInterproceduralSlicing -I ../../../../src/midend/programAnalysis/valuePropagation -I ../../../../src/midend/programAnalysis/variableRenaming -I ../../../../src/midend/programTransformation/partialRedundancyElimination -I ../../../../src/midend/programTransformation/finiteDifferencing -I ../../../../src/midend/programTransformation/functionCallNormalization -I ../../../../src/midend/programTransformation/constantFolding -I ../../../../src/midend/programTransformation/implicitCodeGeneration -I ../../../../src/roseSupport -I ../../../../src/3rdPartyLibraries/MSTL -I ../../../../src/3rdPartyLibraries/libharu-2.1.0/include -I ../../../src/3rdPartyLibraries/libharu-2.1.0/include -I ../../../../src/3rdPartyLibraries/qrose/Framework -I ../../../../src/3rdPartyLibraries/qrose/Widgets -I ../../../../src/util/graphs -I ../../../../src/midend/astUtil/astInterface -I ../../../../libltdl -I macports/include -fdeprecated-macro -ferror-limit 19 -fmessage-length 146 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fno-common -fdiagnostics-show-option -fcolor-diagnostics -o .libs/Partitioner.o -x c++ ../../../../src/frontend/Disassemblers/Partitioner.C

  1. ../../../../src/midend/binaryAnalyses/instructionSemantics/x86InstructionSemantics.h:2521:24: current parser token ')'
  2. ../../../../src/midend/binaryAnalyses/instructionSemantics/x86InstructionSemantics.h:30:1: parsing struct/union/class body 'X86InstructionSemantics'
  3. ../../../../src/midend/binaryAnalyses/instructionSemantics/x86InstructionSemantics.h:716:55: parsing function try block 'translate'
    clang: error: unable to execute command: Illegal instruction
    clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
@nlewycky
Copy link
Contributor

nlewycky commented Jul 4, 2011

Please attach the preprocessed source that triggers this.

@llvmbot
Copy link
Member Author

llvmbot commented Jul 5, 2011

Preprocessed input that crashes clang
As requested.

@nlewycky
Copy link
Contributor

nlewycky commented Jul 6, 2011

Reduced testcase:

template
class Templated {
struct Exception {
};
void exception() {
try {
} catch(Exception e) {
}
}
}

reproducable with "clang -cc1 -x c++ pr10232.cpp".

@DougGregor
Copy link
Contributor

Fixed in Clang r134515.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#10543

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
kateinoigakukun pushed a commit to kateinoigakukun/llvm-project that referenced this issue May 13, 2025
…ning (llvm#137421) (llvm#10604)

We would like to report, for a module, which direct dependencies it
exports during dependency scanning. This PR implements this reporting by
augmenting `ModuleDep`'s `ClangModuleDeps` variable. `ClangModuleDeps`
now contains instances of `DepInfo`, which is made of a `ModuleID` and a
boolean flag that indicates if a particular dependence is exported.

rdar://144794793
(cherry picked from commit ea1bfbf)
qiongsiwu added a commit to qiongsiwu/llvm-project that referenced this issue May 20, 2025
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

3 participants