[clang] 12038be - [Concepts] Fix crash in D41910

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 18 13:34:49 PST 2019


Hey Saar,
Do you expect this to address this crash seen on the lldb bot after D41910 landed?

Assertion failed: (Idx < size() && "Out-of-bounds Bit access."), function operator[], file /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/ADT/SmallBitVector.h, line 452.

Stack dump:
0.	Program arguments: /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang-10 -cc1 -triple x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-rounding-math -masm-verbose -munwind-tables -target-sdk-version=10.14 -target-cpu penryn -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=lldb -target-linker-version 409.12 -resource-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lib/clang/10.0.99 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -include /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h -I /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant -I /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make -D LLDB_USING_LIBCPP -stdlib=libc++ -internal-isystem /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include -internal-isystem /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lib/clang/10.0.99/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -O0 -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/functionalities/data-formatter/data-formatter-stl/libcxx/variant/TestDataFormatterLibcxxVariant.test_with_run_command_dsym -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fno-builtin -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o main.o -x c++ /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp 
1.	/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp:26:39: current parser token ';'
2.	/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp:20:1: parsing function body 'main'
3.	/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/variant/main.cpp:20:1: in compound statement ('{}')
4.	/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/../include/c++/v1/variant:1192:13: instantiating function definition 'std::__1::variant<int, double, char>::variant<true, 0>'
5.	/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/../include/c++/v1/variant:684:22: instantiating function definition 'std::__1::__variant_detail::__base<std::__1::__variant_detail::_Trait::_TriviallyAvailable, int, double, char>::__base<0>'
0  clang-10                 0x00000001077ed1a5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  clang-10                 0x00000001077ec0a8 llvm::sys::RunSignalHandlers() + 248
2  clang-10                 0x00000001077ed796 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff66bc3b3d _sigtramp + 29
4  libsystem_platform.dylib 0x00007ffeea2a2150 _sigtramp + 18446744071619601968
5  libsystem_c.dylib        0x00007fff66a821c9 abort + 127
6  libsystem_c.dylib        0x00007fff66a4a868 basename_r + 0
7  clang-10                 0x00000001094b79d9 isAtLeastAsSpecializedAs(clang::Sema&, clang::SourceLocation, clang::FunctionTemplateDecl*, clang::FunctionTemplateDecl*, clang::TemplatePartialOrderingContext, unsigned int) + 1865
8  clang-10                 0x00000001094b7111 clang::Sema::getMoreSpecializedTemplate(clang::FunctionTemplateDecl*, clang::FunctionTemplateDecl*, clang::SourceLocation, clang::TemplatePartialOrderingContext, unsigned int, unsigned int) + 97
9  clang-10                 0x000000010939bf88 clang::isBetterOverloadCandidate(clang::Sema&, clang::OverloadCandidate const&, clang::OverloadCandidate const&, clang::SourceLocation, clang::OverloadCandidateSet::CandidateSetKind) + 1128
10 clang-10                 0x000000010938e768 clang::OverloadCandidateSet::BestViableFunction(clang::Sema&, clang::SourceLocation, clang::OverloadCandidate*&) + 760
11 clang-10                 0x000000010926b1c8 TryConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType, clang::QualType, clang::InitializationSequence&, bool, bool) + 1224
12 clang-10                 0x00000001092680e8 clang::InitializationSequence::InitializeFrom(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, bool, bool) + 2152
13 clang-10                 0x000000010908548e clang::Sema::BuildMemberInitializer(clang::ValueDecl*, clang::Expr*, clang::SourceLocation) + 910
14 clang-10                 0x000000010954d7a9 clang::Sema::InstantiateMemInitializers(clang::CXXConstructorDecl*, clang::CXXConstructorDecl const*, clang::MultiLevelTemplateArgumentList const&) + 1353
15 clang-10                 0x000000010954cb04 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) + 3540
16 clang-10                 0x00000001091befc9 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 1417
17 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
18 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
19 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
20 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
21 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
22 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
23 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
24 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
25 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
26 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
27 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
28 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
29 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
30 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
31 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
32 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
33 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
34 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
35 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
36 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
37 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
38 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
39 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
40 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
41 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
42 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
43 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
44 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
45 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
46 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
47 clang-10                 0x00000001090b0a0e clang::Sema::DefineInheritingConstructor(clang::SourceLocation, clang::CXXConstructorDecl*) + 1278
48 clang-10                 0x00000001091bec14 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 468
49 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
50 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
51 clang-10                 0x00000001090b6e63 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, unsigned int, clang::SourceRange) + 259
52 clang-10                 0x00000001090b6bc3 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, unsigned int, clang::SourceRange) + 323
53 clang-10                 0x000000010927b64b PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) + 1435
54 clang-10                 0x000000010926f361 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) + 3857
55 clang-10                 0x00000001090854b5 clang::Sema::BuildMemberInitializer(clang::ValueDecl*, clang::Expr*, clang::SourceLocation) + 949
56 clang-10                 0x000000010954d7a9 clang::Sema::InstantiateMemInitializers(clang::CXXConstructorDecl*, clang::CXXConstructorDecl const*, clang::MultiLevelTemplateArgumentList const&) + 1353
57 clang-10                 0x000000010954cb04 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) + 3540
58 clang-10                 0x00000001091befc9 void llvm::function_ref<void ()>::callback_fn<clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool)::$_7>(long) + 1417
59 clang-10                 0x0000000108e6ab3e clang::Sema::runWithSufficientStackSpace(clang::SourceLocation, llvm::function_ref<void ()>) + 46
60 clang-10                 0x000000010917fac4 clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) + 644
61 clang-10                 0x00000001090b6e63 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::CXXConstructorDecl*, bool, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, unsigned int, clang::SourceRange) + 259
62 clang-10                 0x00000001090b6bc3 clang::Sema::BuildCXXConstructExpr(clang::SourceLocation, clang::QualType, clang::NamedDecl*, clang::CXXConstructorDecl*, llvm::MutableArrayRef<clang::Expr*>, bool, bool, bool, bool, unsigned int, clang::SourceRange) + 323
63 clang-10                 0x000000010927b64b PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) + 1435
64 clang-10                 0x000000010926f361 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) + 3857
65 clang-10                 0x0000000108f79f03 clang::Sema::ActOnUninitializedDecl(clang::Decl*) + 3715
66 clang-10                 0x0000000108d6341e clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 670
67 clang-10                 0x0000000108d613f6 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 2550
68 clang-10                 0x0000000108d5c522 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) + 546
69 clang-10                 0x0000000108d5be27 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) + 551
70 clang-10                 0x0000000108de47da clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) + 1082
71 clang-10                 0x0000000108de41dd clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) + 189
72 clang-10                 0x0000000108ded0a0 clang::Parser::ParseCompoundStatementBody(bool) + 1904
73 clang-10                 0x0000000108dedf6c clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 172
74 clang-10                 0x0000000108e09c3d clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) + 1853
75 clang-10                 0x0000000108d61202 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 2050
76 clang-10                 0x0000000108e0914d clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 717
77 clang-10                 0x0000000108e08c02 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 642
78 clang-10                 0x0000000108e073e9 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 2729
79 clang-10                 0x0000000108e05249 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) + 1289
80 clang-10                 0x0000000108d4b3ed clang::ParseAST(clang::Sema&, bool, bool) + 509
81 clang-10                 0x000000010800ed03 clang::FrontendAction::Execute() + 99
82 clang-10                 0x0000000107f9ecb3 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1619
83 clang-10                 0x000000010808441c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1772
84 clang-10                 0x0000000105959409 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2233
85 clang-10                 0x0000000105954ee9 main + 11417
86 libdyld.dylib            0x00007fff669da085 start + 1
87 libdyld.dylib            0x0000000000000051 start + 18446603338794557389

