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

[BUG]unable to execute command: Segmentation fault (core dumped) in android #1403

Closed
MasterLi186 opened this issue Dec 16, 2020 · 8 comments
Closed

Comments

@MasterLi186
Copy link

I compiled the o file in the android P code on ubuntu, and a clang error occurred and the compilation was interrupted.


[ 34% 24467/71543] //external/tensorflow/tensorflow/contrib/lite/kernels:libtflite_kernel_utils clang++ internal/tensor_utils.cc
FAILED: out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.o
PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++ -c -Iexternal/tensorflow/tensorflow/contrib/lite/kernels -mthumb -Os -fomit-frame-pointer -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -Wno-zero-as-null-pointer-constant -fdebug-prefix-map=$PWD/= -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -msoft-float -march=armv8-a -mfloat-abi=softfp -mfpu=neon-fp-armv8 -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -D__ARM_FEATURE_LPAE=1 -Iexternal/tensorflow -Iexternal/gemmlowp -Iexternal/libcxx/include -Iexternal/libcxxabi/include -Isystem/core/include -Isystem/media/audio/include -Ihardware/libhardware/include -Ihardware/libhardware_legacy/include -Ihardware/ril/include -Ilibnativehelper/include -Iframeworks/native/include -Iframeworks/native/opengl/include -Iframeworks/av/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -Ilibnativehelper/include_jni -Wall -Werror -Wextra -Wno-unused-parameter -Wno-extern-c-compat -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -fPIC -D_USING_LIBCXX -std=gnu++14 -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden -fno-rtti -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-null-pointer-arithmetic -Wno-enum-compare -Wno-enum-compare-switch -MD -MF out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.o.d -o out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.o external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.cc
#0 0x00000000014b9f84 (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x14b9f84)
#1 0x00000000014ba1b6 (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x14ba1b6)
#2 0x00007f1523fda390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#3 0x00000000011304e6 llvm::Use::zap(llvm::Use*, llvm::Use const*, bool) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x11304e6)
#4 0x0000000001130ac3 llvm::User::operator delete(void*) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1130ac3)
#5 0x00000000010de199 llvm::Instruction::eraseFromParent() (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x10de199)
#6 0x0000000001534f04 (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1534f04)
#7 0x0000000001533e84 llvm::PromoteMemToReg(llvm::ArrayRefllvm::AllocaInst*, llvm::DominatorTree&, llvm::AssumptionCache*) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1533e84)
#8 0x00000000014098a4 llvm::SROA::runImpl(llvm::Function&, llvm::DominatorTree&, llvm::AssumptionCache&) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x14098a4)
#9 0x0000000001413c53 (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1413c53)
#10 0x00000000010fea7b llvm::FPPassManager::runOnFunction(llvm::Function&) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x10fea7b)
#11 0x00000000010fe2f7 llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x10fe2f7)
#12 0x00000000010fe223 llvm::legacy::FunctionPassManager::run(llvm::Function&) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x10fe223)
#13 0x0000000001616392 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_deletellvm::raw_pwrite_stream >) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1616392)
#14 0x0000000001cad14c (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1cad14c)
#15 0x000000000213a7f6 clang::ParseAST(clang::Sema&, bool, bool) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x213a7f6)
#16 0x00000000019c4a5b clang::FrontendAction::Execute() (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x19c4a5b)
#17 0x0000000001972738 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1972738)
#18 0x0000000001a48cc4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x1a48cc4)
#19 0x00000000007b7db6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x7b7db6)
#20 0x00000000007b3f6d main (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x7b3f6d)
#21 0x00007f1522bb8840 __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:325:0
#22 0x00000000007b30b2 _start (prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real+0x7b30b2)
Stack dump:
0. Program arguments: prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++.real -cc1 -triple thumbv8--linux-android -emit-obj -mnoexecstack -disable-free -disable-llvm-verifier -discard-value-names -main-file-name tensor_utils.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu cortex-a53 -target-feature +soft-float-abi -target-feature +crc -target-feature +dsp -target-feature -ras -target-feature -dotprod -target-feature +hwdiv-arm -target-feature +hwdiv -target-feature -fp-only-sp -target-feature -d16 -target-feature +fp-armv8 -target-feature +neon -target-feature -crypto -target-abi aapcs-linux -mfloat-abi soft -fallow-half-arguments-and-returns -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -ffunction-sections -fdata-sections -coverage-notes-file /proc/self/cwd/out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.gcno -nostdsysteminc -resource-dir prebuilts/clang/host/linux-x86/clang-4691093/lib64/clang/6.0.2 -dependency-file out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.o.d -MT out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.o -sys-header-deps -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -I external/tensorflow/tensorflow/contrib/lite/kernels -D ANDROID -D NDEBUG -U DEBUG -D __compiler_offsetof=__builtin_offsetof -D _FORTIFY_SOURCE=2 -D __ARM_FEATURE_LPAE=1 -I external/tensorflow -I external/gemmlowp -I external/libcxx/include -I external/libcxxabi/include -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -I libnativehelper/include_jni -D _USING_LIBCXX -D _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -internal-isystem prebuilts/clang/host/linux-x86/clang-4691093/lib64/clang/6.0.2/include -O2 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wno-multichar -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -Wno-expansion-to-defined -Wno-zero-as-null-pointer-constant -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -Wall -Werror -Wextra -Wno-unused-parameter -Wno-extern-c-compat -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -Wno-thread-safety-negative -Wno-gnu-include-next -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-null-pointer-arithmetic -Wno-enum-compare -Wno-enum-compare-switch -std=gnu++14 -fdeprecated-macro -fdebug-compilation-dir /proc/self/cwd -fdebug-prefix-map=/proc/self/cwd= -fdebug-prefix-map=/home/lfl/project/android_mtk_p_mt6761_watch_2020004/= -ferror-limit 19 -fmessage-length 0 -fvisibility-inlines-hidden -femulated-tls -stack-protector 2 -fno-rtti -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o out/soong/.intermediates/external/tensorflow/tensorflow/contrib/lite/kernels/libtflite_kernel_utils/android_arm_armv8-a_cortex-a53_core_static/obj/external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.o -x c++ external/tensorflow/tensorflow/contrib/lite/kernels/internal/tensor_utils.cc

  1. parser at end of file
  2. Per-function optimization
  3. Running pass 'SROA' on function '@_ZN6tflite12tensor_utils23ApplyActivationToVectorEPKfi21TfLiteFusedActivationPf'
    clang++.real: error: unable to execute command: Segmentation fault (core dumped)
    clang++.real: error: clang frontend command failed due to signal (use -v to see invocation)
    Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)
    Target: arm--linux-android
    Thread model: posix
    InstalledDir: prebuilts/clang/host/linux-x86/clang-4691093/bin
    clang++.real: 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++.real: note: diagnostic msg:

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++.real: note: diagnostic msg: /tmp/tensor_utils-6bc6cc.cpp
clang++.real: note: diagnostic msg: /tmp/tensor_utils-6bc6cc.sh
clang++.real: note: diagnostic msg:


