[llvm-bugs] [Bug 36735] New: Assertion failed while cross compiling on macOS for Linux [Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack")]

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 14 09:52:22 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36735

            Bug ID: 36735
           Summary: Assertion failed while cross compiling on macOS for
                    Linux [Assertion failed:
                    (!CodeSynthesisContexts.empty() && "Cannot perform an
                    instantiation without some context on the "
                    "instantiation stack")]
           Product: clang
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Juan.Arrieta at nablazerolabs.com
                CC: llvm-bugs at lists.llvm.org

Successfully built clang from source exactly as instructed in
https://clang.llvm.org/get_started.html.

Attempted to cross-compile a hello world executable.

Source (hello.cpp):

#include <iostream>
int main() {
  std::cout << "Hello, world!\n";
}


Command:

$ clang++ hello.cpp -std=c++17 -target x86_64-pc-linux -stdlib=libc++

Output:

In file included from hello.cpp:1:
In file included from /usr/local/bin/../include/c++/v1/iostream:37:
/usr/local/bin/../include/c++/v1/__config:192:12: fatal error: 'features.h'
file not found
#  include <features.h>
           ^~~~~~~~~~~~
Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an
instantiation without some context on the " "instantiation stack"), function
SubstType, file
/usr/local/src/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp, line
1580.
0  clang-7.0                0x000000010e3df8f8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-7.0                0x000000010e3dffb6 SignalHandler(int) + 470
2  libsystem_platform.dylib 0x00007fff5c1a8f5a _sigtramp + 26
3  libsystem_platform.dylib 0x00007ffee3108b10 _sigtramp + 2264267728
4  libsystem_c.dylib        0x00007fff5bfd3312 abort + 127
5  libsystem_c.dylib        0x00007fff5bf9b368 basename_r + 0
6  clang-7.0                0x000000010fbce3e4
clang::Sema::SubstType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, bool) + 180
7  clang-7.0                0x000000010fc1155e
clang::TemplateDeclInstantiator::VisitNonTypeTemplateParmDecl(clang::NonTypeTemplateParmDecl*)
+ 1086
8  clang-7.0                0x000000010fc162e2
clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*,
clang::MultiLevelTemplateArgumentList const&) + 162
9  clang-7.0                0x000000010fb3101d
clang::Sema::DeclareImplicitDeductionGuides(clang::TemplateDecl*,
clang::SourceLocation) + 2173
10 clang-7.0                0x000000010fa03509
DeclareImplicitMemberFunctionsWithName(clang::Sema&, clang::DeclarationName,
clang::SourceLocation, clang::DeclContext const*) + 521
11 clang-7.0                0x000000010fa076dd LookupDirect(clang::Sema&,
clang::LookupResult&, clang::DeclContext const*) + 77
12 clang-7.0                0x000000010fa038ab CppNamespaceLookup(clang::Sema&,
clang::LookupResult&, clang::ASTContext&, clang::DeclContext*, (anonymous
namespace)::UnqualUsingDirectiveSet&) + 75
13 clang-7.0                0x000000010fa03209
clang::Sema::CppLookupName(clang::LookupResult&, clang::Scope*) + 3049
14 clang-7.0                0x000000010fa07259
clang::Sema::LookupName(clang::LookupResult&, clang::Scope*, bool) + 1337
15 clang-7.0                0x000000010f75ccda
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>) + 2106
16 clang-7.0                0x000000010fb4c6cb
clang::Sema::ActOnTemplateDeclarator(clang::Scope*,
llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Declarator&) + 27
17 clang-7.0                0x000000010f3fe93d
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) + 141
18 clang-7.0                0x000000010f48106a
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 2570
19 clang-7.0                0x000000010f480383
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1283
20 clang-7.0                0x000000010f47fc2d
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 237
21 clang-7.0                0x000000010f3f7bbf
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 351
22 clang-7.0                0x000000010f48eb7e
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 174
23 clang-7.0                0x000000010f412380
clang::Parser::ParseInnerNamespace(std::__1::vector<clang::SourceLocation,
std::__1::allocator<clang::SourceLocation> >&,
std::__1::vector<clang::IdentifierInfo*,
std::__1::allocator<clang::IdentifierInfo*> >&,
std::__1::vector<clang::SourceLocation,
std::__1::allocator<clang::SourceLocation> >&, unsigned int,
clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&) + 208
24 clang-7.0                0x000000010f411c96
clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&,
clang::SourceLocation) + 5078
25 clang-7.0                0x000000010f3f7c77
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 535
26 clang-7.0                0x000000010f48eb7e
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 174
27 clang-7.0                0x000000010f412380
clang::Parser::ParseInnerNamespace(std::__1::vector<clang::SourceLocation,
std::__1::allocator<clang::SourceLocation> >&,
std::__1::vector<clang::IdentifierInfo*,
std::__1::allocator<clang::IdentifierInfo*> >&,
std::__1::vector<clang::SourceLocation,
std::__1::allocator<clang::SourceLocation> >&, unsigned int,
clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&) + 208
28 clang-7.0                0x000000010f411c96
clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&,
clang::SourceLocation) + 5078
29 clang-7.0                0x000000010f3f7c77
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 535
30 clang-7.0                0x000000010f48eb7e
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 174
31 clang-7.0                0x000000010f48e448
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 600
32 clang-7.0                0x000000010f3e9396 clang::ParseAST(clang::Sema&,
bool, bool) + 438
33 clang-7.0                0x000000010ea38f3c clang::FrontendAction::Execute()
+ 76
34 clang-7.0                0x000000010e9f1451
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1233
35 clang-7.0                0x000000010ea863f8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1736
36 clang-7.0                0x000000010caf993b cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1499
37 clang-7.0                0x000000010caf75f7 main + 10903
38 libdyld.dylib            0x00007fff5bf27115 start + 1
39 libdyld.dylib            0x0000000000000037 start + 2752352035
Stack dump:
0.      Program arguments: /usr/local/bin/clang-7.0 -cc1 -triple
x86_64-pc-linux -emit-obj -mrelax-all -disable-free -main-file-name hello.cpp
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-target-linker-version 305 -resource-dir /usr/local/lib/clang/7.0.0
-internal-isystem /usr/local/bin/../include/c++/v1 -internal-isystem
/usr/local/include -internal-isystem /usr/local/lib/clang/7.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++17 -fdeprecated-macro -fdebug-compilation-dir /Users/jarrieta
-ferror-limit 19 -fmessage-length 200 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/96/gr2mgpnx277b7xmfmb1gs9440000gn/T/hello-c48a68.o -x c++
hello.cpp 
1.      /usr/local/bin/../include/c++/v1/utility:550:33: current parser token
';'
2.      /usr/local/bin/../include/c++/v1/utility:210:1
<Spelling=/usr/local/bin/../include/c++/v1/__config:454:37>: parsing namespace
'std'
3.      /usr/local/bin/../include/c++/v1/utility:210:1
<Spelling=/usr/local/bin/../include/c++/v1/__config:454:59>: parsing namespace
'std::__1'
clang-7.0: error: unable to execute command: Abort trap: 6
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 327528) (llvm/trunk 327527)
Target: x86_64-pc-linux
Thread model: posix
InstalledDir: /usr/local/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-7.0: note: diagnostic msg: Error generating preprocessed source(s).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180314/1324b77f/attachment.html>


More information about the llvm-bugs mailing list