clang-10: error: unable to execute command: Abort trap: 6

best,
vedant

> On Dec 18, 2019, at 11:32 AM, Saar Raz via cfe-commits <cfe-commits at lists.llvm.org> wrote:
> 
> 
> Author: Saar Raz
> Date: 2019-12-18T21:31:33+02:00
> New Revision: 12038be20ee6a903cdbd3fddce65535ef683e31d
> 
> URL: https://github.com/llvm/llvm-project/commit/12038be20ee6a903cdbd3fddce65535ef683e31d
> DIFF: https://github.com/llvm/llvm-project/commit/12038be20ee6a903cdbd3fddce65535ef683e31d.diff
> 
> LOG: [Concepts] Fix crash in D41910
> 
> Differential Revision: https://reviews.llvm.org/D41910
> 
> Added: 
> 
> 
> Modified: 
>    clang/lib/Sema/SemaConcept.cpp
> 
> Removed: 
> 
> 
> 
> ################################################################################
> diff  --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
> index cd41000fa023..f9d54a811469 100755
> --- a/clang/lib/Sema/SemaConcept.cpp
> +++ b/clang/lib/Sema/SemaConcept.cpp
> @@ -558,7 +558,7 @@ static bool substituteParameterMappings(Sema &S, NormalizedConstraint &N,
>     Atomic.ParameterMapping.emplace();
>     Atomic.ParameterMapping->reserve(OccurringIndices.size());
>     for (unsigned I = 0, C = TemplateParams->size(); I != C; ++I)
> -      if (OccurringIndices[I])
> +      if (I < OccurringIndices.size() && OccurringIndices[I])
>         Atomic.ParameterMapping->push_back(
>             S.getIdentityTemplateArgumentLoc(TemplateParams->begin()[I],
>                 // Here we assume we do not support things like
> 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list