tensor_utils-6bc6cc.zip

Environment Details

Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)

Target: arm--linux-android
Thread model: posix

  • Host OS: ubuntu 16.04 LTS
@stephenhines
Copy link
Collaborator

Can you attach the files it created along with the flags that you were using? It's unlikely that we're going to fix the Android P compiler, but if the bug is still in the latest NDK toolchain, we would fix it there.

@MasterLi186
Copy link
Author

the file “tensor_utils-6bc6cc.cpp” and “tensor_utils-6bc6cc.sh” are in “tensor_utils-6bc6cc.zip”. I have uploaded the attachment. The command I used is “make -j32 2>&1 |tee build.log ” This is the native command to compile android

@stephenhines
Copy link
Collaborator

Sorry I missed that attachment (not used to looking for it in the bug description on github). I did download the files, as well as the P compiler, and it works fine for me. We've seen crashes like this happen when a machine runs out of memory during particularly long builds (i.e. many processes running). Did you try running the build commands again? Does that shell script fail locally for you every time? While I am not on Ubuntu, I am on a Debian-based system.

@MasterLi186
Copy link
Author

tensor_utils-6bc6cc.zip

@MasterLi186
Copy link
Author

My computer has 64G of memory. When an error occurs, only 20G is used. The error of this file will not appear when I run it again, but an error of another o file will appear. The error message is the same. Both are clang++.real: error: unable to execute command: Segmentation fault (core dumped)
clang++.real: error: clang frontend command failed due to signal (use -v to see invocation)

@stephenhines
Copy link
Collaborator

Are you using ulimit or something else in your environment that might constrain execution, because when I try to use this exact compiler on those files (with the scripts attached), they run to completion with no segfault.

@MasterLi186
Copy link
Author

I compiled this code on intel’s cpu without error. I compiled it with amd 3950x and there would be such an error.I “make -j32” seven times last night to compile successfully. I don’t know if it’s the cpu problem

@enh-google
Copy link
Collaborator

i've certainly found "compiling lots of code" to be a good general test of system stability, though personally it's usually been dodgy RAM rather than a dodgy CPU. you might want to run memtest86...

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