llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.06k stars 11.98k forks source link

Segmentation fault (core dumped) #63814

Closed nonlin-lin-chaos-order-etc-etal closed 6 months ago

nonlin-lin-chaos-order-etc-etal commented 1 year ago

Script: : cat ./build_haven.sh

#!/bin/sh

. ./config.sh
HAVEN_VERSION=tags/v3.0.7
HAVEN_SRC_DIR=${WORKDIR}/haven

rm -rf ${HAVEN_SRC_DIR}
git clone https://github.com/haven-protocol-org/haven-main.git ${HAVEN_SRC_DIR}
cd $HAVEN_SRC_DIR
git checkout ${HAVEN_VERSION}
git submodule init
git submodule update

for arch in "aarch" "aarch64" "i686" "x86_64"
do
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Building arch $arch started"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
FLAGS=""
PREFIX=${WORKDIR}/prefix_${arch}
DEST_LIB_DIR=${PREFIX}/lib/haven
DEST_INCLUDE_DIR=${PREFIX}/include/haven
export CMAKE_INCLUDE_PATH="${PREFIX}/include"
export CMAKE_LIBRARY_PATH="${PREFIX}/lib"

mkdir -p $DEST_LIB_DIR
mkdir -p $DEST_INCLUDE_DIR

case $arch in
    "aarch" )
        ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_arm"
        PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
        CLANG=clang
        CXXLANG=clang++
        BUILD_64=OFF
        TAG="android-armv7"
        ARCH="armv7-a"
        ARCH_ABI="armeabi-v7a"
        FLAGS="-D CMAKE_ANDROID_ARM_MODE=ON -D NO_AES=true";;
    "aarch64"   )
        ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_arm64"
        PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
        CLANG=clang
        CXXLANG=clang++
        BUILD_64=ON
        TAG="android-armv8"
        ARCH="armv8-a"
        ARCH_ABI="arm64-v8a";;
    "i686"      )
        ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_x86"
        PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
        CLANG=clang
        CXXLANG=clang++
        BUILD_64=OFF
        TAG="android-x86"
        ARCH="i686"
        ARCH_ABI="x86";;
    "x86_64"    )  
        ANDROID_STANDALONE_TOOLCHAIN_PATH="${TOOLCHAIN_BASE_DIR}_x86_64"
        PATH="${ANDROID_STANDALONE_TOOLCHAIN_PATH}/bin:${ORIGINAL_PATH}"
        CLANG=clang
        CXXLANG=clang++
        BUILD_64=ON
        TAG="android-x86_64"
        ARCH="x86-64"
        ARCH_ABI="x86_64";;
esac

cd $HAVEN_SRC_DIR
rm -rf ./build/release
mkdir -p ./build/release
cd ./build/release
CC=${CLANG} CXX=${CXXLANG} cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH=${ARCH} -D STATIC=ON -D BUILD_64=${BUILD_64} -D CMAKE_BUILD_TYPE=release -D ANDROID=true -D INSTALL_VENDORED_LIBUNBOUND=ON -D BUILD_TAG=${TAG} -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_STANDALONE_TOOLCHAIN="${ANDROID_STANDALONE_TOOLCHAIN_PATH}" -D CMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} $FLAGS ../..

make wallet_api -j$THREADS
find . -path ./lib -prune -o -name '*.a' -exec cp '{}' lib \;

