android / ndk

The Android Native Development Kit
2k stars 257 forks source link

[BUG] build error: clang frontend command failed with exit code 139 (use -v to see invocation) #1889

Closed gcd0318 closed 1 year ago

gcd0318 commented 1 year ago

Description

[ 55% 74667/134043] //frameworks/proto_logging/stats:libstats_proto_host clang++ proto/frameworks/proto_logging/stats/atoms.pb.cc [linux_glibc] FAILED: out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/obj/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.o PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++ -c -Wa,--noexecstack -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -DSTDC_FORMAT_MACROS -DSTDC_CONSTANT_MACROS --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/sysroot -fstack-protector-strong -m64 -DANDROID -DANDROID_12 -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wunreachable-code-loop-increment -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fdebug-info-for-profiling -fno-strict-aliasing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -Werror=string-plus-int -Werror=unreachable-code-loop-increment -fdebug-prefix-map=/proc/self/cwd= -Dcompiler_offsetof=__builtin_offsetof -faddrsig -fcommon -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-gnu-folding-constant -Wunguarded-availability -DANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -Wno-enum-compare -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-null-dereference -Wno-pointer-compare -Wno-xor-used-as-pow -Wno-final-dtor-non-final-class -Wno-psabi -target x86_64-linux-gnu -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/x86_64-linux/bin -DANDROID_STRICT -fPIC -Wsign-promo -Wimplicit-fallthrough -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-gnu-include-next -Iframeworks/proto_logging/stats -Iout/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats -Iout/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto -Iexternal/protobuf/src -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Wall -Werror -DGOOGLE_PROTOBUF_NO_RTTI -std=gnu++17 -nostdinc++ -Isystem/core/include -Isystem/logging/liblog/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -Werror=bool-operation -Werror=implicit-int-float-conversion -Werror=int-in-bool-context -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=string-compare -Werror=xor-used-as-pow -Wno-void-pointer-to-enum-cast -Wno-void-pointer-to-int-cast -Wno-pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-int-in-bool-context -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-misleading-indentation -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-string-compare -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-pessimizing-move -Wno-non-c-typedef-for-linkage -Wno-string-concatenation -MD -MF out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/obj/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.o.d -o out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/obj/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.o out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.cc PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace, preprocessed source, and associated run script. Stack dump:

  1. Program arguments: prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real -c -Wa,--noexecstack -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -DSTDC_FORMAT_MACROS -DSTDC_CONSTANT_MACROS --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8 --sysroot prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/sysroot -fstack-protector-strong -m64 -DANDROID -DANDROID_12 -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wunreachable-code-loop-increment -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fdebug-info-for-profiling -fno-strict-aliasing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -Werror=string-plus-int -Werror=unreachable-code-loop-increment -fdebug-prefix-map=/proc/self/cwd= -Dcompiler_offsetof=__builtin_offsetof -faddrsig -fcommon -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-gnu-folding-constant -Wunguarded-availability -DANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -Wno-enum-compare -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-null-dereference -Wno-pointer-compare -Wno-xor-used-as-pow -Wno-final-dtor-non-final-class -Wno-psabi -target x86_64-linux-gnu -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/x86_64-linux/bin -DANDROID_STRICT -fPIC -Wsign-promo -Wimplicit-fallthrough -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-gnu-include-next -Iframeworks/proto_logging/stats -Iout/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats -Iout/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto -Iexternal/protobuf/src -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Wall -Werror -DGOOGLE_PROTOBUF_NO_RTTI -std=gnu++17 -nostdinc++ -Isystem/core/include -Isystem/logging/liblog/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -Werror=bool-operation -Werror=implicit-int-float-conversion -Werror=int-in-bool-context -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=string-compare -Werror=xor-used-as-pow -Wno-void-pointer-to-enum-cast -Wno-void-pointer-to-int-cast -Wno-pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-int-in-bool-context -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-misleading-indentation -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-string-compare -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-pessimizing-move -Wno-non-c-typedef-for-linkage -Wno-string-concatenation -MD -MF out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/obj/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.o.d -o out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/obj/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.o out/soong/.intermediates/frameworks/proto_logging/stats/libstats_proto_host/linux_glibc_x86_64_shared/gen/proto/frameworks/proto_logging/stats/atoms.pb.cc
  2. parser at end of file
  3. Optimizer

    0 0x0000000003fba0e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x3fba0e8)

    1 0x0000000003fb9f70 llvm::sys::RunSignalHandlers() (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x3fb9f70)

    2 0x0000000003f86c53 (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x3f86c53)

    3 0x0000000003f86e51 (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x3f86e51)

    4 0x00007f05ab01cab0 (/usr/lib/libc.so.6+0x39ab0)

    5 0x00000000053ac46a (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x53ac46a)

    6 0x00000000026d0d6b llvm::AnalysisManager::invalidate(llvm::Function&, llvm::PreservedAnalyses const&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x26d0d6b)

    7 0x00000000031ed349 llvm::InnerAnalysisManagerProxy<llvm::AnalysisManager, llvm::Module>::Result::invalidate(llvm::Module&, llvm::PreservedAnalyses const&, llvm::AnalysisManager::Invalidator&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x31ed349)

    8 0x0000000002f14318 llvm::AnalysisManager::invalidate(llvm::Module&, llvm::PreservedAnalyses const&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f14318)

    9 0x0000000002f13cf5 llvm::PassManager<llvm::Module, llvm::AnalysisManager >::run(llvm::Module&, llvm::AnalysisManager&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f13cf5)

    10 0x0000000002f13698 llvm::ModuleInlinerWrapperPass::run(llvm::Module&, llvm::AnalysisManager&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f13698)

    11 0x0000000002f134bd (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f134bd)

    12 0x0000000002f13bad llvm::PassManager<llvm::Module, llvm::AnalysisManager >::run(llvm::Module&, llvm::AnalysisManager&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f13bad)

    13 0x000000000340e192 (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x340e192)

    14 0x000000000340c99f clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete >) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x340c99f)

    15 0x000000000340c170 (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x340c170)

    16 0x00000000030c734f clang::ParseAST(clang::Sema&, bool, bool) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x30c734f)

    17 0x00000000032420fd clang::FrontendAction::Execute() (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x32420fd)

    18 0x0000000003241ac8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x3241ac8)

    19 0x000000000323f06f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x323f06f)

    20 0x000000000323d669 cc1_main(llvm::ArrayRef<char const>, char const, void*) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x323d669)

    21 0x00000000038a5de7 (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x38a5de7)

    22 0x0000000005364b82 clang::driver::CC1Command::setEnvironment(llvm::ArrayRef<char const*>) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x5364b82)

    23 0x00000000034faf85 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x34faf85)

    24 0x00000000034fad45 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional >, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, bool) const (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x34fad45)

    25 0x0000000003310564 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x3310564)

    26 0x0000000002f9a1f1 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*> >&) (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f9a1f1)

    27 0x0000000002f95312 main (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x2f95312)

    28 0x00007f05ab006850 (/usr/lib/libc.so.6+0x23850)

    29 0x00007f05ab00690a __libc_start_main (/usr/lib/libc.so.6+0x2390a)

    30 0x0000000005283ca9 _start (prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang++.real+0x5283ca9)

    clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation) Android (7485623, based on r416183b1) clang version 12.0.7 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: prebuilts/clang/host/linux-x86/clang-r416183b1/bin clang++: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang++: note: diagnostic msg: /mnt/sdb1/rock-android12/out/soong/.temp/atoms-b9e8ed.cpp clang++: note: diagnostic msg: /mnt/sdb1/rock-android12/out/soong/.temp/atoms-b9e8ed.sh clang++: note: diagnostic msg:


03:43:59 ninja failed with: exit status 1

failed to build some targets (58:24 (mm:ss))

Affected versions

r25

Canary version

No response

Host OS

Linux

Host OS version

Linux nuc10i7 6.3.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 11 May 2023 16:40:42 +0000 x86_64 GNU/Linux

Affected ABIs

arm64-v8a

Build system

ndk-build

Other build system

No response

minSdkVersion

31

Device API level

No response

pirama-arumuga-nainar commented 1 year ago

Please share the files mentioned below:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /mnt/sdb1/rock-android12/out/soong/.temp/atoms-b9e8ed.cpp
clang++: note: diagnostic msg: /mnt/sdb1/rock-android12/out/soong/.temp/atoms-b9e8ed.sh
clang++: note: diagnostic msg:
gcd0318 commented 1 year ago

atoms-b9e8ed.zip attached as zip

gcd0318 commented 1 year ago

Please share the files mentioned below:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /mnt/sdb1/rock-android12/out/soong/.temp/atoms-b9e8ed.cpp
clang++: note: diagnostic msg: /mnt/sdb1/rock-android12/out/soong/.temp/atoms-b9e8ed.sh
clang++: note: diagnostic msg:

Yes I added attachement

pirama-arumuga-nainar commented 1 year ago

The crash doesn't reproduce for me. Looks like you're be building Android platform. It's likely your build machine was OOM-ing. This source file is particularly large.