]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD syscalls: change two more warnings
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 30 May 2025 06:47:00 +0000 (08:47 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 30 May 2025 06:47:00 +0000 (08:47 +0200)
sysctl gave me a hard time when I first started working on FreeBSD
but that warning should only be without -q

change the unhandled kenv warning to a VG_(unimplemented), which will
terminate Valgrind rather than just print a warning.

There are still a few aio warnings. Really they should be promoted
to some kind of fully fledged warning (maybe a core warning). I'm
not sure that it's worth the effort as I suspect that aio is not
much used.

coregrind/m_syswrap/syswrap-freebsd.c
memcheck/tests/freebsd/scalar.c
memcheck/tests/freebsd/scalar.stderr.exp
memcheck/tests/freebsd/scalar.stderr.exp-x86

index 41b0cc38b2b61a895c552256f0d07478c73dd08a..3f4b6ca7129d64ac977851b68278951ff091dd81 100644 (file)
@@ -2082,8 +2082,10 @@ PRE(sys___sysctl)
          if (ML_(safe_to_deref)((void*)(Addr)ARG4, sizeof(vki_size_t))) {
             PRE_MEM_WRITE("sysctl(oldp)", (Addr)ARG3, *(vki_size_t *)ARG4);
          } else {
-            VG_(dmsg)("Warning: Bad oldlenp address %p in sysctl\n",
-                      (void *)(Addr)ARG4);
+             if (VG_(clo_verbosity) >= 1) {
+               VG_(dmsg)("Warning: Bad oldlenp address %p in sysctl\n",
+                         (void *)(Addr)ARG4);
+             }
             SET_STATUS_Failure ( VKI_EFAULT );
          }
       } else {
@@ -3691,7 +3693,9 @@ PRE(sys_kenv)
    case VKI_KENV_DUMP:
       break;
    default:
-      VG_(dmsg)("Warning: Bad action %" FMT_REGWORD "u in kenv\n", ARG1);
+      VG_(message)(Vg_UserMsg, "unhandled kenv cmd %" FMT_REGWORD "u", ARG1);
+      VG_(unimplemented) ("unhandled kenv cmd");
+      break;
    }
 }
 
index eddde2f428c2c625d66750e74aa84f7c5cf2f717..bae3d943bc1f23ead3133e1490de01df4ad05139 100644 (file)
@@ -1405,9 +1405,6 @@ int main(void)
    GO(SYS_kenv, "(KENV_DUMP) 4s 0m");
    SY(SYS_kenv, x0+3, x0+2, x0+3, x0+4); FAIL;
 
-   GO(SYS_kenv, "(bogus) 4s 0m");
-   SY(SYS_kenv, x0+20, x0+2, x0+3, x0+4); FAIL;
-
    /* SYS_lchflags                391 */
    GO(SYS_lchflags, "2s 1m");
    SY(SYS_lchflags, x0+1, x0+2); FAIL;
index d632beea425d92ad0240b58fda1f569a5ddaf68b..2e6ca39b49a954aa98d135fe57ccc382e13a0a60 100644 (file)
@@ -1481,7 +1481,6 @@ Syscall param sysctl(oldlenp) points to unaddressable byte(s)
    ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
-Warning: Bad oldlenp address 0x........ in sysctl
 ---------------------------------------------------------
 202:            SYS___sysctl (putnew) 4s 2m
 ---------------------------------------------------------
@@ -2984,22 +2983,6 @@ Syscall param kenv(value) contains uninitialised byte(s)
 Syscall param kenv(len) contains uninitialised byte(s)
    ...
 
----------------------------------------------------------
-390:                SYS_kenv (bogus) 4s 0m
----------------------------------------------------------
-Syscall param kenv(action) contains uninitialised byte(s)
-   ...
-
-Syscall param kenv(name) contains uninitialised byte(s)
-   ...
-
-Syscall param kenv(value) contains uninitialised byte(s)
-   ...
-
-Syscall param kenv(len) contains uninitialised byte(s)
-   ...
-
-Warning: Bad action 20 in kenv
 ---------------------------------------------------------
 391:            SYS_lchflags 2s 1m
 ---------------------------------------------------------
index 7a9af94e8aa3c27c080a978039543cc9df9df062..24c7caac0427e7479926aa30269b1d2eec7fc9fe 100644 (file)
@@ -1481,7 +1481,6 @@ Syscall param sysctl(oldlenp) points to unaddressable byte(s)
    ...
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
-Warning: Bad oldlenp address 0x........ in sysctl
 ---------------------------------------------------------
 202:            SYS___sysctl (putnew) 4s 2m
 ---------------------------------------------------------
@@ -2990,22 +2989,6 @@ Syscall param kenv(value) contains uninitialised byte(s)
 Syscall param kenv(len) contains uninitialised byte(s)
    ...
 
----------------------------------------------------------
-390:                SYS_kenv (bogus) 4s 0m
----------------------------------------------------------
-Syscall param kenv(action) contains uninitialised byte(s)
-   ...
-
-Syscall param kenv(name) contains uninitialised byte(s)
-   ...
-
-Syscall param kenv(value) contains uninitialised byte(s)
-   ...
-
-Syscall param kenv(len) contains uninitialised byte(s)
-   ...
-
-Warning: Bad action 20 in kenv
 ---------------------------------------------------------
 391:            SYS_lchflags 2s 1m
 ---------------------------------------------------------