I have recently upgraded Raspberry Pi 3B to 15.1 p1 (used freebsd-upgrade, was running 15.0 before). Immediately after upgrade I noticed random SIGSEGV in seemingly random binaries. Witnessed problems with both base system (e.g. top, inetd) and packages (zsh, isc-dhcpd). SIGSEGV is not deterministic - may run for quite some time before failing. Noticed that holding spacebar in top (to force frequent refres) reliably produced fault after a short time. Analyzed cores for top and zsh and both crashed at the same location: #0 0x000045001a93c004 in __get_locale () at /usr/src/lib/libc/stdio/vsprintf.c:52 In a live gdb session after SIGSEGV: (gdb) p $_siginfo $3 = {si_signo = 11, si_errno = 0, si_code = 2, si_pid = 0, si_uid = 0, si_status = 0, si_addr = 0x4057d220, si_value = {sival_int = 0, sival_ptr = 0x0}, _reason = {_fault = { si_trapno = 36}, _timer = {si_timerid = 36, si_overrun = 0}, _mesgq = {si_mqd = 36}, _poll = {si_band = 36}, __spare__ = {__spare1__ = 36, __spare2__ = {0, 0, 0, 0, 0, 0, 0}}}} Fault address si_addr = 0x4057d220 Data access triggered fault, not code location: (gdb) p/x $pc $4 = 0x404b8004 Surrounding code: (gdb) x/6i $pc-12 0x404b7ff8 <vsprintf+152>: adrp x9, 0x4057c000 0x404b7ffc <vsprintf+156>: stur q0, [sp, #104] 0x404b8000 <vsprintf+160>: cmp x10, #0x0 => 0x404b8004 <vsprintf+164>: ldr x9, [x9, #544] 0x404b8008 <vsprintf+168>: ccmp w8, #0x0, #0x4, ne // ne = any 0x404b800c <vsprintf+172>: mov w8, #0xffff // #65535 Registers (gdb) info registers [skip] x9 0x4057c000 1079492608 [skip] "ldr x9, [x9, #544]" was supposed to read from 0x4057c000+0x220 but fault is at 0x4057d220 - exactly 0x1000 more. I suppose I'm being hit by Cortex-A53 erratum 843419 (A load or store might access an incorrect address - see https://developer.arm.com/documentation/epm048406/latest). My CPU revision is r0p4 which is affected and I think assembly code matches description of the defect: I must admit I'm not 100% sure I fully understand conditions described in the errata document but I think the code above may match one of affected instruction sequences. I have rebuilt world with `LDFLAGS+= -Wl,--fix-cortex-a53-843419` and installed libc from that build. I no longer observe SIGSEGV. Would it be correct to assume that 15.1 Release was built without 843419 mitigation? If so was this intentional? I can see https://www.freebsd.org/releases/15.1R/hardware/ lists "Raspberry Pi 3" as supported so it is probably not intentional as frankly 15.1 release build is barely usable on Pi 3B. Would you please consider adding `--fix-cortex-a53-843419` to release build for arm64? Here's what I did: % cat /etc/make.conf .if ${MACHINE_ARCH} == "aarch64" CFLAGS+= ${MACHINE_ARCH:Maarch64:S/^aarch64$/-mfix-cortex-a53-835769/} CXXFLAGS+= ${MACHINE_ARCH:Maarch64:S/^aarch64$/-mfix-cortex-a53-835769/} LDFLAGS+= ${MACHINE_ARCH:Maarch64:S/^aarch64$/-Wl,--fix-cortex-a53-843419/} .endif Did it this way because of 32-bit compatibility libraries where --fix-cortex-a53-843419 is not supported. This was on amd64 box used to cross-build the world for arm64 (make -j$(sysctl -n hw.ncpu) TARGET=arm64 TARGET_ARCH=aarch64 buildworld). I haven't checked but the same problem may also be affecting packages.
*** This bug has been marked as a duplicate of bug 296240 ***