Valgrind: r16225 - in /trunk: coregrind/m_syswrap/syswrap-solaris.c include/vki/vki-solaris.h memcheck/tests/solaris/scalar.c memcheck/tests/solaris/scalar.stderr.exp

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Valgrind: r16225 - in /trunk: coregrind/m_syswrap/syswrap-solaris.c include/vki/vki-solaris.h memcheck/tests/solaris/scalar.c memcheck/tests/solaris/scalar.stderr.exp

svn-2
Author: iraisr
Date: Tue Feb 14 12:38:06 2017
New Revision: 16225

Log:
Solaris: Add additional subcodes for lgrpsys(180) syscall
Fixes BZ#376455.

Modified:
    trunk/coregrind/m_syswrap/syswrap-solaris.c
    trunk/include/vki/vki-solaris.h
    trunk/memcheck/tests/solaris/scalar.c
    trunk/memcheck/tests/solaris/scalar.stderr.exp

Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Tue Feb 14 12:38:06 2017
@@ -28,7 +28,7 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-/* Copyright 2013-2016, Ivo Raisr <[hidden email]>. */
+/* Copyright 2013-2017, Ivo Raisr <[hidden email]>. */
 
 /* Copyright 2015-2015, Tomas Jedlicka <[hidden email]>. */
 
@@ -7517,6 +7517,25 @@
                        (Addr) minfo->mi_validity, SARG2 * sizeof(vki_uint_t));
       }
       break;
+   case VKI_LGRP_SYS_GENERATION:
+      /* Liblgrp: lgrp_gen_t lgrp_generation(lgrp_view_t view); */
+      PRINT("sys_lgrpsys ( %ld, %ld )", SARG1, SARG2);
+      PRE_REG_READ2(long, SC2("lgrpsys", "generation"), int, subcode,
+                    vki_lgrp_view_t, view);
+      break;
+   case VKI_LGRP_SYS_VERSION:
+      /* Liblgrp: int lgrp_version(int version); */
+      PRINT("sys_lgrpsys ( %ld, %ld )", SARG1, SARG2);
+      PRE_REG_READ2(long, SC2("lgrpsys", "version"), int, subcode,
+                    int, version);
+      break;
+   case VKI_LGRP_SYS_SNAPSHOT:
+      /* Liblgrp: int lgrp_snapshot(void *buf, size_t bufsize); */
+      PRINT("sys_lgrpsys ( %ld, %lu, %#lx )", SARG1, ARG2, ARG3);
+      PRE_REG_READ3(long, SC2("lgrpsys", "snapshot"), int, subcode,
+                    vki_size_t, bufsize, void *, buf);
+      PRE_MEM_WRITE("lgrpsys(buf)", ARG3, ARG2);
+      break;
    default:
       VG_(unimplemented)("Syswrap of the lgrpsys call with subcode %ld.",
                          SARG1);
@@ -7536,6 +7555,12 @@
          POST_MEM_WRITE((Addr) minfo->mi_validity, SARG2 * sizeof(vki_uint_t));
       }
       break;
+   case VKI_LGRP_SYS_GENERATION:
+   case VKI_LGRP_SYS_VERSION:
+      break;
+   case VKI_LGRP_SYS_SNAPSHOT:
+      POST_MEM_WRITE(ARG3, RES);
+      break;
    default:
       vg_assert(0);
       break;

Modified: trunk/include/vki/vki-solaris.h
==============================================================================
--- trunk/include/vki/vki-solaris.h (original)
+++ trunk/include/vki/vki-solaris.h Tue Feb 14 12:38:06 2017
@@ -604,6 +604,10 @@
 #define vki_semid64_ds semid_ds64
 
 
+#include <sys/lgrp_user.h>
+#define vki_lgrp_view_t lgrp_view_t
+
+
 #include <sys/lgrp_user_impl.h>
 #define VKI_LGRP_SYS_MEMINFO LGRP_SYS_MEMINFO
 #define VKI_LGRP_SYS_GENERATION LGRP_SYS_GENERATION

Modified: trunk/memcheck/tests/solaris/scalar.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar.c (original)
+++ trunk/memcheck/tests/solaris/scalar.c Tue Feb 14 12:38:06 2017
@@ -730,6 +730,27 @@
 }
 
 __attribute__((noinline))
+static void sys_lgrpsys4(void)
+{
+   GO(SYS_lgrpsys, "(LGRP_SYS_GENERATION) 2s 0m");
+   SY(SYS_lgrpsys, x0 + LGRP_SYS_GENERATION, x0 + 0); SUCC;
+}
+
+__attribute__((noinline))
+static void sys_lgrpsys5(void)
+{
+   GO(SYS_lgrpsys, "(LGRP_SYS_VERSION) 2s 0m");
+   SY(SYS_lgrpsys, x0 + LGRP_SYS_VERSION, x0 + 0); SUCC;
+}
+
+__attribute__((noinline))
+static void sys_lgrpsys6(void)
+{
+   GO(SYS_lgrpsys, "(LGRP_SYS_SNAPSHOT) 3s 1m");
+   SY(SYS_lgrpsys, x0 + LGRP_SYS_SNAPSHOT, x0 + 10, x0 + 1); FAIL;
+}
+
+__attribute__((noinline))
 static void sys_rusagesys(void)
 {
    GO(SYS_rusagesys, "(_RUSAGESYS_GETRUSAGE) 2s 1m");
@@ -2217,6 +2238,9 @@
    sys_lgrpsys();
    sys_lgrpsys2();
    sys_lgrpsys3();
+   sys_lgrpsys4();
+   sys_lgrpsys5();
+   sys_lgrpsys6();
 
    /* SYS_rusagesys             181 */
    sys_rusagesys();

Modified: trunk/memcheck/tests/solaris/scalar.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar.stderr.exp (original)
+++ trunk/memcheck/tests/solaris/scalar.stderr.exp Tue Feb 14 12:38:06 2017
@@ -2870,6 +2870,40 @@
  Address 0x........ is not stack'd, malloc'd or (recently) free'd
 
 ---------------------------------------------------------
+180:             SYS_lgrpsys (LGRP_SYS_GENERATION) 2s 0m
+---------------------------------------------------------
+Syscall param lgrpsys_generation(subcode) contains uninitialised byte(s)
+   ...
+
+Syscall param lgrpsys_generation(view) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+180:             SYS_lgrpsys (LGRP_SYS_VERSION) 2s 0m
+---------------------------------------------------------
+Syscall param lgrpsys_version(subcode) contains uninitialised byte(s)
+   ...
+
+Syscall param lgrpsys_version(version) contains uninitialised byte(s)
+   ...
+
+---------------------------------------------------------
+180:             SYS_lgrpsys (LGRP_SYS_SNAPSHOT) 3s 1m
+---------------------------------------------------------
+Syscall param lgrpsys_snapshot(subcode) contains uninitialised byte(s)
+   ...
+
+Syscall param lgrpsys_snapshot(bufsize) contains uninitialised byte(s)
+   ...
+
+Syscall param lgrpsys_snapshot(buf) contains uninitialised byte(s)
+   ...
+
+Syscall param lgrpsys(buf) points to unaddressable byte(s)
+   ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+---------------------------------------------------------
 181:           SYS_rusagesys (_RUSAGESYS_GETRUSAGE) 2s 1m
 ---------------------------------------------------------
 Syscall param rusagesys_getrusage(code) contains uninitialised byte(s)


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers
Loading...