/* --- auxv --- */
auxv = (struct auxv *)ptr;
*client_auxv = (UInt *)auxv;
-#if defined(VGP_x86_freebsd)
+#if defined(VGP_x86_freebsd) && (VGO_freebsd <= FREEBSD_13)
int* pagesizes = NULL;
#endif
* copies out the data for a sysctl sees this discrepancy and
* sets an ENOMEM error. So guest execution doesn't even get past
* executing the dynamic linker.
+ *
+ * This was fixed in the kernel in May 2020, see
+ * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246215
+ *
+ * That means this workaround is not needed for
+ * FreeBSD 13 or later, any version
+ * FreeBSD 12 1201515 and later
+ * FreeBSD 11 1104501 and later
+ *
+ * Because this is rather complicated I've just disabled the hack
+ * for 13 and later
*/
for (; orig_auxv->a_type != AT_NULL; auxv++, orig_auxv++) {
// case AT_CANARYLEN:
// case AT_EXECPATH:
// case AT_CANARY:
-#if defined(VGP_x86_freebsd)
+#if defined(VGP_x86_freebsd) && (VGO_freebsd <= FREEBSD_13)
case AT_PAGESIZESLEN:
if (!VG_(is32on64)()) {
VG_(debugLog)(2, "initimg",
PRE(sys_lwp_mutex_unlock)
{
/* int lwp_mutex_unlock(lwp_mutex_t *lp); */
+ /* see https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/syscall/lwp_sobj.c#L3137-L3138
+ * (illumos, obviously) */
vki_lwp_mutex_t *lp = (vki_lwp_mutex_t*)ARG1;
PRINT("sys_lwp_mutex_unlock ( %#lx )", ARG1);
PRE_REG_READ1(int, "lwp_mutex_unlock", lwp_mutex_t *, lp);
# Suppressions for FreeBSD / Memcheck
-#This is a workaround for a bug in rtld
+
+# This is a workaround for a bug in rtld / sysctl hw.pagesizes
+# it was fixed in May 2020 in the kernel
+# removing it means either waiting for 12-RELEASE EOL
+# or some tricky kernel detection in configure.ac
{
MEMCHECK-RTLD-32ON64
Memcheck:Addr4