[LLVMbugs] [Bug 15120] New: Assertion failed: (!From.isInvalid() && "Implicit field reference cannot fail")

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 30 02:48:03 PST 2013


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

             Bug #: 15120
           Summary: Assertion failed: (!From.isInvalid() && "Implicit
                    field reference cannot fail")
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: lakseru at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9947
  --> http://llvm.org/bugs/attachment.cgi?id=9947
Source that makes clang crash.

I got this while compiling some production code (which in retrospect contained
c++ errors), so the original source was very big. I tried slimming it down with
delta, but it got unreadable (nevertheless I attached that source).

Version of clang:
$ ~/Documents/Code/build/Debug+Asserts/bin/clang -v
clang version 3.3 (trunk 170991)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

Backtrace:
joshua at n040005:~/Documents/Code/ClangBug$ ./main-lFe7mm.sh 
main-lFe7mm.cpp:15:55: fatal error: expected class name
 template <class _Tp> struct __is_void       : public false_type {
                                                      ^
Assertion failed: (!From.isInvalid() && "Implicit field reference cannot
fail"), function DefineImplicitCopyAssignment, file
/Users/joshua/Documents/Code/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp, line
8503.
0  clang             0x00000001060fd56e _ZL15PrintStackTracePv + 46
1  clang             0x00000001060fdb19 _ZL13SignalHandleri + 297
2  libsystem_c.dylib 0x00007fff9209dcfa _sigtramp + 26
3  libsystem_c.dylib 0x00000400635fc4d8 _sigtramp + 18446607737779775480
4  clang             0x00000001060fd83b raise + 27
5  clang             0x00000001060fd8f2 abort + 18
6  clang             0x00000001060fd8d1 __assert_rtn + 129
7  clang             0x00000001040522c4
clang::Sema::DefineImplicitCopyAssignment(clang::SourceLocation,
clang::CXXMethodDecl*) + 4068
8  clang             0x00000001040deb78
clang::Sema::MarkFunctionReferenced(clang::SourceLocation,
clang::FunctionDecl*) + 1064
9  clang             0x000000010423d836
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, unsigned int,
clang::UnresolvedSetImpl const&, clang::Expr*, clang::Expr*) + 2518
10 clang             0x00000001040f2f2a
_ZL20BuildOverloadedBinOpRN5clang4SemaEPNS_5ScopeENS_14SourceLocationENS_18BinaryOperatorKindEPNS_4ExprES7_
+ 266
11 clang             0x00000001040f2ddd clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) +
1213
12 clang             0x0000000104369bc9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::RebuildBinaryOperator(clang::SourceLocation,
clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 73
13 clang             0x0000000104356882 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformBinaryOperator(clang::BinaryOperator*)
+ 466
14 clang             0x000000010434c8df clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 447
15 clang             0x000000010434c3c3 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 1715
16 clang             0x000000010436320f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) + 159
17 clang             0x000000010436b26a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
+ 42
18 clang             0x000000010434becf clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 447
19 clang             0x000000010436be9a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformIfStmt(clang::IfStmt*) + 586
20 clang             0x000000010434bfef clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 735
21 clang             0x000000010436320f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) + 159
22 clang             0x000000010436b26a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
+ 42
23 clang             0x000000010434becf clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 447
24 clang             0x000000010436e1aa clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformWhileStmt(clang::WhileStmt*) + 554
25 clang             0x000000010434c392 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 1666
26 clang             0x000000010436320f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) + 159
27 clang             0x000000010436b26a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
+ 42
28 clang             0x000000010434becf clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 447
29 clang             0x000000010436be9a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformIfStmt(clang::IfStmt*) + 586
30 clang             0x000000010434bfef clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 735
31 clang             0x000000010436320f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) + 159
32 clang             0x000000010436b26a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
+ 42
33 clang             0x000000010434becf clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 447
34 clang             0x000000010434bce5 clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 133
35 clang             0x000000010438f4c7
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 2167
36 clang             0x00000001043905d2
clang::Sema::PerformPendingInstantiations(bool) + 738
37 clang             0x0000000103f3472d
clang::Sema::ActOnEndOfTranslationUnit() + 589
38 clang             0x0000000103ec67f2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 338
39 clang             0x0000000103e542e3 clang::ParseAST(clang::Sema&, bool,
bool) + 531
40 clang             0x0000000103adbd98
clang::ASTFrontendAction::ExecuteAction() + 312
41 clang             0x0000000103ddabfb clang::CodeGenAction::ExecuteAction() +
1243
42 clang             0x0000000103adb99a clang::FrontendAction::Execute() + 186
43 clang             0x0000000103aa1fdf
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 863
44 clang             0x0000000103a1913d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1005
45 clang             0x0000000103a05a58 cc1_main(char const**, char const**,
char const*, void*) + 760
46 clang             0x0000000103a11f99 main + 473
47 clang             0x0000000103a05734 start + 52
48 clang             0x0000000000000047 start + 18446744069353744711
Stack dump:
0.    Program arguments:
/Users/joshua/Documents/Code/build/Debug+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.7.0 -emit-obj -disable-free -disable-llvm-verifier
-main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 134.9 -g
-nostdinc++ -D NDEBUG -stdlib=libc++ -O3 -Weverything -Wno-newline-eof
-Wno-variadic-macros -Wno-padded -Wno-vla -Wno-c++98-compat-pedantic
-Wno-float-equal -Wno-pedantic -Wno-weak-vtables -Wno-disabled-macro-expansion
-Wno-missing-prototypes -Wno-missing-noreturn -Wno-global-constructors
-Wno-exit-time-destructors -Wno-cast-align -Wno-unreachable-code -Wno-packed
-Wno-conversion -Wno-switch-enum -Wno-extra-semi -Wno-undef -std=c++11
-fdeprecated-macro -ferror-limit 19 -fmessage-length 133 -stack-protector 1
-mstackrealign -fblocks -fobjc-runtime=macosx-10.7.0
-fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties
-fencode-extended-block-signature -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-Wfatal-errors -x c++ main-lFe7mm.cpp 
1.    <eof> parser at end of file
2.    main-lFe7mm.cpp:96:71: instantiating function definition 'remove_if'
./main-lFe7mm.sh: line 1: 94392 Illegal instruction: 4 
/Users/joshua/Documents/Code/build/Debug+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.7.0 -emit-obj -disable-free -disable-llvm-verifier
-main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 134.9 -g
-nostdinc++ -D "NDEBUG" -stdlib=libc++ -O3 -Weverything -Wno-newline-eof
-Wno-variadic-macros -Wno-padded -Wno-vla -Wno-c++98-compat-pedantic
-Wno-float-equal -Wno-pedantic -Wno-weak-vtables -Wno-disabled-macro-expansion
-Wno-missing-prototypes -Wno-missing-noreturn -Wno-global-constructors
-Wno-exit-time-destructors -Wno-cast-align -Wno-unreachable-code -Wno-packed
-Wno-conversion -Wno-switch-enum -Wno-extra-semi -Wno-undef -std=c++11
-fdeprecated-macro -ferror-limit 19 -fmessage-length 133 -stack-protector 1
-mstackrealign -fblocks -fobjc-runtime=macosx-10.7.0
-fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties
-fencode-extended-block-signature -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-Wfatal-errors -x c++ main-lFe7mm.cpp



It also crashes in the Release build of this clang.
Crash was gone after fixing our code, so it may be not so relevant...

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