[llvm-bugs] [Bug 44348] New: Segfault when using std::atomic
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Dec 19 15:33:23 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=44348
Bug ID: 44348
Summary: Segfault when using std::atomic
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangbugs at nondot.org
Reporter: leonardchan at google.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
We're hitting a segfault when using std::atomic:
```
[20356/55012] CXX
user-x64-clang/obj/system/ulib/backtrace-request/test/backtrace-request-test.backtrace-request-test.cc.o
FAILED:
user-x64-clang/obj/system/ulib/backtrace-request/test/backtrace-request-test.backtrace-request-test.cc.o
/b/s/w/ir/cache/goma/client/gomacc
../../prebuilt/third_party/clang/linux-x64/bin/clang++ -MD -MF
user-x64-clang/obj/system/ulib/backtrace-request/test/backtrace-request-test.backtrace-request-test.cc.o.d
-o
user-x64-clang/obj/system/ulib/backtrace-request/test/backtrace-request-test.backtrace-request-test.cc.o
-DTOOLCHAIN_VERSION=s8C8xEGKRekKT76tFnfhh2IBpFFwv2m3x8YJL9FN2usC
-DZX_ASSERT_LEVEL=2 -DWITH_FRAME_POINTERS=1
-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -D_ALL_SOURCE
-I../../zircon/system/public
-I../../zircon/system/ulib/backtrace-request/include
-I../../zircon/system/ulib/fdio/include
-I../../zircon/system/ulib/zircon/include -Iuser.vdso-x64-clang.shlib/gen
-I../../zircon/system/ulib/zx/include -I../../zircon/system/ulib/fbl/include
-I../../zircon/system/ulib/fit/include
-I../../zircon/system/ulib/zxtest/include -I../../zircon/system/ulib/c/include
-fno-common --target=x86_64-fuchsia -mcx16 -march=x86-64
-fcrash-diagnostics-dir=clang-crashreports -fcolor-diagnostics
-fdebug-prefix-map=/b/s/w/ir/k/fuchsia=../.. -no-canonical-prefixes -O2 -g3
-Wall -Wextra -Wno-unused-parameter -Wno-address-of-packed-member -Wnewline-eof
-Wno-unknown-warning-option -Wno-c99-designator -Wno-int-in-bool-context
-fno-omit-frame-pointer -ffunction-sections -fdata-sections -Wthread-safety
-Wimplicit-fallthrough -fvisibility=hidden -ftrivial-auto-var-init=pattern
-Werror -Wno-error=deprecated-declarations -idirafter
../../zircon/third_party/ulib/musl/include -Wno-unused-function -idirafter
../../zircon/third_party/ulib/musl/include -std=c++17 -Wconversion
-Wno-sign-conversion -Wextra-semi -Wno-deprecated-copy
-ftemplate-backtrace-limit=0 -fno-exceptions -fno-rtti -fno-threadsafe-statics
-fvisibility-inlines-hidden -c
../../zircon/system/ulib/backtrace-request/test/backtrace-request-test.cc
clang++: error: unable to execute command: Segmentation fault
clang++: error: clang frontend command failed due to signal (use -v to see
invocation)
Fuchsia clang version 10.0.0
(https://fuchsia.googlesource.com/a/third_party/llvm-project
fc31b58eff9da4447f9f332f07de3cd07ab4b56c)
Target: x86_64-unknown-fuchsia
Thread model: posix
InstalledDir: ../../prebuilt/third_party/clang/linux-x64/bin
clang++: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
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:
clang-crashreports/backtrace-request-test-a56ca4.cpp
clang++: note: diagnostic msg:
clang-crashreports/backtrace-request-test-a56ca4.sh
clang++: note: diagnostic msg:
********************
```
Reproduced with a 2-stage ToT clang:
```
$ cmake -G Ninja \
-DLLVM_ENABLE_LTO=OFF \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
-DCMAKE_INSTALL_PREFIX= \
-C ${LLVM_SRCDIR}/clang/cmake/caches/Fuchsia-stage2.cmake \
${LLVM_SRCDIR}/llvm
$ env DESTDIR=`pwd`/install ninja install-distribution-stripped
$ ./install/bin/clang++ "-cc1" "-triple" "x86_64-unknown-fuchsia" "-emit-obj"
"--mrelax-relocations" "-disable-free" "-disable-llvm-verifier"
"-discard-value-names" "-main-file-name" "backtrace-request-test.cc"
"-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mthread-model"
"posix" "-mframe-pointer=all" "-masm-verbose" "-mconstructor-aliases"
"-munwind-tables" "-fuse-init-array" "-target-cpu" "x86-64" "-target-feature"
"+cx16" "-dwarf-column-info" "-debug-info-kind=limited" "-dwarf-version=4"
"-debugger-tuning=gdb" "-ffunction-sections" "-fdata-sections"
"-sys-header-deps" "-D"
"TOOLCHAIN_VERSION=s8C8xEGKRekKT76tFnfhh2IBpFFwv2m3x8YJL9FN2usC" "-D"
"ZX_ASSERT_LEVEL=2" "-D" "WITH_FRAME_POINTERS=1" "-D"
"_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1" "-D" "_ALL_SOURCE" "-O2" "-Wall"
"-Wextra" "-Wno-unused-parameter" "-Wno-address-of-packed-member"
"-Wnewline-eof" "-Wno-unknown-warning-option" "-Wno-c99-designator"
"-Wno-int-in-bool-context" "-Wthread-safety" "-Wimplicit-fallthrough" "-Werror"
"-Wno-error=deprecated-declarations" "-Wno-unused-function" "-Wconversion"
"-Wno-sign-conversion" "-Wextra-semi" "-Wno-deprecated-copy" "-std=c++17"
"-fdeprecated-macro"
"-fdebug-prefix-map=/usr/local/google/home/cpu/src/fuchsia/out/default.zircon=."
"-fdebug-prefix-map=/usr/local/google/home/cpu/src/fuchsia/out=.."
"-fdebug-prefix-map=/usr/local/google/home/cpu/src/fuchsia=../.."
"-ferror-limit" "19" "-ftemplate-backtrace-limit" "0" "-fmessage-length" "0"
"-fvisibility" "hidden" "-fvisibility-inlines-hidden" "-fsanitize=safe-stack"
"-stack-protector" "2" "-ftrivial-auto-var-init=pattern" "-fno-rtti"
"-fgnuc-version=4.2.1" "-fno-threadsafe-statics" "-fobjc-runtime=gcc"
"-fno-common" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-vectorize-loops" "-vectorize-slp" "-faddrsig" "-x" "c++"
~/misc/backtrace-request-test-108348.cpp
```
Reproducer is too big, so I'm sharing it via google drive:
https://drive.google.com/a/google.com/file/d/1BPXld8AvUDbU05l84STBEY6z2EsxG56-/view?usp=sharing
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191219/c57beda5/attachment.html>
More information about the llvm-bugs
mailing list