Several tests crash with `-D_FORTIFY_SOURCE=3` (the new Arch defaults)
Environment
$ env | grep FLAGS
CFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fuse-ld=mold -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Og -g
CXXFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fuse-ld=mold -Wp,-D_GLIBCXX_ASSERTIONS -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Og -g
LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -fuse-ld=mold
Test log
$ meson test -C build
<...>
$ grep 'Summary of Failures' -A999 build/meson-logs/testlog.txt
Summary of Failures:
8/343 config001.py FAIL 0.26s 0/1 subtests passed
13/343 config002.py FAIL 0.25s 0/1 subtests passed
116/343 query002.py FAIL 0.29s 0/1 subtests passed
117/343 query005.py FAIL 0.26s 0/1 subtests passed
118/343 query006.py FAIL 0.26s 0/1 subtests passed
120/343 query010.py FAIL 0.27s 0/1 subtests passed
121/343 query011.py FAIL 0.29s 0/1 subtests passed
124/343 query012.py FAIL 0.28s 0/1 subtests passed
230/343 sync1100.py FAIL 0.30s 0/1 subtests passed
Ok: 327
Expected Fail: 7
Fail: 9
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full Meson test log: testlog.txt
Stacktrace
Brief stacktrace
Thread 1 (Thread 0x7eea48e95740 (LWP 128638)):
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1 0x00007eea49c8e393 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007eea49c3d6c8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007eea49c254b8 in __GI_abort () at abort.c:79
#4 0x00007eea49c26395 in __libc_message_impl (fmt=fmt@entry=0x7eea49d9e161 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:132
#5 0x00007eea49d1573b in __GI___fortify_fail (msg=msg@entry=0x7eea49d9e148 "buffer overflow detected") at fortify_fail.c:24
#6 0x00007eea49d150e6 in __GI___chk_fail () at chk_fail.c:28
#7 0x00007eea49d172d5 in __wcstombs_chk (dst=dst@entry=0x64e2ae7abcf8 <titles+5400> "", src=<optimized out>, src@entry=0x7ffeb7bbd1cc L"Version :", len=len@entry=212, dstlen=dstlen@entry=200) at wcstombs_chk.c:27
#8 0x000064e2ae7972d3 in wcstombs (__len=212, __src=0x7ffeb7bbd1cc L"Version :", __dst=0x64e2ae7abcf8 <titles+5400> "") at /usr/include/bits/stdlib.h:146
#9 make_aligned_titles () at ../src/pacman/package.c:143
#10 0x000064e2ae79780c in dump_pkg_full (pkg=pkg@entry=0x64e2aebe0910, extra=0) at ../src/pacman/package.c:206
#11 0x000064e2ae79e1b8 in sync_info (syncs=syncs@entry=0x64e2aebe1890, targets=targets@entry=0x64e2aebca740) at ../src/pacman/sync.c:432
#12 0x000064e2ae79f9f5 in pacman_sync (targets=0x64e2aebca740) at ../src/pacman/sync.c:954
#13 0x000064e2ae79bb6a in main (argc=14, argv=0x7ffeb7bbd618) at ../src/pacman/pacman.c:1283
Full stacktrace: gdblog-full.txt