cp -r ./lib/* $DEST_LIB_DIR
cp ../../src/wallet/api/wallet2_api.h  $DEST_INCLUDE_DIR
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Building arch $arch done"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
done

Log:

Клонирование в «/home/user/vcs/ew-workdir/haven»...
...
Примечание: переключение на «tags/v3.0.7».
...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Building arch aarch64 started
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...
-- Looking for openssl/conf.h
-- Looking for openssl/conf.h - found
-- Looking for openssl/engine.h
-- Looking for openssl/engine.h - found
-- Looking for openssl/err.h
-- Looking for openssl/err.h - found
-- Looking for openssl/rand.h
-- Looking for openssl/rand.h - found
-- Looking for openssl/ssl.h
-- Looking for openssl/ssl.h - found
-- Looking for NID_secp384r1
-- Looking for NID_secp384r1 - found
-- Looking for NID_X9_62_prime256v1
-- Looking for NID_X9_62_prime256v1 - found
-- Looking for sk_SSL_COMP_pop_free
-- Looking for sk_SSL_COMP_pop_free - found
-- Looking for SSL_COMP_get_compression_methods
-- Looking for SSL_COMP_get_compression_methods - found
-- Looking for EVP_MD_CTX_new
-- Looking for EVP_MD_CTX_new - found
-- Looking for EVP_sha1
-- Looking for EVP_sha1 - found
-- Looking for EVP_sha256
-- Looking for EVP_sha256 - found
-- Looking for EVP_sha512
-- Looking for EVP_sha512 - found
-- Looking for FIPS_mode
-- Looking for FIPS_mode - found
-- Looking for HMAC_Update
-- Looking for HMAC_Update - found
-- Looking for OPENSSL_config
-- Looking for OPENSSL_config - found
-- Looking for SHA512_Update
-- Looking for SHA512_Update - found
...
[ 53%] Building C object external/unbound/CMakeFiles/unbound.dir/validator/val_nsec3.c.o
#0 0x00000000014b9f84 (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x14b9f84)
#1 0x00000000014ba1b6 (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x14ba1b6)
#2 0x000014fd86af4420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x000014fd864c96f0 cfree (/lib/x86_64-linux-gnu/libc.so.6+0x9a6f0)
#4 0x0000000000c8bd77 llvm::BasicAAWrapperPass::runOnFunction(llvm::Function&) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0xc8bd77)
#5 0x00000000010fea7b llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x10fea7b)
#6 0x0000000001e4db58 (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x1e4db58)
#7 0x00000000010ff164 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x10ff164)
#8 0x00000000016163ee 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<llvm::raw_pwrite_stream> >) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x16163ee)
#9 0x0000000001cad14c (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x1cad14c)
#10 0x000000000213a7f6 clang::ParseAST(clang::Sema&, bool, bool) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x213a7f6)
#11 0x00000000019c4a5b clang::FrontendAction::Execute() (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x19c4a5b)
#12 0x0000000001972738 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x1972738)
#13 0x0000000001a48cc4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x1a48cc4)
#14 0x00000000007b7db6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x7b7db6)
#15 0x00000000007b3f6d main (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x7b3f6d)
#16 0x000014fd86453083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#17 0x00000000007b30b2 _start (/home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60+++0x7b30b2)
Stack dump:
0.  Program arguments: /home/user/vcs/ew-workdir/toolchain_arm64/bin/clang60++ -cc1 -triple aarch64-none-linux-android -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name multiexp.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu generic -target-feature +neon -target-feature +crypto -target-abi aapcs -backend-option -aarch64-fix-cortex-a53-835769=1 -fallow-half-arguments-and-returns -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /home/user/vcs/ew-workdir/haven/build/release/src/ringct/CMakeFiles/obj_ringct_basic.dir/multiexp.cc.gcno -resource-dir /home/user/vcs/ew-workdir/toolchain_arm64/lib64/clang/6.0.2 -isystem /home/user/vcs/ew-workdir/prefix_aarch64/include -D __ANDROID_API__=21 -D AUTO_INITIALIZE_EASYLOGGINGPP -D BLOCKCHAIN_DB=DB_LMDB -D BUILD_TAG=android-armv8 -D DEFAULT_DB_TYPE="lmdb" -D HAVE_STRPTIME -D MINIUPNP_STATICLIB -D STATICLIB -I /home/user/vcs/ew-workdir/haven/external/rapidjson/include -I /home/user/vcs/ew-workdir/haven/external/easylogging++ -I /home/user/vcs/ew-workdir/haven/src -I /home/user/vcs/ew-workdir/haven/contrib/epee/include -I /home/user/vcs/ew-workdir/haven/external -I /home/user/vcs/ew-workdir/haven/build/release/translations -I /home/user/vcs/ew-workdir/haven/external/unbound/libunbound -I /home/user/vcs/ew-workdir/haven/external/db_drivers/liblmdb -D ZMQ_STATIC -D _GNU_SOURCE -D NDEBUG -isysroot /home/user/vcs/ew-workdir/toolchain_arm64/sysroot -internal-isystem /home/user/vcs/ew-workdir/toolchain_arm64/lib/gcc/aarch64-linux-android/4.9.x/../../../../include/c++/4.9.x -internal-isystem /home/user/vcs/ew-workdir/toolchain_arm64/lib/gcc/aarch64-linux-android/4.9.x/../../../../include/c++/4.9.x/aarch64-linux-android -internal-isystem /home/user/vcs/ew-workdir/toolchain_arm64/lib/gcc/aarch64-linux-android/4.9.x/../../../../include/c++/4.9.x/backward -internal-isystem /home/user/vcs/ew-workdir/toolchain_arm64/sysroot/usr/local/include -internal-isystem /home/user/vcs/ew-workdir/toolchain_arm64/lib64/clang/6.0.2/include -internal-externc-isystem /home/user/vcs/ew-workdir/toolchain_arm64/sysroot/include -internal-externc-isystem /home/user/vcs/ew-workdir/toolchain_arm64/sysroot/usr/include -O2 -Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wno-error=inline-asm -Wno-reorder -Wno-missing-field-initializers -Wformat -Wformat-security -Wno-error=user-defined-warnings -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/user/vcs/ew-workdir/haven/build/release/src/ringct -ftemplate-depth 900 -ferror-limit 19 -fmessage-length 211 -femulated-tls -pthread -stack-protector 2 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o CMakeFiles/obj_ringct_basic.dir/multiexp.cc.o -x c++ /home/user/vcs/ew-workdir/haven/src/ringct/multiexp.cc 
1.  <eof> parser at end of file
2.  Per-module optimization passes
3.  Running pass 'CallGraph Pass Manager' on module '/home/user/vcs/ew-workdir/haven/src/ringct/multiexp.cc'.
4.  Running pass 'Basic Alias Analysis (stateless AA impl)' on function[ 54%] Building C object external/unbound/CMakeFiles/unbound.dir/validator/val_nsec.c.o
 '@_ZNSt6__ndk119__libcpp_deallocateEPv'
...
clang60++: error: unable to execute command: Segmentation fault (core dumped)
clang60++: error: clang frontend command failed due to signal (use -v to see invocation)
[ 58%] Building C object external/unbound/CMakeFiles/unbound.dir/sldns/rrdef.c.o
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: aarch64-none-linux-android
Thread model: posix
InstalledDir: /home/user/vcs/ew-workdir/toolchain_arm64/bin
clang60++: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and
include the crash backtrace, preprocessed source, and associated run script.
[ 58%] Building C object external/unbound/CMakeFiles/unbound.dir/sldns/str2wire.c.o
[ 58%] Building C object external/unbound/CMakeFiles/unbound.dir/compat/explicit_bzero.c.o
[ 60%] Building C object external/unbound/CMakeFiles/unbound.dir/compat/reallocarray.c.o
[ 60%] Building C object external/unbound/CMakeFiles/unbound.dir/libunbound/context.c.o
clang60++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang60++: note: diagnostic msg: /tmp/multiexp-969998.cpp
clang60++: note: diagnostic msg: /tmp/multiexp-969998.sh
clang60++: note: diagnostic msg: 

********************
make[3]: *** [src/ringct/CMakeFiles/obj_ringct_basic.dir/multiexp.cc.o] Error 254
make[2]: *** [src/ringct/CMakeFiles/obj_ringct_basic.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
...
make[1]: *** [src/wallet/api/CMakeFiles/wallet_api.dir/rule] Error 2
make: *** [wallet_api] Error 2
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Building arch aarch64 done
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Attached:

clang60++: note: diagnostic msg: /tmp/multiexp-969998.cpp
clang60++: note: diagnostic msg: /tmp/multiexp-969998.sh

multiexp-969998.cpp_sh.tar.gz

nonlin-lin-chaos-order-etc-etal commented 1 year ago

two more scripts: maketoolchains_sh_config_sh.tar.gz

asl commented 1 year ago

clang 6 is ancient. Does the problem reproduce with latest LLVM? Since the issue happes with Android-provided toolchain, I would suggest to report issue there unless it could be reproduced with mainline LLVM/clang

Endilll commented 6 months ago

Author has never got back to us. I tried Clang 6.0.0 with assertions, and it doesn't reproduce.