Page MenuHomeFreeBSD

clang: add upstream patch to fix assertion failure
Needs ReviewPublic

Authored by yasu on Jul 11 2023, 8:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 20 2024, 10:49 AM
Unknown Object (File)
Sep 20 2024, 1:54 AM
Unknown Object (File)
Sep 19 2024, 3:43 PM
Unknown Object (File)
Sep 17 2024, 6:35 AM
Unknown Object (File)
Sep 16 2024, 6:39 PM
Unknown Object (File)
Sep 16 2024, 11:37 AM
Unknown Object (File)
Jul 3 2024, 8:20 PM
Unknown Object (File)
Jun 23 2024, 10:56 AM
Subscribers

Details

Reviewers
dim
Summary

After devel/boost-libs is updated to 1.81.0, build fails on -CURRENT
because of clang's assertion failure as following.

clang-linux.compile.c++ bin.v2/libs/url/build/clang-linux-16/release/link-static/pch-off/threading-multi/visibility-hidden/src.o

"c++" -c -x c++ -fvisibility-inlines-hidden -m64 -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -DLIBICONV_PLUG -std=gnu++17 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -DBOOST_ALL_NO_LIB=1 -DBOOST_URL_SOURCE -DBOOST_URL_STATIC_LINK=1 -DNDEBUG -I"."   -o "bin.v2/libs/url/build/clang-linux-16/release/link-static/pch-off/threading-multi/visibility-hidden/src.o" "libs/url/src/src.cpp"

Assertion failed: (isa<To>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Casting.h, line 579.
PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: c++ -c -x c++ -fvisibility-inlines-hidden -m64 -pthread -O3 -Wall -fvisibility=hidden -Wno-inline -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -DLIBICONV_PLUG -std=gnu++17 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing -DBOOST_ALL_NO_LIB=1 -DBOOST_URL_SOURCE -DBOOST_URL_STATIC_LINK=1 -DNDEBUG -I. -o bin.v2/libs/url/build/clang-linux-16/release/link-static/pch-off/threading-multi/visibility-hidden/src.o libs/url/src/src.cpp

  1. ./boost/url/impl/segments_view.ipp:33:1: current parser token '{'
  2. ./boost/url/impl/segments_view.ipp:17:1: parsing namespace 'boost'
  3. ./boost/url/impl/segments_view.ipp:18:1: parsing namespace 'boost::urls' #0 0x00000000058158c1 PrintStackTrace /usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:567:13 #1 0x0000000005813c45 RunSignalHandlers /usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:105:18 #2 0x00000000057bb7cb HandleCrash /usr/src/contrib/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5 #3 0x00000000057bb7cb CrashRecoverySignalHandler /usr/src/contrib/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:51 #4 0x000000082a4a9a8f handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3 #5 0x000000082a4a904b thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:247:1 #6 0x000000082802a2d3 ([vdso]+0x2d3) #7 0x000000082e2a3cda thr_kill /usr/obj/usr/src/amd64.amd64/lib/libc/thr_kill.S:4:0 #8 0x000000082e21d1f4 raise /usr/src/lib/libc/gen/raise.c:0:10 #9 0x000000082e2cd3b9 abort /usr/src/lib/libc/stdlib/abort.c:73:17

c++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: x86_64-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg:


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


...failed clang-linux.compile.c++ bin.v2/libs/url/build/clang-linux-16/release/link-static/pch-off/threading-multi/visibility-hidden/src.o...

So add upstream patch to fix it.

PR: 269067
Obtained from: https://reviews.llvm.org/D148474

Test Plan

I built poudriere jail with commit be30fd3ab2e and this patch on amd64 and
confirmed build of devel/boost-libs succeeds with poudriere and the jail.

Diff Detail

Repository
rG FreeBSD src repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 52558
Build 49449: arc lint + arc unit