You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(7) |
2
(5) |
3
(2) |
4
(8) |
5
(10) |
|
6
(3) |
7
(9) |
8
(7) |
9
(8) |
10
(7) |
11
(4) |
12
(11) |
|
13
(5) |
14
(17) |
15
(6) |
16
(15) |
17
|
18
(3) |
19
(1) |
|
20
(6) |
21
(18) |
22
(5) |
23
(9) |
24
(6) |
25
(3) |
26
(1) |
|
27
(1) |
28
|
29
(8) |
30
(5) |
|
|
|
|
From: <sv...@va...> - 2015-09-25 21:04:53
|
Author: iraisr
Date: Fri Sep 25 22:04:45 2015
New Revision: 15684
Log:
Solaris syscall: Add support for system_stats (154).
Provide scalar test as well.
n-i-bz
Added:
trunk/memcheck/tests/solaris/scalar_system_stats.c
trunk/memcheck/tests/solaris/scalar_system_stats.stderr.exp
trunk/memcheck/tests/solaris/scalar_system_stats.stdout.exp
trunk/memcheck/tests/solaris/scalar_system_stats.vgtest
Modified:
trunk/configure.ac
trunk/coregrind/m_syswrap/syswrap-solaris.c
trunk/include/vki/vki-scnums-solaris.h
trunk/memcheck/tests/solaris/ (props changed)
trunk/memcheck/tests/solaris/Makefile.am
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri Sep 25 22:04:45 2015
@@ -3412,6 +3412,29 @@
])
AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, test x$solaris_reserve_sysstat_zone_addr = xyes)
+
+# Solaris-specific check determining if the system_stats() syscall is available
+# (on newer Solaris).
+#
+# C-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
+# Automake-level symbol: SOLARIS_SYSTEM_STATS_SYSCALL
+#
+AC_MSG_CHECKING([for the `system_stats' syscall (Solaris-specific)])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/syscall.h>
+]], [[
+ return !SYS_system_stats;
+]])], [
+solaris_system_stats_syscall=yes
+AC_MSG_RESULT([yes])
+AC_DEFINE([SOLARIS_SYSTEM_STATS_SYSCALL], 1,
+ [Define to 1 if you have the `system_stats' syscall.])
+], [
+solaris_system_stats_syscall=no
+AC_MSG_RESULT([no])
+])
+AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, test x$solaris_system_stats_syscall = xyes)
+
else
AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, false)
AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, false)
@@ -3436,6 +3459,7 @@
AM_CONDITIONAL(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS, false)
AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ADDR, false)
AM_CONDITIONAL(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR, false)
+AM_CONDITIONAL(SOLARIS_SYSTEM_STATS_SYSCALL, false)
fi # test "$VGCONF_OS" = "solaris"
Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Fri Sep 25 22:04:45 2015
@@ -995,6 +995,9 @@
DECL_TEMPLATE(solaris, sys_lwp_sema_trywait);
DECL_TEMPLATE(solaris, sys_lwp_detach);
DECL_TEMPLATE(solaris, sys_fchroot);
+#if defined(SOLARIS_SYSTEM_STATS_SYSCALL)
+DECL_TEMPLATE(solaris, sys_system_stats);
+#endif /* SOLARIS_SYSTEM_STATS_SYSCALL */
DECL_TEMPLATE(solaris, sys_gettimeofday);
DECL_TEMPLATE(solaris, sys_lwp_create);
DECL_TEMPLATE(solaris, sys_lwp_exit);
@@ -6433,6 +6436,15 @@
SET_STATUS_Failure(VKI_EBADF);
}
+#if defined(SOLARIS_SYSTEM_STATS_SYSCALL)
+PRE(sys_system_stats)
+{
+ /* void system_stats(int flag); */
+ PRINT("sys_system_stats ( %ld )", SARG1);
+ PRE_REG_READ1(void, "system_stats", int, flag);
+}
+#endif /* SOLARIS_SYSTEM_STATS_SYSCALL */
+
PRE(sys_gettimeofday)
{
/* Kernel: int gettimeofday(struct timeval *tp); */
@@ -10012,6 +10024,9 @@
SOLXY(__NR_lwp_sema_trywait, sys_lwp_sema_trywait), /* 149 */
SOLX_(__NR_lwp_detach, sys_lwp_detach), /* 150 */
SOLX_(__NR_fchroot, sys_fchroot), /* 153 */
+#if defined(SOLARIS_SYSTEM_STATS_SYSCALL)
+ SOLX_(__NR_system_stats, sys_system_stats), /* 154 */
+#endif /* SOLARIS_SYSTEM_STATS_SYSCALL */
SOLXY(__NR_gettimeofday, sys_gettimeofday), /* 156 */
GENXY(__NR_getitimer, sys_getitimer), /* 157 */
GENXY(__NR_setitimer, sys_setitimer), /* 158 */
Modified: trunk/include/vki/vki-scnums-solaris.h
==============================================================================
--- trunk/include/vki/vki-scnums-solaris.h (original)
+++ trunk/include/vki/vki-scnums-solaris.h Fri Sep 25 22:04:45 2015
@@ -203,6 +203,9 @@
//#define __NR_corectl SYS_corectl
//#define __NR_modctl SYS_modctl
#define __NR_fchroot SYS_fchroot
+#if defined(SOLARIS_SYSTEM_STATS_SYSCALL)
+#define __NR_system_stats SYS_system_stats
+#endif /* SOLARIS_SYSTEM_STATS_SYSCALL */
//#define __NR_vhangup SYS_vhangup
#define __NR_gettimeofday SYS_gettimeofday
#define __NR_getitimer SYS_getitimer
Modified: trunk/memcheck/tests/solaris/Makefile.am
==============================================================================
--- trunk/memcheck/tests/solaris/Makefile.am (original)
+++ trunk/memcheck/tests/solaris/Makefile.am Fri Sep 25 22:04:45 2015
@@ -37,6 +37,7 @@
scalar_obsolete.stderr.exp scalar_obsolete.stdout.exp scalar_obsolete.vgtest \
scalar_shm_new.stderr.exp scalar_shm_new.stdout.exp scalar_shm_new.vgtest \
scalar_spawn.stderr.exp scalar_spawn.stdout.exp scalar_spawn.vgtest \
+ scalar_system_stats.stderr.exp scalar_system_stats.stdout.exp scalar_system_stats.vgtest \
scalar_tsol_clearance.stderr.exp scalar_tsol_clearance.vgtest \
scalar_utimensat.stderr.exp scalar_utimensat.stdout.exp scalar_utimensat.vgtest \
scalar_utimesys.stderr.exp scalar_utimesys.stdout.exp scalar_utimesys.vgtest \
@@ -117,6 +118,10 @@
check_PROGRAMS += scalar_spawn spawn
endif
+if SOLARIS_SYSTEM_STATS_SYSCALL
+check_PROGRAMS += scalar_system_stats
+endif
+
if SOLARIS_TSOL_CLEARANCE
check_PROGRAMS += scalar_tsol_clearance
scalar_tsol_clearance_LDADD = -ltsol
Added: trunk/memcheck/tests/solaris/scalar_system_stats.c
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_system_stats.c (added)
+++ trunk/memcheck/tests/solaris/scalar_system_stats.c Fri Sep 25 22:04:45 2015
@@ -0,0 +1,18 @@
+/* Test for system_stats syscall which is available on newer Solaris. */
+
+#include "scalar.h"
+#include <sys/system_stats.h>
+
+int main(void)
+{
+ /* Uninitialised, but we know px[0] is 0x0. */
+ long *px = malloc(sizeof(long));
+ x0 = px[0];
+
+ /* SYS_system_stats 154 */
+ GO(SYS_system_stats, "1s 0m");
+ SY(SYS_system_stats, x0 + SYSTEM_STATS_START); SUCC;
+
+ return 0;
+}
+
Added: trunk/memcheck/tests/solaris/scalar_system_stats.stderr.exp
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_system_stats.stderr.exp (added)
+++ trunk/memcheck/tests/solaris/scalar_system_stats.stderr.exp Fri Sep 25 22:04:45 2015
@@ -0,0 +1,6 @@
+---------------------------------------------------------
+154: SYS_system_stats 1s 0m
+---------------------------------------------------------
+Syscall param system_stats(flag) contains uninitialised byte(s)
+ ...
+
Added: trunk/memcheck/tests/solaris/scalar_system_stats.stdout.exp
==============================================================================
(empty)
Added: trunk/memcheck/tests/solaris/scalar_system_stats.vgtest
==============================================================================
--- trunk/memcheck/tests/solaris/scalar_system_stats.vgtest (added)
+++ trunk/memcheck/tests/solaris/scalar_system_stats.vgtest Fri Sep 25 22:04:45 2015
@@ -0,0 +1,4 @@
+prereq: test -e scalar_system_stats
+prog: scalar_system_stats
+vgopts: -q
+stderr_filter_args:
|
|
From: <sv...@va...> - 2015-09-25 20:53:16
|
Author: iraisr
Date: Fri Sep 25 21:53:09 2015
New Revision: 15683
Log:
Provide test for AT_SUN_SYSSTAT_ADDR emulation.
n-i-bz
Added:
trunk/memcheck/tests/solaris/gethrusec.c
trunk/memcheck/tests/solaris/gethrusec.stderr.exp
trunk/memcheck/tests/solaris/gethrusec.stdout.exp
trunk/memcheck/tests/solaris/gethrusec.vgtest
Modified:
trunk/README.solaris
trunk/memcheck/tests/solaris/ (props changed)
trunk/memcheck/tests/solaris/Makefile.am
Modified: trunk/README.solaris
==============================================================================
--- trunk/README.solaris (original)
+++ trunk/README.solaris Fri Sep 25 21:53:09 2015
@@ -130,7 +130,6 @@
to see this in effect. Would require awareness of syscall parameter semantics.
- Correctly print arguments of DW_CFA_ORCL_arg_loc in show_CF_instruction() when
it is implemented in libdwarf.
-- Provide tests for AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDR.
Contacts
Modified: trunk/memcheck/tests/solaris/Makefile.am
==============================================================================
--- trunk/memcheck/tests/solaris/Makefile.am (original)
+++ trunk/memcheck/tests/solaris/Makefile.am Fri Sep 25 21:53:09 2015
@@ -19,6 +19,7 @@
execx.stderr.exp execx.stdout.exp execx.vgtest \
getzoneoffset.stderr.exp getzoneoffset.vgtest \
gethrtime.stderr.exp gethrtime.stdout.exp gethrtime.vgtest \
+ gethrusec.stderr.exp gethrusec.stdout.exp gethrusec.vgtest \
ldynsym.stderr.exp ldynsym.stdout.exp ldynsym.vgtest \
lsframe1.stderr.exp lsframe1.stdout.exp lsframe1.vgtest \
lsframe2.stderr.exp lsframe2.stdout.exp lsframe2.vgtest \
@@ -78,6 +79,10 @@
check_PROGRAMS += execx
endif
+if SOLARIS_RESERVE_SYSSTAT_ADDR
+check_PROGRAMS += gethrusec
+endif
+
if SOLARIS_GETZONEOFFSET_FASTTRAP
check_PROGRAMS += getzoneoffset
endif
Added: trunk/memcheck/tests/solaris/gethrusec.c
==============================================================================
--- trunk/memcheck/tests/solaris/gethrusec.c (added)
+++ trunk/memcheck/tests/solaris/gethrusec.c Fri Sep 25 21:53:09 2015
@@ -0,0 +1,24 @@
+/* Test for gethrusec which depends on the correct emulation of
+ AT_SUN_SYSSTAT_ADDR in the auxiliary vector. */
+
+#include <stdio.h>
+#include <strings.h>
+#include <sys/system_stats.h>
+
+int main(void)
+{
+ hrtime_t t = 0;
+ get_hrusec(&t);
+ printf("get_hrusec(): %s\n", (t == 0) ? "FAIL" : "PASS");
+
+ memtime_sec_t m = 0;
+ memset(&m, 0, sizeof(m));
+ get_sec_fromepoch(&m);
+ printf("get_sec_fromepoch(): %s\n", (m == 0) ? "FAIL" : "PASS");
+
+ t = 0;
+ get_nsec_fromepoch(&t);
+ printf("get_nsec_fromepoch(): %s\n", (t == 0) ? "FAIL" : "PASS");
+ return 0;
+}
+
Added: trunk/memcheck/tests/solaris/gethrusec.stderr.exp
==============================================================================
(empty)
Added: trunk/memcheck/tests/solaris/gethrusec.stdout.exp
==============================================================================
--- trunk/memcheck/tests/solaris/gethrusec.stdout.exp (added)
+++ trunk/memcheck/tests/solaris/gethrusec.stdout.exp Fri Sep 25 21:53:09 2015
@@ -0,0 +1,3 @@
+get_hrusec(): PASS
+get_sec_fromepoch(): PASS
+get_nsec_fromepoch(): PASS
Added: trunk/memcheck/tests/solaris/gethrusec.vgtest
==============================================================================
--- trunk/memcheck/tests/solaris/gethrusec.vgtest (added)
+++ trunk/memcheck/tests/solaris/gethrusec.vgtest Fri Sep 25 21:53:09 2015
@@ -0,0 +1,3 @@
+prereq: test -e gethrusec
+prog: gethrusec
+vgopts: -q
|
Author: iraisr
Date: Fri Sep 25 21:12:26 2015
New Revision: 15682
Log:
Support correctly AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDR
in the auxiliary vector.
This is possible as Solaris 12 kernel now creates auxv even
for statically linked binaries.
n-i-bz
Modified:
trunk/README.solaris
trunk/coregrind/m_initimg/initimg-solaris.c
trunk/coregrind/m_syswrap/syswrap-solaris.c
trunk/coregrind/pub_core_syswrap.h
trunk/include/vki/vki-solaris.h
Modified: trunk/README.solaris
==============================================================================
--- trunk/README.solaris (original)
+++ trunk/README.solaris Fri Sep 25 21:12:26 2015
@@ -79,15 +79,6 @@
possible for Valgrind to arrange mapping of a kernel shared page at the
address specified in the mapfile for the guest application. There is currently
no such mechanism in Solaris. Hacky workarounds are possible, though.
-- Guest programs do not contain entries for AT_SUN_SYSSTAT_ADDR and
- AT_SUN_SYSSTAT_ZONE_ADDR in their auxilliary vectors. There is no direct way
- how to obtain addresses of these pages shared with the kernel as they are
- passed in auxv and kernel does not create auxv for statically linked binaries
- (such as Valgrind analysis tools).
- Indirect methods, such as scanning 1-page mappings found at Valgrind
- startup surrounded by reservations, could be possible. But it is hard to tell
- which page is which because their contents are filled only when a system
- cyclic is started. See get_hrusec() for reference.
- When a thread has no stack then all system calls will result in Valgrind
crash, even though such system calls use just parameters passed in registers.
This should happen only in pathological situations when a thread is created
@@ -139,6 +130,7 @@
to see this in effect. Would require awareness of syscall parameter semantics.
- Correctly print arguments of DW_CFA_ORCL_arg_loc in show_CF_instruction() when
it is implemented in libdwarf.
+- Provide tests for AT_SUN_SYSSTAT_ADDR and AT_SUN_SYSSTAT_ZONE_ADDR.
Contacts
Modified: trunk/coregrind/m_initimg/initimg-solaris.c
==============================================================================
--- trunk/coregrind/m_initimg/initimg-solaris.c (original)
+++ trunk/coregrind/m_initimg/initimg-solaris.c Fri Sep 25 21:12:26 2015
@@ -29,6 +29,8 @@
The GNU General Public License is contained in the file COPYING.
*/
+/* Copyright 2013-2015, Ivo Raisr <iv...@iv...>. */
+
#if defined(VGO_solaris)
/* Note: This file is based on initimg-linux.c. */
@@ -273,6 +275,59 @@
return orig;
}
+/* The auxiliary vector might not be present. So we cross-check pointers from
+ argv and envp pointing to the string table. */
+static vki_auxv_t *find_original_auxv(Addr init_sp)
+{
+ HChar **sp = (HChar **) init_sp;
+ HChar *lowest_str_ptr = (HChar *) UINTPTR_MAX; // lowest ptr to string table
+
+ sp++; // skip argc
+
+ while (*sp != NULL) { // skip argv
+ if (*sp < lowest_str_ptr)
+ lowest_str_ptr = *sp;
+ sp++;
+ }
+ sp++;
+
+ while (*sp != 0) { // skip env
+ if (*sp < lowest_str_ptr)
+ lowest_str_ptr = *sp;
+ sp++;
+ }
+ sp++;
+
+ if ((Addr) sp < (Addr) lowest_str_ptr) {
+ return (vki_auxv_t *) sp;
+ } else {
+ return NULL;
+ }
+}
+
+static void copy_auxv_entry(const vki_auxv_t *orig_auxv, Int type,
+ const HChar *type_name, vki_auxv_t *auxv)
+{
+ vg_assert(auxv != NULL);
+
+ if (orig_auxv == NULL) {
+ VG_(printf)("valgrind: Cannot locate auxiliary vector.\n");
+ VG_(printf)("valgrind: Cannot continue. Sorry.\n\n");
+ VG_(exit)(1);
+ }
+
+ for ( ; orig_auxv->a_type != VKI_AT_NULL; orig_auxv++) {
+ if (orig_auxv->a_type == type) {
+ auxv->a_type = type;
+ auxv->a_un.a_val = orig_auxv->a_un.a_val;
+ return;
+ }
+ }
+
+ VG_(printf)("valgrind: Cannot locate %s in the aux\n", type_name);
+ VG_(printf)("valgrind: vector. Cannot continue. Sorry.\n\n");
+ VG_(exit)(1);
+}
/* This sets up the client's initial stack, containing the args,
environment and aux vector.
@@ -305,11 +360,12 @@
clstack_end, which was previously determined by the address space manager.
The returned value is the SP value for the client.
- Note that no aux vector is created by kernel on Solaris if the program is
- statically linked (which is our case). That means we have to build auxv
- from scratch. */
+ Note that auxiliary vector is *not* created by kernel on illumos and
+ Solaris 11 if the program is statically linked (which is our case).
+ Although we now taught Solaris 12 to create the auxiliary vector, we still
+ have to build auxv from scratch, to make the code consistent. */
-static Addr setup_client_stack(void *init_sp,
+static Addr setup_client_stack(Addr init_sp,
HChar **orig_envp,
const ExeInfo *info,
Addr clstack_end,
@@ -335,6 +391,9 @@
vg_assert(VG_(args_the_exename));
vg_assert(VG_(args_for_client));
+ /* Get the original auxv (if any). */
+ vki_auxv_t *orig_auxv = find_original_auxv(init_sp);
+
/* ==================== compute sizes ==================== */
/* First of all, work out how big the client stack will be. */
@@ -378,11 +437,20 @@
AT_PAGESZ
AT_SUN_AUXFLAFGS
AT_SUN_HWCAP
+ AT_SUN_SYSSTAT_ADDR (if supported)
+ AT_SUN_SYSSTAT_ZONE_ADDR (if supported)
AT_NULL
It would be possible to also add AT_PHENT, AT_PHNUM, AT_ENTRY,
AT_SUN_LDDATA, but they don't seem to be so important. */
auxsize = 9 * sizeof(*auxv);
+# if defined(SOLARIS_RESERVE_SYSSTAT_ADDR)
+ auxsize += sizeof(*auxv);
+# endif
+# if defined(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR)
+ auxsize += sizeof(*auxv);
+# endif
+
# if defined(VGA_x86) || defined(VGA_amd64)
/* AT_SUN_PLATFORM string. */
stringsize += VG_(strlen)("i86pc") + 1;
@@ -739,6 +807,22 @@
*/
}
+# if defined(SOLARIS_RESERVE_SYSSTAT_ADDR)
+ /* AT_SUN_SYSSTAT_ADDR */
+ copy_auxv_entry(orig_auxv, VKI_AT_SUN_SYSSTAT_ADDR,
+ "AT_SUN_SYSSTAT_ADDR", auxv);
+ VG_(change_mapping_ownership)(auxv->a_un.a_val, True);
+ auxv++;
+# endif
+
+# if defined(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR)
+ /* AT_SUN_SYSSTAT_ZONE_ADDR */
+ copy_auxv_entry(orig_auxv, VKI_AT_SUN_SYSSTAT_ZONE_ADDR,
+ "AT_SUN_SYSSTAT_ZONE_ADDR", auxv);
+ VG_(change_mapping_ownership)(auxv->a_un.a_val, True);
+ auxv++;
+# endif
+
/* AT_NULL */
auxv->a_type = VKI_AT_NULL;
auxv->a_un.a_val = 0;
@@ -811,7 +895,7 @@
- If a larger --main-stacksize value is specified, use that instead.
- In all situations, the minimum allowed stack size is 1M.
*/
- void *init_sp = iicii.argv - 1;
+ Addr init_sp = (Addr) (iicii.argv - 1);
SizeT m1 = 1024 * 1024;
SizeT m16 = 16 * m1;
SizeT szB = (SizeT)VG_(client_rlimit_stack).rlim_cur;
Modified: trunk/coregrind/m_syswrap/syswrap-solaris.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-solaris.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-solaris.c Fri Sep 25 21:12:26 2015
@@ -28,10 +28,10 @@
The GNU General Public License is contained in the file COPYING.
*/
-/* Copyright 2015-2015, Tomas Jedlicka <jed...@gm...>. */
-
/* Copyright 2013-2015, Ivo Raisr <iv...@iv...>. */
+/* Copyright 2015-2015, Tomas Jedlicka <jed...@gm...>. */
+
/* Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
#if defined(VGO_solaris)
@@ -438,6 +438,50 @@
VG_(atfork)(NULL, NULL, clean_schedctl_data);
}
+/* Changes ownership of a memory mapping shared between kernel and the client
+ process. This mapping should have already been pre-arranged during process
+ address space initialization happening in kernel. Valgrind on startup created
+ a segment for this mapping categorized as Valgrind's owned anonymous.
+ Size of this mapping typically varies among Solaris versions but should be
+ page aligned.
+ If 'once_only' is 'True', it is expected this function is called once only
+ and the mapping ownership has not been changed, yet [useful during
+ initialization]. If 'False', this function can be called many times but does
+ change ownership only upon the first invocation [useful in syscall wrappers].
+ */
+void VG_(change_mapping_ownership)(Addr addr, Bool once_only)
+{
+ const NSegment *seg = VG_(am_find_anon_segment)(addr);
+ vg_assert(seg != NULL);
+ vg_assert(seg->start == addr);
+ vg_assert(VG_IS_PAGE_ALIGNED(seg->start));
+ vg_assert(VG_IS_PAGE_ALIGNED(seg->end + 1));
+ SizeT size = seg->end - seg->start + 1;
+ vg_assert(size > 0);
+
+ Bool do_change = False;
+ if (once_only) {
+ vg_assert(VG_(am_is_valid_for_valgrind)(addr, size, VKI_PROT_READ));
+ do_change = True;
+ } else {
+ if (!VG_(am_is_valid_for_client)(addr, size, VKI_PROT_READ))
+ do_change = True;
+ }
+
+ if (do_change) {
+ Bool change_ownership_OK = VG_(am_change_ownership_v_to_c)(addr, size);
+ vg_assert(change_ownership_OK);
+
+ /* Tell the tool about just discovered mapping. */
+ VG_TRACK(new_mem_startup,
+ addr, size,
+ True /* readable? */,
+ False /* writable? */,
+ False /* executable? */,
+ 0 /* di_handle */);
+ }
+}
+
/* Calculate the Fletcher-32 checksum of a given buffer. */
UInt ML_(fletcher32)(UShort *buf, SizeT blocks)
{
@@ -9755,33 +9799,7 @@
if (RES == 0)
return;
- /* Returned address points to a memory mapping shared between kernel
- and the process. This was already pre-arranged during process address
- space initialization happening in kernel. Valgrind on startup created
- a segment for this mapping categorized as Valgrind's owned anonymous.
- Size of this mapping varies among Solaris versions but should be
- page aligned. */
- const NSegment *seg = VG_(am_find_anon_segment)(RES);
- vg_assert(seg != NULL);
- vg_assert(seg->start == RES);
- vg_assert(VG_IS_PAGE_ALIGNED(seg->start));
- vg_assert(VG_IS_PAGE_ALIGNED(seg->end + 1));
- SizeT size = seg->end - seg->start + 1;
- vg_assert(size > 0);
-
- if (!VG_(am_is_valid_for_client)(RES, size, VKI_PROT_READ)) {
- Bool change_ownership_v_c_OK
- = VG_(am_change_ownership_v_to_c)(RES, size);
- vg_assert(change_ownership_v_c_OK);
-
- /* Tell the tool about just discovered mapping. */
- VG_TRACK(new_mem_startup,
- RES, size,
- True /* readable? */,
- False /* writable? */,
- False /* executable? */,
- 0 /* di_handle */);
- }
+ VG_(change_mapping_ownership)(RES, False);
}
#endif /* SOLARIS_GETHRT_FASTTRAP */
@@ -9798,33 +9816,7 @@
if (RES == 0)
return;
- /* Returned address points to a memory mapping shared between kernel
- and the process. This was already pre-arranged during process address
- space initialization happening in kernel. Valgrind on startup created
- a segment for this mapping categorized as Valgrind's owned anonymous.
- Size of this mapping varies among Solaris versions but should be
- page aligned. */
- const NSegment *seg = VG_(am_find_anon_segment)(RES);
- vg_assert(seg != NULL);
- vg_assert(seg->start == RES);
- vg_assert(VG_IS_PAGE_ALIGNED(seg->start));
- vg_assert(VG_IS_PAGE_ALIGNED(seg->end + 1));
- SizeT size = seg->end - seg->start + 1;
- vg_assert(size > 0);
-
- if (!VG_(am_is_valid_for_client)(RES, size, VKI_PROT_READ)) {
- Bool change_ownership_v_c_OK
- = VG_(am_change_ownership_v_to_c)(RES, size);
- vg_assert(change_ownership_v_c_OK);
-
- /* Tell the tool about just discovered mapping. */
- VG_TRACK(new_mem_startup,
- RES, size,
- True /* readable? */,
- False /* writable? */,
- False /* executable? */,
- 0 /* di_handle */);
- }
+ VG_(change_mapping_ownership)(RES, False);
}
#endif /* SOLARIS_GETZONEOFFSET_FASTTRAP */
Modified: trunk/coregrind/pub_core_syswrap.h
==============================================================================
--- trunk/coregrind/pub_core_syswrap.h (original)
+++ trunk/coregrind/pub_core_syswrap.h Fri Sep 25 21:12:26 2015
@@ -93,6 +93,7 @@
extern void VG_(restore_context)(ThreadId tid, vki_ucontext_t *uc,
CorePart part, Bool esp_is_thrptr);
extern void VG_(syswrap_init)(void);
+extern void VG_(change_mapping_ownership)(Addr addr, Bool once_only);
extern Bool VG_(setup_client_dataseg)(void);
extern void VG_(track_client_dataseg)(ThreadId tid);
#endif
Modified: trunk/include/vki/vki-solaris.h
==============================================================================
--- trunk/include/vki/vki-solaris.h (original)
+++ trunk/include/vki/vki-solaris.h Fri Sep 25 21:12:26 2015
@@ -70,6 +70,7 @@
#include <sys/types.h>
#define VKI_UINT_MAX UINT_MAX
+#define VKI_UINTPTR_MAX UINTPTR_MAX
#define vki_boolean_t boolean_t
#define vki_datalink_id_t datalink_id_t
#define vki_uint_t uint_t
@@ -252,6 +253,12 @@
#define VKI_AT_SUN_HWCAP AT_SUN_HWCAP
#define VKI_AT_SUN_EXECNAME AT_SUN_EXECNAME
#define VKI_AT_SUN_AUXFLAGS AT_SUN_AUXFLAGS
+#if defined(SOLARIS_RESERVE_SYSSTAT_ADDR)
+#define VKI_AT_SUN_SYSSTAT_ADDR AT_SUN_SYSSTAT_ADDR
+#endif
+#if defined(SOLARIS_RESERVE_SYSSTAT_ZONE_ADDR)
+#define VKI_AT_SUN_SYSSTAT_ZONE_ADDR AT_SUN_SYSSTAT_ZONE_ADDR
+#endif
#define VKI_AF_SUN_HWCAPVERIFY AF_SUN_HWCAPVERIFY
|