Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 929228 - sys-devel/clang-18.1.3 crashes building ncnn (was: dev-libs/ncnn-20240410 - [clang] fatal error: error in backend: Cannot select: <snip>: v32bf16 = insert_subvector <snip>, <snip>, Constant:i64<16>)
Summary: sys-devel/clang-18.1.3 crashes building ncnn (was: dev-libs/ncnn-20240410 - [...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-12 16:50 UTC by Toralf Förster
Modified: 2024-04-12 19:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,18.63 KB, text/plain)
2024-04-12 16:50 UTC, Toralf Förster
Details
dev-libs:ncnn-20240410:20240412-162707.log.xz (dev-libs:ncnn-20240410:20240412-162707.log.xz,20.62 KB, application/x-xz)
2024-04-12 16:50 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,100.33 KB, text/plain)
2024-04-12 16:50 UTC, Toralf Förster
Details
environment (environment,107.62 KB, text/plain)
2024-04-12 16:50 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.19 KB, application/x-xz)
2024-04-12 16:50 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,30.73 KB, application/x-xz)
2024-04-12 16:50 UTC, Toralf Förster
Details
qlist-info.txt (qlist-info.txt,176.05 KB, text/plain)
2024-04-12 16:50 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,921.81 KB, application/x-xz)
2024-04-12 16:50 UTC, Toralf Förster
Details
var.tmp.clang.tar.xz (var.tmp.clang.tar.xz,2.39 KB, application/x-xz)
2024-04-12 16:50 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-04-12 16:50:17 UTC
too long lines were shrinked:

[1018/1151] /usr/lib/llvm/18/bin/clang++ -DGLSLANG_IS_SHARED_LIBRARY=1 -Dncnn_EXPORTS -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src/layer/x86 -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410_build/src -I/
[1019/1151] /usr/lib/llvm/18/bin/clang++ -DGLSLANG_IS_SHARED_LIBRARY=1 -Dncnn_EXPORTS -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src/layer/x86 -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410_build/src -I/
[1020/1151] /usr/lib/llvm/18/bin/clang++ -DGLSLANG_IS_SHARED_LIBRARY=1 -Dncnn_EXPORTS -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src/layer/x86 -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410_build/src -I/
[1021/1151] /usr/lib/llvm/18/bin/clang++ -DGLSLANG_IS_SHARED_LIBRARY=1 -Dncnn_EXPORTS -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src/layer/x86 -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410_build/src -I/
FAILED: src/CMakeFiles/ncnn.dir/layer/x86/cast_x86_avx512bf16.cpp.o 
/usr/lib/llvm/18/bin/clang++ -DGLSLANG_IS_SHARED_LIBRARY=1 -Dncnn_EXPORTS -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src/layer/x86 -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410/src -I/var/tmp/portage/dev-libs/ncnn-20240410/work/ncnn-20240410_build/src -I/var/tmp/port
fatal error: error in backend: Cannot select: 0x55baeee49f40: v32bf16 = insert_subvector 0x55baeedb53d0, 0x55baeee91160, Constant:i64<16>
  0x55baeedb53d0: v32bf16 = insert_subvector undef:v32bf16, 0x55baeee4a3a0, Constant:i64<0>
    0x55baeee91080: v32bf16 = undef

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_llvm-20240411-061503

  -------------------------------------------------------------------

CC=clang
CXX=clang++
gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 18.1.3+libcxx
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
/usr/lib/llvm/18
18.1.3+libcxx
Python 3.11.9
Available Ruby profiles:
  [1]   ruby31 (with Rubygems)
  [2]   ruby33 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.77.1 *
The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):
go version go1.22.2 linux/amd64

  HEAD of ::gentoo
commit 2c7c126d1935edad0e877713effb0835d0b70789
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Fri Apr 12 15:49:18 2024 +0000

    2024-04-12 15:49:17 UTC

emerge -qpvO dev-libs/ncnn
[ebuild  N    ] dev-libs/ncnn-20240410  USE="openmp tools vulkan"
Comment 1 Toralf Förster gentoo-dev 2024-04-12 16:50:18 UTC
Created attachment 890524 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-04-12 16:50:19 UTC
Created attachment 890525 [details]
dev-libs:ncnn-20240410:20240412-162707.log.xz
Comment 3 Toralf Förster gentoo-dev 2024-04-12 16:50:20 UTC
Created attachment 890526 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2024-04-12 16:50:21 UTC
Created attachment 890527 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2024-04-12 16:50:22 UTC
Created attachment 890528 [details]
etc.clang.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-04-12 16:50:23 UTC
Created attachment 890529 [details]
etc.portage.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-04-12 16:50:25 UTC
Created attachment 890530 [details]
qlist-info.txt
Comment 8 Toralf Förster gentoo-dev 2024-04-12 16:50:28 UTC
Created attachment 890531 [details]
temp.tar.xz
Comment 9 Toralf Förster gentoo-dev 2024-04-12 16:50:29 UTC
Created attachment 890532 [details]
var.tmp.clang.tar.xz
Comment 10 Ionen Wolkens gentoo-dev 2024-04-12 19:18:49 UTC
Re-assigning to llvm@ given clang crashed and seems it is a clang-18 regression (can't reproduce with 17.0.6, but can with 18.1.3)

Also happens when building older ncnn, so this is not related to the new version.

I'll check if I can figure out a temporary workaround for the ncnn ebuild meanwhile.
Comment 11 Larry the Git Cow gentoo-dev 2024-04-12 19:36:51 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=caaafbb24b1124c87255ce52747f6a5f45a2651b

commit caaafbb24b1124c87255ce52747f6a5f45a2651b
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2024-04-12 19:30:00 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2024-04-12 19:36:00 +0000

    dev-libs/ncnn: disable avx512bf16 code path with >=clang-18 for now
    
    clang-18 itself crashes otherwise.
    
    wrt bug #929228, please remember to override this workaround
    to reproduce, aka: MYCMAKEARGS="-DNCNN_AVX512BF16=ON"
    
    Bug: https://bugs.gentoo.org/929228
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-libs/ncnn/ncnn-20240102-r1.ebuild | 4 ++++
 dev-libs/ncnn/ncnn-20240410.ebuild    | 4 ++++
 2 files changed, 8 insertions(+)