这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug]: clang crashes on aarch64 architecture under x86_64 host when using qemu-static #28

@licy183

Description

@licy183

Problem description

clang crashes/hangs on aarch64 architecture under x86_64 host. It seems to be an upstream issue of qemu-aarch64-static. But actually there is no such issue under other aarch64 rootfs (test with clang under alpine and ubuntu).

What steps will reproduce the bug?

pkg install clang
echo -e "#include <iostream>\nint main() { std::cout << std::endl; }" > main.cpp
clang++ main.cpp -v # hangs
clang++  -std=c++11 main.cpp -v # crashes

Log

clang version 14.0.1
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
 "/data/data/com.termux/files/usr/bin/clang-14" -cc1 -triple aarch64-unknown-linux-android24 -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -target-feature +neon -target-feature +v8a -target-feature +fix-cortex-a53-835769 -target-abi aapcs -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/data/data/com.termux/files/home -resource-dir /data/data/com.termux/files/usr/lib/clang/14.0.1 -isysroot /data/data/com.termux/files -internal-isystem /data/data/com.termux/files/usr/include/c++/v1 -internal-isystem /data/data/com.termux/files/usr/lib/clang/14.0.1/include -internal-isystem /data/data/com.termux/files/usr/local/include -internal-externc-isystem /data/data/com.termux/files/usr/include/aarch64-linux-android -internal-externc-isystem /data/data/com.termux/files/include -internal-externc-isystem /data/data/com.termux/files/usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir=/data/data/com.termux/files/home -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -target-feature +outline-atomics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /data/data/com.termux/files/usr/tmp/main-1c1e58.o -x c++ main.cpp
clang -cc1 version 14.0.1 based upon LLVM 14.0.1 default target aarch64-unknown-linux-android24
ignoring nonexistent directory "/data/data/com.termux/files/usr/local/include"
ignoring nonexistent directory "/data/data/com.termux/files/include"
#include "..." search starts here:
#include <...> search starts here:
 /data/data/com.termux/files/usr/include/c++/v1
 /data/data/com.termux/files/usr/lib/clang/14.0.1/include
 /data/data/com.termux/files/usr/include/aarch64-linux-android
 /data/data/com.termux/files/usr/include
End of search list.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /data/data/com.termux/files/usr/bin/clang-14 -cc1 -triple aarch64-unknown-linux-android24 -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -target-feature +neon -target-feature +v8a -target-feature +fix-cortex-a53-835769 -target-abi aapcs -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/data/data/com.termux/files/home -resource-dir /data/data/com.termux/files/usr/lib/clang/14.0.1 -isysroot /data/data/com.termux/files -internal-isystem /data/data/com.termux/files/usr/include/c++/v1 -internal-isystem /data/data/com.termux/files/usr/lib/clang/14.0.1/include -internal-isystem /data/data/com.termux/files/usr/local/include -internal-externc-isystem /data/data/com.termux/files/usr/include/aarch64-linux-android -internal-externc-isystem /data/data/com.termux/files/include -internal-externc-isystem /data/data/com.termux/files/usr/include -std=c++11 -fdeprecated-macro -fdebug-compilation-dir=/data/data/com.termux/files/home -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -target-feature +outline-atomics -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /data/data/com.termux/files/usr/tmp/main-1c1e58.o -x c++ main.cpp
1.      /data/data/com.termux/files/usr/include/c++/v1/algorithm:3123:1: current parser token '{'
2.      /data/data/com.termux/files/usr/include/c++/v1/algorithm:660:1 <Spelling=/data/data/com.termux/files/usr/include/c++/v1/__config:793:37>: parsing namespace 'std'
3.      /data/data/com.termux/files/usr/include/c++/v1/algorithm:660:1 <Spelling=/data/data/com.termux/files/usr/include/c++/v1/__config:793:60>: parsing namespace 'std::__ndk1'
libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xfffffff0 in tid 980 (clang-14), pid 980 (clang-14)
libc: failed to spawn debuggerd dispatch thread: Invalid argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions