Bug 279136 - clang-16 frontend command fails with exit code 138 w/out any assertion message on the port security/botan3 on amd64, arm64
Summary: clang-16 frontend command fails with exit code 138 w/out any assertion messag...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 14.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-toolchain (Nobody)
URL: http://beefy12.nyi.freebsd.org/data/1...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-18 18:52 UTC by Yuri Victorovich
Modified: 2024-05-22 07:22 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2024-05-18 18:52:17 UTC
0.	Program arguments: c++ -fstack-protector -m64 -pthread -std=c++20 -D_REENTRANT -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wshorten-64-to-32 -Wcomma -Wdocumentation -DBOTAN_IS_BEING_BUILT -I build/include/public -I build/include/internal -isystem build/include/external -isystem /usr/local/include -c src/tests/test_rng_behavior.cpp -o build/obj/test/test_rng_behavior.o
1.	src/tests/test_rng_behavior.cpp:782:70: current parser token ';'
2.	src/tests/test_rng_behavior.cpp:44:1: parsing namespace 'Botan_Tests'
3.	src/tests/test_rng_behavior.cpp:46:1: parsing namespace 'Botan_Tests::(anonymous)'
4.	src/tests/test_rng_behavior.cpp:757:1: parsing struct/union/class body 'Botan_Tests::(anonymous namespace)::System_RNG_Tests'
5.	src/tests/test_rng_behavior.cpp:759:48: parsing function body 'Botan_Tests::(anonymous namespace)::System_RNG_Tests::run'
6.	src/tests/test_rng_behavior.cpp:759:48: in compound statement ('{}')
7.	src/tests/test_rng_behavior.cpp:778:99: in compound statement ('{}')
 #0 0x0000000004f90e31 (/usr/bin/c+++0x4f90e31)
 #1 0x0000000004f8f245 (/usr/bin/c+++0x4f8f245)
 #2 0x0000000004f375c5 (/usr/bin/c+++0x4f375c5)
 #3 0x000000082c2aa53f (/lib/libthr.so.3+0x1a53f)
 #4 0x000000082c2a9afb (/lib/libthr.so.3+0x19afb)
 #5 0x0000000827b782d3 ([vdso]+0x2d3)
 #6 0x00000000026a7318 (/usr/bin/c+++0x26a7318)
 #7 0x00000000026a71ea (/usr/bin/c+++0x26a71ea)
...
#87 0x0000000002475f91 (/usr/bin/c+++0x2475f91)
#88 0x000000082e355afa __libc_start1 (/lib/libc.so.7+0x84afa)
c++: error: clang frontend command failed with exit code 138 (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/test_rng_behavior-4c2d34.cpp
c++: note: diagnostic msg: /tmp/test_rng_behavior-4c2d34.sh
c++: note: diagnostic msg:
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2024-05-19 23:21:11 UTC
Note that in order to reproduce this, if https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279173 were to be committed, the LLVM version restriction would have to be dropped from botan3's port Makefile because the fixes in PR 279173 will pin the LLVM version to minimal 14, maximal 15, avoiding the base LLVM on systems that carry LLVM 16 there.
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2024-05-19 23:23:22 UTC
Yuri: 138 resolves to 128 (core dump) + 10 = SIGBUS.  
Assertion errors usually end up in std::terminate() or abort(), hence SIGABRT, resulting in status codes 6 or 134.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2024-05-21 18:45:21 UTC
Yes, it's an assertion caused by the reversal of https://github.com/llvm/llvm-project/commit/08c8d5bc51c5, which I committed during the llvm-12 (!) import, here: https://github.com/DimitryAndric/freebsd-src/commit/9c6443e9491128ed78f069af0caa77f062929dd8 . This is was originally to fix a problem with bootstrapping the gcc ports.

However, I removed it during the llvm-17 import, so from llvm-17 onward it should compile botan just fine. Also, the llvm-16 port should compile it OK, since it does not have the above revert.

How long does 14.0-RELEASE have to live, still? 14.1-R is coming up, which should fix this problem too.
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2024-05-22 02:00:39 UTC
It builds with llvm-17 from ports.
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-05-22 02:01:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d863e42c9258ad8673bfbaef2af27781cff3b42c

commit d863e42c9258ad8673bfbaef2af27781cff3b42c
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-05-22 01:59:38 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-05-22 01:59:38 +0000

    security/botan3: Unbreak on amd64 and arm64 by using llvm-17

    PR:             279136

 security/botan3/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-05-22 02:03:15 UTC
A commit in branch 2024Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e5cd3589b262f0a530e2b201d923a69b9666adf9

commit e5cd3589b262f0a530e2b201d923a69b9666adf9
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-05-22 01:59:38 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-05-22 02:02:28 +0000

    security/botan3: Unbreak on amd64 and arm64 by using llvm-17

    PR:             279136
    (cherry picked from commit d863e42c9258ad8673bfbaef2af27781cff3b42c)

 security/botan3/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Comment 7 Matthias Andree freebsd_committer freebsd_triage 2024-05-22 07:09:33 UTC
Dimitry, 

Thank you. 14.0 will be around until end of September 2024 according to current schedules, see the table on https://www.freebsd.org/releng/ in context with https://www.freebsd.org/security/#sup


Yuri, 

why are you rushing this and ignoring https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279173 with this?

Basically we can build with "all LLVM from ports" if I understand Dimitry correctly, so that would be the right recourse, rather than forcing a version that nobody else has or uses.

Note that 279173 also has other necessary changes working around the older libc++ in FreeBSD 13's base.
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2024-05-22 07:22:11 UTC
(In reply to Matthias Andree from comment #7)

Hi Matthias,

I just made it build again, since I added BROKEN lines earlier.

If you would like to commit further patches - you are welcome to do so.

I know very little about botan3 and have never used it.


Thanks,
Yuri