Issue 102754
Summary Clang 16 and 17 segfault while compiling OpenBLAS
Labels backend:X86, crash
Assignees
Reporter giordano
    With a `x86_64-linux-musl` build of Clang, compilation of OpenBLAS silently dies while compiling some x86_64 kernels, returning exit code 255.  For example, with OpenBLAS 0.3.28 + https://github.com/OpenMathLib/OpenBLAS/pull/4859 (which resolves some warnings issues by Clang) I get
```console
sandbox:${WORKSPACE}/srcdir/OpenBLAS-0.3.28/kernel # cc -c -O2 -DSMALL_MATRIX_OPT -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=512 -DMAX_PARALLEL_NUMBER=1 -DBUILD_BFLOAT16 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.28\" -msse3 -mssse3 -msse4.1 -mavx -mavx2 -march=cooperlake -mavx2 -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME=_sbgemv_t_COOPERLAKE -DASMFNAME=_sbgemv_t_COOPERLAKE_ -DNAME=sbgemv_t_COOPERLAKE_ -DCNAME=sbgemv_t_COOPERLAKE -DCHAR_NAME=\"sbgemv_t_COOPERLAKE_\" -DCHAR_CNAME=\"sbgemv_t_COOPERLAKE\" -DNO_AFFINITY -DTS=_COOPERLAKE -I.. -DBUILD_KERNEL -DTABLE_NAME=gotoblas_COOPERLAKE -march=cooperlake -DBFLOAT16 -UDOUBLE  -UCOMPLEX -UCOMPLEX ../kernel/x86_64/sbgemv_t.c -o sbgemv_t_COOPERLAKE.o; echo $?
255
```
It's particularly worrying that Clang just dies without printing any error message, it's even hard to tell what's the issue.

This happens with any x86_64 target, this was first observed in https://github.com/JuliaPackaging/Yggdrasil/pull/9234 with `x86_64-linux-gnu`, `x86_64-apple-darwin`, and `x86_64-unknown-freebsd`.

Clang versions (here showing `x86_64-apple-darwin`, but it's the same version for all different targets)
```console
sandbox:${WORKSPACE}/srcdir/OpenBLAS-0.3.28 # clang --version
clang version 17.0.6 (/home/tim/.cache/BinaryBuilder/downloads/clones/llvm-project.git-1df819a03ecf6890e3787b27bfd4f160aeeeeacd50a98d003be8b0893f11a9be 6009708b4367171ccdbf4b5905cb6a803753fe18)
Target: x86_64-apple-darwin14
Thread model: posix
InstalledDir: /opt/x86_64-linux-musl/bin
[...]
sandbox:${WORKSPACE}/srcdir/OpenBLAS-0.3.28 # clang --version
clang version 16.0.6 (/home/gbaraldi/.julia/dev/BinaryBuilderBase/deps/downloads/clones/llvm-project.git-1df819a03ecf6890e3787b27bfd4f160aeeeeacd50a98d003be8b0893f11a9be 7cbf1a2591520c2491aa35339f227775f4d3adf6)
Target: x86_64-apple-darwin14
Thread model: posix
InstalledDir: /opt/x86_64-linux-musl/bin
```
Unfortunately I don't have builds of Clang 18 or nightly at hand.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to