Skip to content
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

[Linux][Build][Itanium] Abort build in clang 4.0.0 #2980

Open
yumetodo opened this issue May 17, 2017 · 11 comments
Open

[Linux][Build][Itanium] Abort build in clang 4.0.0 #2980

yumetodo opened this issue May 17, 2017 · 11 comments

Comments

@yumetodo
Copy link

yumetodo commented May 17, 2017

Build log

$ ./build.sh --cxx=/usr/local/bin/clang++-4.0 --cc=/usr/local/bin/clang-4.0 --valgrind --lto-thin -j=1 -n
lto: ranlib disabled
Custom CXX /usr/local/bin/clang++-4.0
Custom CC  /usr/local/bin/clang-4.0
Build path: ./out/Release
-- ./bin/ch/DbgController.js.h is up to date. skipping.
Compile Target : System Default
Generating Release makefiles
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yumetodo/ドキュメント/ChakraCore/out/Release
[1/309] Building CXX object lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o
FAILED: /usr/local/bin/clang++-4.0   -DBIT64=1 -DCAN_BUILD_WABT -DCLANG_HAS_DISABLE_TAIL_CALLS=1 -DENABLE_VALGRIND=1 -DFEATURE_PAL -DHAS_REAL_ICU=1 -DLINUX64 -DNO_PAL_MINMAX -DPAL_STDCPP_COMPAT -DPLATFORM_UNIX=1 -DSTACK_ALIGN=16 -DUNICODE -D_AMD64_ -D_M_AMD64 -D_M_X64 -D_M_X64_OR_ARM64 -D_SAFECRT_USE_CPP_OVERLOADS=1 -D__LINUX__=1 -D__STDC_WANT_LIB_EXT1__=1 -I../../. -I../../lib/Common -I../../lib/Common/PlaceHolder -I../../pal -I../../pal/inc -I../../pal/inc/rt -I../../lib/Runtime/. -I../../lib/Runtime/../JITIDL -I../../lib/Runtime/../Common -I../../lib/Runtime/../Backend -I../../lib/Runtime/../Parser -I../../lib/Runtime/../WasmReader -I../../lib/Runtime/ByteCode -I../../lib/Runtime/PlatformAgnostic -I../../lib/Runtime/Math -Werror         -Wno-ignored-attributes        -Wno-deprecated-declarations        -Wno-parentheses-equality        -Wno-missing-braces        -Wno-reorder        -Wno-microsoft        -Wno-unused-value        -Wno-int-to-void-pointer-cast        -Wno-invalid-offsetof        -Wno-undefined-inline        -Wno-inconsistent-missing-override        -Wno-c++14-extensions        -Wno-macro-redefined        -Wno-pragmas        -Wno-invalid-token-paste        -Wno-format        -Wno-invalid-noreturn        -Wno-null-arithmetic        -Wno-tautological-constant-out-of-range-compare        -Wno-tautological-undefined-compare        -Wno-address-of-temporary        -Wno-null-conversion        -Wno-return-type        -Wno-switch        -Wno-implicit-function-declaration        -Wno-int-to-pointer-cast                  -fno-omit-frame-pointer         -fdelayed-template-parsing -O3 -DNDEBUG   -fdiagnostics-color=always -msse4.2 -fasm-blocks -fms-extensions -fwrapv -flto=thin -O3 -fPIC -std=gnu++11 -MMD -MT lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o -MF lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o.d -o lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o -c ../../lib/Runtime/ByteCode/ByteCodeSerializer.cpp
clang-4.0: /home/yumetodo/clang_build/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:4496: void {anonymous}::CXXNameMangler::addSubstitution(uintptr_t): Assertion `!Substitutions.count(Ptr) && "Substitution already exists!"' failed.
#0 0x0000000001f6c148 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x1f6c148)
#1 0x0000000001f69b5e llvm::sys::RunSignalHandlers() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x1f69b5e)
#2 0x0000000001f69f62 SignalHandler(int) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x1f69f62)
#3 0x00007f57ac83d390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f57ab5b0428 gsignal /build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f57ab5b202a abort /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f57ab5a8bd7 __assert_fail_base /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0
#7 0x00007f57ab5a8c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x00000000037e5070 (anonymous namespace)::CXXNameMangler::addSubstitution(unsigned long) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e5070)
#9 0x00000000037ed239 (anonymous namespace)::CXXNameMangler::mangleType(clang::QualType) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37ed239)
#10 0x00000000037efb3d (anonymous namespace)::CXXNameMangler::mangleTemplateArg(clang::TemplateArgument) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37efb3d)
#11 0x00000000037effe9 (anonymous namespace)::CXXNameMangler::mangleTemplateArgs(clang::TemplateArgumentList const&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37effe9)
#12 0x00000000037f01ab (anonymous namespace)::CXXNameMangler::manglePrefix(clang::DeclContext const*, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37f01ab)
#13 0x00000000037f089f (anonymous namespace)::CXXNameMangler::mangleNestedName(clang::NamedDecl const*, clang::DeclContext const*, llvm::SmallVector<llvm::StringRef, 4u> const*, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37f089f)
#14 0x00000000037e8a67 (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags(clang::NamedDecl const*, llvm::SmallVector<llvm::StringRef, 4u> const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e8a67)
#15 0x00000000037e67d5 (anonymous namespace)::CXXNameMangler::mangleName(clang::NamedDecl const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e67d5)
#16 0x00000000037e8bc1 (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding(clang::FunctionDecl const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e8bc1)
#17 0x00000000037ea234 (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXDtor(clang::CXXDestructorDecl const*, clang::CXXDtorType, llvm::raw_ostream&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37ea234)
#18 0x00000000021a45a9 clang::CodeGen::CodeGenModule::getMangledName(clang::GlobalDecl) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21a45a9)
#19 0x00000000021bf1cc clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21bf1cc)
#20 0x00000000021f0065 (anonymous namespace)::ItaniumCXXABI::EmitCXXConstructors(clang::CXXConstructorDecl const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21f0065)
#21 0x00000000021bf924 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21bf924)
#22 0x00000000027e58c7 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x27e58c7)
#23 0x00000000027dc943 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x27dc943)
#24 0x0000000003278a35 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x3278a35)
#25 0x00000000032778fc clang::Sema::PerformPendingInstantiations(bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x32778fc)
#26 0x0000000002e0973c clang::Sema::ActOnEndOfTranslationUnit() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2e0973c)
#27 0x0000000002bf6696 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2bf6696)
#28 0x0000000002bed29b clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2bed29b)
#29 0x00000000027dd868 clang::CodeGenAction::ExecuteAction() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x27dd868)
#30 0x00000000024a5d46 clang::FrontendAction::Execute() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x24a5d46)
#31 0x000000000247269e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x247269e)
#32 0x0000000002533f1d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2533f1d)
#33 0x0000000000af4b28 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0xaf4b28)
#34 0x0000000000a7d34d main (/usr/local/llvm-4.0.0/bin/clang-4.0+0xa7d34d)
#35 0x00007f57ab59b830 __libc_start_main /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0
#36 0x0000000000af0df9 _start (/usr/local/llvm-4.0.0/bin/clang-4.0+0xaf0df9)
Stack dump:
0.	Program arguments: /usr/local/llvm-4.0.0/bin/clang-4.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -flto=thin -disable-free -main-file-name ByteCodeSerializer.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-feature +sse4.2 -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/yumetodo/ドキュメント/ChakraCore/out/Release/lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.gcno -resource-dir /usr/local/llvm-4.0.0/bin/../lib/clang/4.0.0 -dependency-file lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o.d -MT lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o -D BIT64=1 -D CAN_BUILD_WABT -D CLANG_HAS_DISABLE_TAIL_CALLS=1 -D ENABLE_VALGRIND=1 -D FEATURE_PAL -D HAS_REAL_ICU=1 -D LINUX64 -D NO_PAL_MINMAX -D PAL_STDCPP_COMPAT -D PLATFORM_UNIX=1 -D STACK_ALIGN=16 -D UNICODE -D _AMD64_ -D _M_AMD64 -D _M_X64 -D _M_X64_OR_ARM64 -D _SAFECRT_USE_CPP_OVERLOADS=1 -D __LINUX__=1 -D __STDC_WANT_LIB_EXT1__=1 -I ../../. -I ../../lib/Common -I ../../lib/Common/PlaceHolder -I ../../pal -I ../../pal/inc -I ../../pal/inc/rt -I ../../lib/Runtime/. -I ../../lib/Runtime/../JITIDL -I ../../lib/Runtime/../Common -I ../../lib/Runtime/../Backend -I ../../lib/Runtime/../Parser -I ../../lib/Runtime/../WasmReader -I ../../lib/Runtime/ByteCode -I ../../lib/Runtime/PlatformAgnostic -I ../../lib/Runtime/Math -D NDEBUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/local/llvm-4.0.0/bin/../lib/clang/4.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wno-parentheses-equality -Wno-missing-braces -Wno-reorder -Wno-microsoft -Wno-unused-value -Wno-int-to-void-pointer-cast -Wno-invalid-offsetof -Wno-undefined-inline -Wno-inconsistent-missing-override -Wno-c++14-extensions -Wno-macro-redefined -Wno-pragmas -Wno-invalid-token-paste -Wno-format -Wno-invalid-noreturn -Wno-null-arithmetic -Wno-tautological-constant-out-of-range-compare -Wno-tautological-undefined-compare -Wno-address-of-temporary -Wno-null-conversion -Wno-return-type -Wno-switch -Wno-implicit-function-declaration -Wno-int-to-pointer-cast -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir /home/yumetodo/ドキュメント/ChakraCore/out/Release -ferror-limit 19 -fmessage-length 0 -fwrapv -fms-extensions -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -fasm-blocks -vectorize-loops -vectorize-slp -o lib/Runtime/ByteCode/CMakeFiles/Chakra.Runtime.ByteCode.dir/ByteCodeSerializer.cpp.o -x c++ ../../lib/Runtime/ByteCode/ByteCodeSerializer.cpp 
1.	<eof> parser at end of file
2.	../../lib/Common/DataStructures/BufferBuilder.h:213:9: instantiating function definition 'Js::ConstantSizedBufferBuilderOf<__unaligned Js::SerializedVarArray>::ConstantSizedBufferBuilderOf'
3.	../../lib/Common/DataStructures/BufferBuilder.h:213:9: LLVM IR generation of declaration 'Js::ConstantSizedBufferBuilderOf<__unaligned Js::SerializedVarArray>::ConstantSizedBufferBuilderOf'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 4.0.0 (http://llvm.org/git/clang.git 559aa046fe3260d8640791f2249d7b0d458b5700) (http://llvm.org/git/llvm.git 4423e351176a92975739dd4ea43c2ff5877236ae)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-4.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-4.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/ByteCodeSerializer-8f9b6c.cpp
clang-4.0: note: diagnostic msg: /tmp/ByteCodeSerializer-8f9b6c.sh
clang-4.0: note: diagnostic msg: 

********************
ninja: build stopped: subcommand failed.
See error details above. Exit code was 1

Environment

$ uname -a
Linux yumetodo-desktop 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ /usr/local/bin/clang-4.0 --version
clang version 4.0.0 (http://llvm.org/git/clang.git 559aa046fe3260d8640791f2249d7b0d458b5700) (http://llvm.org/git/llvm.git 4423e351176a92975739dd4ea43c2ff5877236ae)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
$ git log -n 1 | cat
commit 357fe4c954d776a2d40c6a9ac65931ec31585f46
Merge: 7f5755f 82ff317
Author: Meghana Gupta <megupta@microsoft.com>
Date:   Tue May 16 18:36:00 2017 -0700

    [MERGE #2954 @meg-gupta] Enable globopt for functions with try finally
    
    Merge pull request #2954 from meg-gupta:tryfinallypr
    
    This change enables globopt on functions with try finally.
    We transform the flowgraph such that we have 2 flow edges -
    try to a excepting finally region and try to non excepting finally region.
    This enables us to optimize the function on the non exception path.
    We bailout on the exception path.
    
    Special handling is needed when there are early exits (break, continue, return) within the tryfinally.
    We need to execute the finally block on early exit, currently we bailout on early exit.
    We transform the flow graph from (eh region -> early exit) to have an edge from  (eh region -> finally) and (finally -> early exit)
    This transformation can be done only after the regions are assigned in FlowGraph.
    
    So the flowgraph builder now has the following order of phase:
    
    - build flow graph -> add the excepting and non excepting finallys alongside
    - remove unreachable blocks
    - assign regions
    - identify early exits and add edges (does region info update when required)
    - break blocks removal (does region info update when required)

@yumetodo
Copy link
Author

@obastemur
Copy link
Collaborator

Looks like this is a Clang/LLVM issue.

Interestingly, I did the tests with Clang 4.0 (I'd compiled it from the source codes).
It's available on this repo. Try tools/compile_clang.sh

If you have a chance, could you please try with that ?

@yumetodo
Copy link
Author

yumetodo commented May 18, 2017

git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils >/dev/null 2>&1

I missed to compile that...

https://gist.githubusercontent.com/yumetodo/3667315003256630c24daa6ec83a7f6c/raw/74131e22529593c1e8b7755a3095f809b4dbbb5f/clang_build_log.txt
https://gist.githubusercontent.com/yumetodo/3667315003256630c24daa6ec83a7f6c/raw/74131e22529593c1e8b7755a3095f809b4dbbb5f/CMakeCache.txt

This is the log when I compile Clang/LLVM(tooooo long!).

Should I recompile Clang/LLVM to investigate?

@obastemur
Copy link
Collaborator

obastemur commented May 18, 2017

Should I recompile Clang/LLVM to investigate?

Yes, it could be nice if you may compile it via tools/compile_clang.sh and use (it will print the instructions after the compile)

Thanks!

@obastemur obastemur self-assigned this May 18, 2017
@obastemur
Copy link
Collaborator

BTW; better call that script with 'sudo'. Because it may install some missing dependencies required to compile LLVM

@yumetodo
Copy link
Author

Yes, it could be nice if you may compile it via tools/compile_clang.sh and use (it will print the instructions after the compile)

OK.

BTW, as far as I know, --lto-thin requires the LLVM gold plugin so that you suggest me to recompile Clang/LLVM.
Now, I remove --lto-thin option. Then, totally same error was produced.

@obastemur
Copy link
Collaborator

Thanks for confirming, I'm working on a potential fix on our end

@obastemur
Copy link
Collaborator

Can you try without -n ?

I think the error you have is due to

  • dirty out folder. rm -rf out?
  • -n try without ninja build
  • --lto and --lto-thin requires LLVM Gold support. Use Clang/LLVM from ChakraCore's build

Making sure the steps above, I don't get error.

@yumetodo
Copy link
Author

https://bugs.llvm.org/show_bug.cgi?id=33080#c3

Richard Smith 2017-05-19 12:51:33 PDT

Thanks. Reduced testcase:

void f(__unaligned struct A*) {}

... compiled with -fms-extensions targeting an Itanium ABI platform.

Roger, looks like you've fixed a bunch of other Itanium __unaligned mangling bugs, can you take a look?

According to the build log, -fms-extensions option is applied. What was happen...?

@obastemur
Copy link
Collaborator

@yumetodo I don't have a nearby Itanium based system for Clang4.0 workaround.

Can you please comment-out ByteCodeSerializer.cpp and see if compile will be successful. It will fail on linkage but if commenting out the codes in this file is enough to pass clang crash, that could help me to narrow down the workaround.

Thanks!

@yumetodo
Copy link
Author

yumetodo commented May 25, 2017

notice: All investigation is targeting e8ed687

  • dirty out folder. rm -rf out?
  • -n try without ninja build
  • --lto and --lto-thin requires LLVM Gold support. Use Clang/LLVM from ChakraCore's build

Produce same error.
https://pastebin.com/raw/MB1siMLJ

Can you please comment-out ByteCodeSerializer.cpp

Produce another clang abort detected.

clang-4.0: /home/yumetodo/clang_build/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:4496: void {anonymous}::CXXNameMangler::addSubstitution(uintptr_t): Assertion `!Substitutions.count(Ptr) && "Substitution already exists!"' failed.
#0 0x0000000001f6c148 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x1f6c148)
#1 0x0000000001f69b5e llvm::sys::RunSignalHandlers() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x1f69b5e)
#2 0x0000000001f69f62 SignalHandler(int) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x1f69f62)
#3 0x00007f3214dfe390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f3213b71428 gsignal /build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f3213b7302a abort /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f3213b69bd7 __assert_fail_base /build/glibc-9tT8Do/glibc-2.23/assert/assert.c:92:0
#7 0x00007f3213b69c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x00000000037e5070 (anonymous namespace)::CXXNameMangler::addSubstitution(unsigned long) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e5070)
#9 0x00000000037ed239 (anonymous namespace)::CXXNameMangler::mangleType(clang::QualType) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37ed239)
#10 0x00000000037efb3d (anonymous namespace)::CXXNameMangler::mangleTemplateArg(clang::TemplateArgument) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37efb3d)
#11 0x00000000037effe9 (anonymous namespace)::CXXNameMangler::mangleTemplateArgs(clang::TemplateArgumentList const&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37effe9)
#12 0x00000000037f06d9 (anonymous namespace)::CXXNameMangler::mangleNestedName(clang::NamedDecl const*, clang::DeclContext const*, llvm::SmallVector const*, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37f06d9)
#13 0x00000000037e8a67 (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags(clang::NamedDecl const*, llvm::SmallVector const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e8a67)
#14 0x00000000037e67d5 (anonymous namespace)::CXXNameMangler::mangleName(clang::NamedDecl const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e67d5)
#15 0x00000000037e8bc1 (anonymous namespace)::CXXNameMangler::mangleFunctionEncoding(clang::FunctionDecl const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37e8bc1)
#16 0x00000000037ea436 (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXName(clang::NamedDecl const*, llvm::raw_ostream&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x37ea436)
#17 0x00000000021a480f clang::CodeGen::CodeGenModule::getMangledName(clang::GlobalDecl) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21a480f)
#18 0x00000000021a8e37 clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl, llvm::Type*, bool, bool, clang::CodeGen::ForDefinition_t) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21a8e37)
#19 0x00000000022d45c5 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool, clang::NestedNameSpecifier*, bool, clang::Expr const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22d45c5)
#20 0x00000000022d4984 clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(clang::CXXMemberCallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22d4984)
#21 0x00000000022c7b42 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22c7b42)
#22 0x00000000008db5b9 (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x8db5b9)
#23 0x00000000022eccf8 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22eccf8)
#24 0x00000000022ed6b3 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22ed6b3)
#25 0x00000000022ad7fe clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22ad7fe)
#26 0x00000000022c0095 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x22c0095)
#27 0x00000000021556d9 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21556d9)
#28 0x000000000215683f clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x215683f)
#29 0x0000000002156a9c clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2156a9c)
#30 0x0000000002159953 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2159953)
#31 0x0000000002155685 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2155685)
#32 0x00000000021594c8 clang::CodeGen::CodeGenFunction::EmitCaseStmt(clang::CaseStmt const&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21594c8)
#33 0x0000000002159990 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2159990)
#34 0x0000000002155685 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2155685)
#35 0x000000000215683f clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x215683f)
#36 0x0000000002156a9c clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2156a9c)
#37 0x0000000002159953 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2159953)
#38 0x0000000002155685 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2155685)
#39 0x0000000002159fc0 clang::CodeGen::CodeGenFunction::EmitSwitchStmt(clang::SwitchStmt const&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2159fc0)
#40 0x0000000002155d7f clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2155d7f)
#41 0x000000000215683f clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x215683f)
#42 0x000000000218085e clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&, clang::Stmt const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x218085e)
#43 0x000000000218c491 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x218c491)
#44 0x00000000021adb60 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21adb60)
#45 0x00000000021be35f clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21be35f)
#46 0x00000000021bf248 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21bf248)
#47 0x00000000021bf981 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21bf981)
#48 0x00000000021c05df clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21c05df)
#49 0x00000000021bfab6 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x21bfab6)
#50 0x00000000027e58c7 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x27e58c7)
#51 0x00000000027dc943 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x27dc943)
#52 0x0000000002bed2b6 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2bed2b6)
#53 0x00000000027dd868 clang::CodeGenAction::ExecuteAction() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x27dd868)
#54 0x00000000024a5d46 clang::FrontendAction::Execute() (/usr/local/llvm-4.0.0/bin/clang-4.0+0x24a5d46)
#55 0x000000000247269e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x247269e)
#56 0x0000000002533f1d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0x2533f1d)
#57 0x0000000000af4b28 cc1_main(llvm::ArrayRef, char const*, void*) (/usr/local/llvm-4.0.0/bin/clang-4.0+0xaf4b28)
#58 0x0000000000a7d34d main (/usr/local/llvm-4.0.0/bin/clang-4.0+0xa7d34d)
#59 0x00007f3213b5c830 __libc_start_main /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0
#60 0x0000000000af0df9 _start (/usr/local/llvm-4.0.0/bin/clang-4.0+0xaf0df9)
Stack dump:
0.	Program arguments: /usr/local/llvm-4.0.0/bin/clang-4.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name AsmJsEncoder.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-feature +sse4.2 -momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/yumetodo/ドキュメント/ChakraCore/out/Release/lib/Runtime/Language/CMakeFiles/Chakra.Runtime.Language.dir/AsmJsEncoder.cpp.gcno -resource-dir /usr/local/llvm-4.0.0/bin/../lib/clang/4.0.0 -D BIT64=1 -D CAN_BUILD_WABT -D CLANG_HAS_DISABLE_TAIL_CALLS=1 -D ENABLE_VALGRIND=1 -D FEATURE_PAL -D HAS_REAL_ICU=1 -D LINUX64 -D NO_PAL_MINMAX -D PAL_STDCPP_COMPAT -D PLATFORM_UNIX=1 -D STACK_ALIGN=16 -D UNICODE -D _AMD64_ -D _ENABLE_DYNAMIC_THUNKS=1 -D _M_AMD64 -D _M_X64 -D _M_X64_OR_ARM64 -D _SAFECRT_USE_CPP_OVERLOADS=1 -D __LINUX__=1 -D __STDC_WANT_LIB_EXT1__=1 -I /home/yumetodo/ドキュメント/ChakraCore/. -I /home/yumetodo/ドキュメント/ChakraCore/lib/Common -I /home/yumetodo/ドキュメント/ChakraCore/lib/Common/PlaceHolder -I /home/yumetodo/ドキュメント/ChakraCore/pal -I /home/yumetodo/ドキュメント/ChakraCore/pal/inc -I /home/yumetodo/ドキュメント/ChakraCore/pal/inc/rt -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/. -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/../JITIDL -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/../Common -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/../Backend -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/../Parser -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/../WasmReader -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/ByteCode -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/PlatformAgnostic -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Math -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/../Math -I /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language -D NDEBUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/local/llvm-4.0.0/bin/../lib/clang/4.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Werror -Wno-ignored-attributes -Wno-deprecated-declarations -Wno-parentheses-equality -Wno-missing-braces -Wno-reorder -Wno-microsoft -Wno-unused-value -Wno-int-to-void-pointer-cast -Wno-invalid-offsetof -Wno-undefined-inline -Wno-inconsistent-missing-override -Wno-c++14-extensions -Wno-macro-redefined -Wno-pragmas -Wno-invalid-token-paste -Wno-format -Wno-invalid-noreturn -Wno-null-arithmetic -Wno-tautological-constant-out-of-range-compare -Wno-tautological-undefined-compare -Wno-address-of-temporary -Wno-null-conversion -Wno-return-type -Wno-switch -Wno-implicit-function-declaration -Wno-int-to-pointer-cast -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir /home/yumetodo/ドキュメント/ChakraCore/out/Release/lib/Runtime/Language -ferror-limit 19 -fmessage-length 0 -fwrapv -fms-extensions -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -fasm-blocks -vectorize-loops -vectorize-slp -o CMakeFiles/Chakra.Runtime.Language.dir/AsmJsEncoder.cpp.o -x c++ /home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoder.cpp 
1.	/home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoder.cpp:304:2: current parser token ';'
2.	/home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoder.cpp:20:11: LLVM IR generation of declaration 'Js'
3.	/home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoder.cpp:29:24: Generating code for declaration 'Js::AsmJsEncoder::ReadOpTemplate'
4.	/home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoder.cpp:32:9: LLVM IR generation of compound statement ('{}')
5.	/home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoderHandler.inl:45:3 : LLVM IR generation of compound statement ('{}')
6.	/home/yumetodo/ドキュメント/ChakraCore/lib/Runtime/Language/AsmJsEncoder.inl:150:24: Mangling declaration 'Js::AsmJsEncoder::OP_Empty'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 4.0.0 (http://llvm.org/git/clang.git 559aa046fe3260d8640791f2249d7b0d458b5700) (http://llvm.org/git/llvm.git 4423e351176a92975739dd4ea43c2ff5877236ae)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-4.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-4.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/AsmJsEncoder-9c455b.cpp
clang-4.0: note: diagnostic msg: /tmp/AsmJsEncoder-9c455b.sh
clang-4.0: note: diagnostic msg:

********************

https://pastebin.com/raw/58fzHzSy


https://bugs.llvm.org/show_bug.cgi?id=33080#c4
Roger Ferrer Ibanez 2017-05-22 02:37:27 PDT
Sure, I suggest the following fix.

https://reviews.llvm.org/D33398

Kind regards.

@obastemur obastemur changed the title [Linux][Build] Abort build in clang 4.0.0 [Linux][Build][Itanium] Abort build in clang 4.0.0 May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants