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
(2) |
2
(4) |
3
(1) |
4
(7) |
5
|
|
6
|
7
(4) |
8
|
9
(3) |
10
(6) |
11
(13) |
12
(6) |
|
13
(1) |
14
|
15
(1) |
16
|
17
(4) |
18
(3) |
19
(5) |
|
20
(5) |
21
(5) |
22
(5) |
23
(6) |
24
|
25
(1) |
26
(1) |
|
27
(1) |
28
(4) |
29
(5) |
30
|
|
|
|
|
From: <sv...@va...> - 2016-11-19 23:28:25
|
Author: iraisr
Date: Sat Nov 19 23:28:18 2016
New Revision: 16143
Log:
Disable test none/tests/pth_2sig on Solaris for now until
it is investigated why it messes so badly with the regression test suite.
n-i-bz
Modified:
trunk/none/tests/pth_2sig.vgtest
Modified: trunk/none/tests/pth_2sig.vgtest
==============================================================================
--- trunk/none/tests/pth_2sig.vgtest (original)
+++ trunk/none/tests/pth_2sig.vgtest Sat Nov 19 23:28:18 2016
@@ -1,2 +1,5 @@
+# Disable this test on Solaris for now until it is investigated
+# why it messes badly with the regression test suite.
+prereq: (! ../../tests/os_test solaris)
prog: pth_2sig
vgopts: -q
|
|
From: <sv...@va...> - 2016-11-19 15:15:22
|
Author: iraisr
Date: Sat Nov 19 15:15:10 2016
New Revision: 16142
Log:
Fix the configure test for presense of __xpg[4,6] symbols
on Solaris so that only shared library is considered.
Previously a binary was checked which now started to produce
incorrect results with regards to vg_preload.
n-i-bz
Modified:
trunk/configure.ac
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat Nov 19 15:15:10 2016
@@ -2778,10 +2778,10 @@
AM_CONDITIONAL(SOLARIS_SUN_STUDIO_AS, test x$solaris_have_sun_studio_as = xyes)
# Solaris-specific check determining if symbols __xpg4 and __xpg6
-# are present in linked elfs when gcc is invoked with -std=gnu99.
+# are present in linked shared libraries when gcc is invoked with -std=gnu99.
# See solaris/vgpreload-solaris.mapfile for details.
-# gcc on Solaris instructs linker to include these symbols,
-# gcc on illumos does not.
+# gcc on older Solaris instructs linker to include these symbols,
+# gcc on illumos and newer Solaris does not.
#
# C-level symbol: none
# Automake-level symbol: SOLARIS_XPG_SYMBOLS_PRESENT
@@ -2789,34 +2789,21 @@
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std=gnu99"
AC_MSG_CHECKING([if xpg symbols are present with -std=gnu99 (Solaris-specific)])
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <limits.h>
+temp_dir=$( /usr/bin/mktemp -d )
+cat <<_ACEOF >${temp_dir}/mylib.c
#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, const char *argv[]) {
- char command[PATH_MAX + 50];
- snprintf(command, sizeof(command), "nm %s | egrep '__xpg[4,6]'", argv[0]);
-
- FILE *output = popen(command, "r");
- if (output == NULL) return -1;
-
- char buf[100];
- if (fgets(buf, sizeof(buf), output) != NULL) {
- pclose(output);
- return 0;
- } else {
- pclose(output);
- return 1;
- }
-}
-]])], [
-solaris_xpg_symbols_present=yes
-AC_MSG_RESULT([yes])
-], [
-solaris_xpg_symbols_present=no
-AC_MSG_RESULT([no])
-])
+int myfunc(void) { printf("LaPutyka\n"); }
+_ACEOF
+${CC} ${CFLAGS} -fpic -shared -o ${temp_dir}/mylib.so ${temp_dir}/mylib.c
+xpg_present=$( /usr/bin/nm ${temp_dir}/mylib.so | ${EGREP} '(__xpg4|__xpg6)' )
+if test "x${xpg_present}" = "x" ; then
+ solaris_xpg_symbols_present=no
+ AC_MSG_RESULT([no])
+else
+ solaris_xpg_symbols_present=yes
+ AC_MSG_RESULT([yes])
+fi
+rm -rf ${temp_dir}
AM_CONDITIONAL(SOLARIS_XPG_SYMBOLS_PRESENT, test x$solaris_xpg_symbols_present = xyes)
CFLAGS="$save_CFLAGS"
|
Author: philippe
Date: Sat Nov 19 14:54:44 2016
New Revision: 16141
Log:
Fix 372504 Hanging on exit_group
Note that it is unclear if the PRE syscall for rt_sigsuspend
is properly setting up a temporary mask in the thread state
tmp_sig_mask: if an handler is called while a thread is
calling sigsuspend, the mask during the handler run must be
the temporary mask set by sigsuspend.
It is not clear if/where the valgrind sigframe builder/handler
sets the tmp_sig_mask to the value as expected by the user
(i.e. the value of the temporary mask which was given to
the sigsuspend syscall)
Added:
trunk/none/tests/sigsusp.c
trunk/none/tests/sigsusp.stderr.exp
trunk/none/tests/sigsusp.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/pub_core_threadstate.h
trunk/none/tests/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Nov 19 14:54:44 2016
@@ -80,9 +80,9 @@
371869 support '%' in symbol Z-encoding
371916 execution tree xtree concept
372120 c++ demangler demangles symbols which are not c++
+372504 Hanging on exit_group
372600 process loops forever when fatal signals are arriving quickly
-
Release 3.12.0 (20 October 2016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c Sat Nov 19 14:54:44 2016
@@ -3558,6 +3558,12 @@
PRE_REG_READ2(int, "rt_sigsuspend", vki_sigset_t *, mask, vki_size_t, size)
if (ARG1 != (Addr)NULL) {
PRE_MEM_READ( "rt_sigsuspend(mask)", ARG1, sizeof(vki_sigset_t) );
+ VG_(sigdelset)((vki_sigset_t*)ARG1, VG_SIGVGKILL);
+ /* We cannot mask VG_SIGVGKILL, as otherwise this thread would not
+ be killable by VG_(nuke_all_threads_except).
+ We thus silently ignore the user request to mask this signal.
+ Note that this is similar to what is done for e.g.
+ sigprocmask (see m_signals.c calculate_SKSS_from_SCSS). */
}
}
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Sat Nov 19 14:54:44 2016
@@ -354,7 +354,9 @@
different values is during the execution of a sigsuspend, where
tmp_sig_mask is the temporary mask which sigsuspend installs.
It is only consulted to compute the signal mask applied to a
- signal handler. */
+ signal handler.
+ PW Nov 2016 : it is not clear if and where this tmp_sig_mask
+ is set when an handler runs "inside" a sigsuspend. */
vki_sigset_t tmp_sig_mask;
/* A little signal queue for signals we can't get the kernel to
Modified: trunk/none/tests/Makefile.am
==============================================================================
--- trunk/none/tests/Makefile.am (original)
+++ trunk/none/tests/Makefile.am Sat Nov 19 14:54:44 2016
@@ -189,6 +189,7 @@
shortpush.stderr.exp shortpush.vgtest \
shorts.stderr.exp shorts.vgtest \
sigstackgrowth.stdout.exp sigstackgrowth.stderr.exp sigstackgrowth.vgtest \
+ sigsusp.stderr.exp sigsusp.vgtest \
stackgrowth.stdout.exp stackgrowth.stderr.exp stackgrowth.vgtest \
syscall-restart1.vgtest syscall-restart1.stdout.exp syscall-restart1.stderr.exp \
syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
@@ -233,7 +234,7 @@
require-text-symbol \
res_search resolv \
rlimit_nofile selfrun sem semlimit sha1_test \
- shortpush shorts stackgrowth sigstackgrowth \
+ shortpush shorts stackgrowth sigstackgrowth sigsusp \
syscall-restart1 syscall-restart2 \
syslog \
system \
@@ -332,6 +333,7 @@
if VGCONF_OS_IS_SOLARIS
sha1_test_CFLAGS += -Du_int32_t=uint32_t
endif
+sigsusp_LDADD = -lpthread
thread_exits_LDADD = -lpthread
threaded_fork_LDADD = -lpthread
threadederrno_CFLAGS = $(AM_CFLAGS)
Added: trunk/none/tests/sigsusp.c
==============================================================================
--- trunk/none/tests/sigsusp.c (added)
+++ trunk/none/tests/sigsusp.c Sat Nov 19 14:54:44 2016
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <signal.h>
+static void* t_fn(void* v)
+{
+ sigset_t mask;
+
+ sigfillset(&mask);
+ sigsuspend(&mask);
+ return NULL;
+}
+
+int main (int argc, char *argv[])
+{
+ pthread_t t1;
+
+ pthread_create(&t1, NULL, t_fn, NULL);
+
+ sleep(1); // Should be enough to have the thread in sigsuspend
+ // printf("dying\n");
+ exit(0);
+}
Added: trunk/none/tests/sigsusp.stderr.exp
==============================================================================
(empty)
Added: trunk/none/tests/sigsusp.vgtest
==============================================================================
--- trunk/none/tests/sigsusp.vgtest (added)
+++ trunk/none/tests/sigsusp.vgtest Sat Nov 19 14:54:44 2016
@@ -0,0 +1,2 @@
+prog: sigsusp
+vgopts: -q
|
Author: philippe
Date: Sat Nov 19 13:51:41 2016
New Revision: 16140
Log:
Fix Bug 372600 - process loops forever when fatal signals are arriving quickly
Added:
trunk/none/tests/pth_2sig.c
trunk/none/tests/pth_2sig.stderr.exp
trunk/none/tests/pth_2sig.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_signals.c
trunk/none/tests/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Nov 19 13:51:41 2016
@@ -80,7 +80,7 @@
371869 support '%' in symbol Z-encoding
371916 execution tree xtree concept
372120 c++ demangler demangles symbols which are not c++
-
+372600 process loops forever when fatal signals are arriving quickly
Release 3.12.0 (20 October 2016)
Modified: trunk/coregrind/m_signals.c
==============================================================================
--- trunk/coregrind/m_signals.c (original)
+++ trunk/coregrind/m_signals.c Sat Nov 19 13:51:41 2016
@@ -2430,8 +2430,14 @@
info->si_code = sanitize_si_code(info->si_code);
if (VG_(clo_trace_signals))
- VG_(dmsg)("async signal handler: signal=%d, tid=%u, si_code=%d\n",
- sigNo, tid, info->si_code);
+ VG_(dmsg)("async signal handler: signal=%d, tid=%u, si_code=%d, "
+ "exitreason %s\n",
+ sigNo, tid, info->si_code,
+ VG_(name_of_VgSchedReturnCode)(tst->exitreason));
+
+ /* */
+ if (tst->exitreason == VgSrc_FatalSig)
+ resume_scheduler(tid);
/* Update thread state properly. The signal can only have been
delivered whilst we were in
@@ -2479,8 +2485,16 @@
);
/* (2) */
- /* Set up the thread's state to deliver a signal */
- if (!is_sig_ign(info, tid))
+ /* Set up the thread's state to deliver a signal.
+ However, if exitreason is VgSrc_FatalSig, then thread tid was
+ taken out of a syscall by VG_(nuke_all_threads_except).
+ But after the emission of VKI_SIGKILL, another (fatal) async
+ signal might be sent. In such a case, we must not handle this
+ signal, as the thread is supposed to die first.
+ => resume the scheduler for such a thread, so that the scheduler
+ can let the thread die. */
+ if (tst->exitreason != VgSrc_FatalSig
+ && !is_sig_ign(info, tid))
deliver_signal(tid, info, uc);
/* It's crucial that (1) and (2) happen in the order (1) then (2)
@@ -2946,6 +2960,20 @@
ThreadState *tst = VG_(get_ThreadState)(tid);
vki_sigset_t saved_mask;
+ if (tst->exitreason == VgSrc_FatalSig) {
+ /* This task has been requested to die due to a fatal signal
+ received by the process. So, we cannot poll new signals,
+ as we are supposed to die asap. If we would poll and deliver
+ a new (maybe fatal) signal, this could cause a deadlock, as
+ this thread would believe it has to terminate the other threads
+ and wait for them to die, while we already have a thread doing
+ that. */
+ if (VG_(clo_trace_signals))
+ VG_(dmsg)("poll_signals: not polling as thread %u is exitreason %s\n",
+ tid, VG_(name_of_VgSchedReturnCode)(tst->exitreason));
+ return;
+ }
+
/* look for all the signals this thread isn't blocking */
/* pollset = ~tst->sig_mask */
VG_(sigcomplementset)( &pollset, &tst->sig_mask );
@@ -2961,15 +2989,18 @@
/* If there was nothing queued, ask the kernel for a pending signal */
if (sip == NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) {
if (VG_(clo_trace_signals))
- VG_(dmsg)("poll_signals: got signal %d for thread %u\n",
- si.si_signo, tid);
+ VG_(dmsg)("poll_signals: got signal %d for thread %u exitreason %s\n",
+ si.si_signo, tid,
+ VG_(name_of_VgSchedReturnCode)(tst->exitreason));
sip = &si;
}
if (sip != NULL) {
/* OK, something to do; deliver it */
if (VG_(clo_trace_signals))
- VG_(dmsg)("Polling found signal %d for tid %u\n", sip->si_signo, tid);
+ VG_(dmsg)("Polling found signal %d for tid %u exitreason %s\n",
+ sip->si_signo, tid,
+ VG_(name_of_VgSchedReturnCode)(tst->exitreason));
if (!is_sig_ign(sip, tid))
deliver_signal(tid, sip, NULL);
else if (VG_(clo_trace_signals))
@@ -3073,7 +3104,8 @@
}
if (VG_(clo_trace_signals))
- VG_(dmsg)("Max kernel-supported signal is %d\n", VG_(max_signal));
+ VG_(dmsg)("Max kernel-supported signal is %d, VG_SIGVGKILL is %d\n",
+ VG_(max_signal), VG_SIGVGKILL);
/* Our private internal signals are treated as ignored */
scss.scss_per_sig[VG_SIGVGKILL].scss_handler = VKI_SIG_IGN;
Modified: trunk/none/tests/Makefile.am
==============================================================================
--- trunk/none/tests/Makefile.am (original)
+++ trunk/none/tests/Makefile.am Sat Nov 19 13:51:41 2016
@@ -168,6 +168,7 @@
pth_rwlock.stderr.exp pth_rwlock.vgtest \
pth_stackalign.stderr.exp \
pth_stackalign.stdout.exp pth_stackalign.vgtest \
+ pth_2sig.stderr.exp pth_2sig.vgtest \
pth_term_signal.stderr.exp pth_term_signal.vgtest \
rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
readline1.stderr.exp readline1.stdout.exp \
@@ -227,7 +228,7 @@
pselect_sigmask_null \
pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
pth_empty pth_exit pth_exit2 pth_mutexspeed pth_once pth_rwlock \
- pth_stackalign pth_term_signal\
+ pth_stackalign pth_2sig pth_term_signal\
rcrl readline1 \
require-text-symbol \
res_search resolv \
@@ -318,6 +319,7 @@
pth_rwlock_CFLAGS += --std=c99
endif
pth_stackalign_LDADD = -lpthread
+pth_2sig_LDADD = -lpthread
pth_term_signal_LDADD = -lpthread
res_search_LDADD = -lresolv -lpthread
resolv_CFLAGS = $(AM_CFLAGS)
Added: trunk/none/tests/pth_2sig.c
==============================================================================
--- trunk/none/tests/pth_2sig.c (added)
+++ trunk/none/tests/pth_2sig.c Sat Nov 19 13:51:41 2016
@@ -0,0 +1,45 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <signal.h>
+#include <pthread.h>
+#include <assert.h>
+#include <stdlib.h>
+
+#include <sys/wait.h>
+void *
+slavethread(void *arg)
+{
+ char c;
+ while (1)
+ (void)read(0, &c, 1);
+}
+
+int main(int argc, char **argv)
+{
+ pthread_t slave;
+ int i = 0;
+ int pid = getpid();
+
+ for (i = 0; i < 10; i++)
+ if (pthread_create(&slave, 0, &slavethread, 0))
+ {
+ perror("slave2");
+ exit(2);
+ }
+ switch (fork())
+ {
+ case 0: // child
+ sleep(2); // Should be enough to ensure (some) threads are created
+ for (i = 0; i < 20 && kill(pid, 2) == 0; i++)
+ ;
+ exit(0);
+ case -1:
+ perror("fork");
+ exit(4);
+ }
+
+ while (rand() >= 0)
+ i++;
+ fprintf(stderr, "strange, this program is supposed to be killed !!!!\n");
+ return 1;
+}
Added: trunk/none/tests/pth_2sig.stderr.exp
==============================================================================
(empty)
Added: trunk/none/tests/pth_2sig.vgtest
==============================================================================
--- trunk/none/tests/pth_2sig.vgtest (added)
+++ trunk/none/tests/pth_2sig.vgtest Sat Nov 19 13:51:41 2016
@@ -0,0 +1,2 @@
+prog: pth_2sig
+vgopts: -q
|
Author: philippe
Date: Sat Nov 19 13:24:13 2016
New Revision: 16139
Log:
Improve the outer/inner setup: have the outer reporting the inner guest stacktrace
Note: the outer now unconditionally report the inner guest stacktrace.
If that would be a problem, we might add a sim-hint no-inner-guest-stacktrace
to optionally disable such outer behaviour.
Modified:
trunk/NEWS
trunk/README_DEVELOPERS
trunk/coregrind/m_execontext.c
trunk/coregrind/m_libcassert.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_stacks.c
trunk/coregrind/m_threadstate.c
trunk/coregrind/pub_core_threadstate.h
trunk/include/valgrind.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Nov 19 13:24:13 2016
@@ -58,6 +58,11 @@
* ==================== OTHER CHANGES ====================
+* For Valgrind developers: in an outer/inner setup, the outer Valgrind
+ will append the inner guest stacktrace to the inner host stacktrace.
+ This helps to investigate the errors reported by the outer, when they
+ are caused by the inner guest program (such as an inner regtest).
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
Modified: trunk/README_DEVELOPERS
==============================================================================
--- trunk/README_DEVELOPERS (original)
+++ trunk/README_DEVELOPERS Sat Nov 19 13:24:13 2016
@@ -233,6 +233,45 @@
The file tests/outer_inner.supp contains suppressions for
the irrelevant or benign errors found in the inner.
+An regression test running in the inner (e.g. memcheck/tests/badrw) will
+cause the inner to report an error, which is expected and checked
+as usual when running the regtests in an outer/inner setup.
+However, the outer will often also observe an error, e.g. a jump
+using uninitialised data, or a read/write outside the bounds of a heap
+block. When the outer reports such an error, it will output the
+inner host stacktrace. To this stacktrace, it will append the
+stacktrace of the inner guest program. For example, this is an error
+reported by the outer when the inner runs the badrw regtest:
+ ==8119== Invalid read of size 2
+ ==8119== at 0x7F2EFD7AF: ???
+ ==8119== by 0x7F2C82EAF: ???
+ ==8119== by 0x7F180867F: ???
+ ==8119== by 0x40051D: main (badrw.c:5)
+ ==8119== by 0x7F180867F: ???
+ ==8119== by 0x1BFF: ???
+ ==8119== by 0x3803B7F0: _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______ (m_execontext.c:332)
+ ==8119== by 0x40055C: main (badrw.c:22)
+ ==8119== Address 0x55cd03c is 4 bytes before a block of size 16 alloc'd
+ ==8119== at 0x2804E26D: vgPlain_arena_malloc (m_mallocfree.c:1914)
+ ==8119== by 0x2800BAB4: vgMemCheck_new_block (mc_malloc_wrappers.c:368)
+ ==8119== by 0x2800BC87: vgMemCheck_malloc (mc_malloc_wrappers.c:403)
+ ==8119== by 0x28097EAE: do_client_request (scheduler.c:1861)
+ ==8119== by 0x28097EAE: vgPlain_scheduler (scheduler.c:1425)
+ ==8119== by 0x280A7237: thread_wrapper (syswrap-linux.c:103)
+ ==8119== by 0x280A7237: run_a_thread_NORETURN (syswrap-linux.c:156)
+ ==8119== by 0x3803B7F0: _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______ (m_execontext.c:332)
+ ==8119== by 0x4C294C4: malloc (vg_replace_malloc.c:298)
+ ==8119== by 0x40051D: main (badrw.c:5)
+In the above, the first stacktrace starts with the inner host stacktrace,
+which in this case is some JITted code. Such code sometimes contains IPs
+that points in the inner guest code (0x40051D: main (badrw.c:5)).
+After the separator, we have the inner guest stacktrace.
+The second stacktrace gives the stacktrace where the heap block that was
+overrun was allocated. We see it was allocated by the inner valgrind
+in the client arena (first part of the stacktrace). The second part is
+the guest stacktrace that did the allocation.
+
+
(C) Performance tests in an outer/inner setup:
To run all the performance tests with an outer cachegrind, do :
Modified: trunk/coregrind/m_execontext.c
==============================================================================
--- trunk/coregrind/m_execontext.c (original)
+++ trunk/coregrind/m_execontext.c Sat Nov 19 13:24:13 2016
@@ -326,6 +326,12 @@
ec_htab_size_idx++;
}
+/* Used by the outer as a marker to separate the frames of the inner valgrind
+ from the frames of the inner guest frames. */
+static void _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______ (void)
+{
+}
+
/* Do the first part of getting a stack trace: actually unwind the
stack, and hand the results off to the duplicate-trace-finder
(_wrk2). */
@@ -350,6 +356,38 @@
NULL/*array to dump SP values in*/,
NULL/*array to dump FP values in*/,
first_ip_delta );
+ if (VG_(inner_threads) != NULL
+ && n_ips + 1 < VG_(clo_backtrace_size)) {
+ /* An inner V has informed us (the outer) of its thread array.
+ Append the inner guest stack trace, if we still have some
+ room in the ips array for the separator and (some) inner
+ guest IPs. */
+ UInt inner_tid;
+
+ for (inner_tid = 1; inner_tid < VG_N_THREADS; inner_tid++) {
+ if (VG_(threads)[tid].os_state.lwpid
+ == VG_(inner_threads)[inner_tid].os_state.lwpid) {
+ ThreadState* save_outer_vg_threads = VG_(threads);
+ UInt n_ips_inner_guest;
+
+ /* Append the separator + the inner guest stack trace. */
+ ips[n_ips] = (Addr)
+ _______VVVVVVVV_appended_inner_guest_stack_VVVVVVVV_______;
+ n_ips++;
+ VG_(threads) = VG_(inner_threads);
+ n_ips_inner_guest
+ = VG_(get_StackTrace)( inner_tid,
+ ips + n_ips,
+ VG_(clo_backtrace_size) - n_ips,
+ NULL/*array to dump SP values in*/,
+ NULL/*array to dump FP values in*/,
+ first_ip_delta );
+ n_ips += n_ips_inner_guest;
+ VG_(threads) = save_outer_vg_threads;
+ break;
+ }
+ }
+ }
}
return record_ExeContext_wrk2 ( ips, n_ips );
Modified: trunk/coregrind/m_libcassert.c
==============================================================================
--- trunk/coregrind/m_libcassert.c (original)
+++ trunk/coregrind/m_libcassert.c Sat Nov 19 13:24:13 2016
@@ -317,6 +317,40 @@
exit_wrk (status, False);
}
+static void print_thread_state (Bool stack_usage,
+ const HChar* prefix, ThreadId i)
+{
+ VgStack *stack
+ = (VgStack*)VG_(threads)[i].os_state.valgrind_stack_base;
+
+ VG_(printf)("\n%sThread %d: status = %s (lwpid %d)\n", prefix, i,
+ VG_(name_of_ThreadStatus)(VG_(threads)[i].status),
+ VG_(threads)[i].os_state.lwpid);
+ if (VG_(threads)[i].status != VgTs_Empty)
+ VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
+ if (stack_usage && VG_(threads)[i].client_stack_highest_byte != 0 ) {
+ Addr start, end;
+
+ start = end = 0;
+ VG_(stack_limits)(VG_(get_SP)(i), &start, &end);
+ if (start != end)
+ VG_(printf)("%sclient stack range: [%p %p] client SP: %p\n",
+ prefix,
+ (void*)start, (void*)end, (void*)VG_(get_SP)(i));
+ else
+ VG_(printf)("%sclient stack range: ??????? client SP: %p\n",
+ prefix,
+ (void*)VG_(get_SP)(i));
+ }
+ if (stack_usage && stack != 0)
+ VG_(printf)
+ ("%svalgrind stack top usage: %lu of %lu\n",
+ prefix,
+ VG_(clo_valgrind_stacksize)
+ - VG_(am_get_VgStack_unused_szB) (stack,
+ VG_(clo_valgrind_stacksize)),
+ (SizeT) VG_(clo_valgrind_stacksize));
+}
// Print the scheduler status.
static void show_sched_status_wrk ( Bool host_stacktrace,
@@ -374,29 +408,24 @@
has exited, then valgrind_stack_base points to the stack base. */
if (VG_(threads)[i].status == VgTs_Empty
&& (!exited_threads || stack == 0)) continue;
- VG_(printf)("\nThread %d: status = %s (lwpid %d)\n", i,
- VG_(name_of_ThreadStatus)(VG_(threads)[i].status),
- VG_(threads)[i].os_state.lwpid);
- if (VG_(threads)[i].status != VgTs_Empty)
- VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
- if (stack_usage && VG_(threads)[i].client_stack_highest_byte != 0 ) {
- Addr start, end;
-
- start = end = 0;
- VG_(stack_limits)(VG_(threads)[i].client_stack_highest_byte,
- &start, &end);
- if (start != end)
- VG_(printf)("client stack range: [%p %p] client SP: %p\n",
- (void*)start, (void*)end, (void*)VG_(get_SP)(i));
- else
- VG_(printf)("client stack range: ???????\n");
+ print_thread_state(stack_usage, "", i);
+ if (VG_(inner_threads) != NULL) {
+ /* An inner V has informed us (the outer) of its thread array.
+ Report the inner guest stack trace. */
+ UInt inner_tid;
+
+ for (inner_tid = 1; inner_tid < VG_N_THREADS; inner_tid++) {
+ if (VG_(threads)[i].os_state.lwpid
+ == VG_(inner_threads)[inner_tid].os_state.lwpid) {
+ ThreadState* save_outer_vg_threads = VG_(threads);
+
+ VG_(threads) = VG_(inner_threads);
+ print_thread_state(stack_usage, "INNER ", inner_tid);
+ VG_(threads) = save_outer_vg_threads;
+ break;
+ }
+ }
}
- if (stack_usage && stack != 0)
- VG_(printf)("valgrind stack top usage: %lu of %lu\n",
- VG_(clo_valgrind_stacksize)
- - VG_(am_get_VgStack_unused_szB)
- (stack, VG_(clo_valgrind_stacksize)),
- (SizeT) VG_(clo_valgrind_stacksize));
}
}
VG_(printf)("\n");
Modified: trunk/coregrind/m_scheduler/scheduler.c
==============================================================================
--- trunk/coregrind/m_scheduler/scheduler.c (original)
+++ trunk/coregrind/m_scheduler/scheduler.c Sat Nov 19 13:24:13 2016
@@ -2007,6 +2007,15 @@
SET_CLREQ_RETVAL( tid, 0 ); /* return value is meaningless */
break;
+ case VG_USERREQ__INNER_THREADS:
+ if (VG_(clo_verbosity) > 2)
+ VG_(printf)( "client request: INNER_THREADS,"
+ " addr %p\n",
+ (void*)arg[1] );
+ VG_(inner_threads) = (ThreadState*)arg[1];
+ SET_CLREQ_RETVAL( tid, 0 ); /* return value is meaningless */
+ break;
+
case VG_USERREQ__COUNT_ERRORS:
SET_CLREQ_RETVAL( tid, VG_(get_n_errs_found)() );
break;
Modified: trunk/coregrind/m_stacks.c
==============================================================================
--- trunk/coregrind/m_stacks.c (original)
+++ trunk/coregrind/m_stacks.c Sat Nov 19 13:24:13 2016
@@ -37,6 +37,10 @@
#include "pub_core_options.h"
#include "pub_core_stacks.h"
#include "pub_core_tooliface.h"
+#include "pub_core_inner.h"
+#if defined(ENABLE_INNER_CLIENT_REQUEST)
+#include "pub_core_clreq.h"
+#endif
// For expensive debugging
#define EDEBUG(fmt, args...) //VG_(debugLog)(2, "stacks", fmt, ## args)
@@ -91,6 +95,8 @@
Addr start; // Lowest stack byte, included.
Addr end; // Highest stack byte, included.
struct _Stack *next;
+ UWord outer_id; /* For an inner valgrind, stack id registered in outer
+ valgrind. */
} Stack;
static Stack *stacks;
@@ -205,7 +211,7 @@
VG_(debugLog)(2, "stacks", "register [start-end] [%p-%p] as stack %lu\n",
(void*)start, (void*)end, i->id);
-
+ INNER_REQUEST(i->outer_id = VALGRIND_STACK_REGISTER(start, end));
return i->id;
}
@@ -231,6 +237,7 @@
} else {
prev->next = i->next;
}
+ INNER_REQUEST(VALGRIND_STACK_DEREGISTER(i->outer_id));
VG_(free)(i);
return;
}
@@ -257,6 +264,7 @@
/* FIXME : swap start/end like VG_(register_stack) ??? */
i->start = start;
i->end = end;
+ INNER_REQUEST(VALGRIND_STACK_CHANGE(i->outer_id, start, end));
return;
}
i = i->next;
Modified: trunk/coregrind/m_threadstate.c
==============================================================================
--- trunk/coregrind/m_threadstate.c (original)
+++ trunk/coregrind/m_threadstate.c Sat Nov 19 13:24:13 2016
@@ -47,6 +47,8 @@
ThreadState *VG_(threads);
UInt VG_N_THREADS;
+ThreadState *VG_(inner_threads);
+
/*------------------------------------------------------------*/
/*--- Operations. ---*/
/*------------------------------------------------------------*/
@@ -68,6 +70,7 @@
sizeof(VG_(threads)[tid].os_state.exitcode),
""));
}
+ INNER_REQUEST(VALGRIND_INNER_THREADS(VG_(threads)));
}
const HChar* VG_(name_of_ThreadStatus) ( ThreadStatus status )
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Sat Nov 19 13:24:13 2016
@@ -409,11 +409,16 @@
/*--- The thread table. ---*/
/*------------------------------------------------------------*/
-/* A statically allocated array of threads. NOTE: [0] is
- never used, to simplify the simulation of initialisers for
- LinuxThreads. */
+/* An array of threads, dynamically allocated by VG_(init_Threads).
+ NOTE: [0] is never used, to simplify the simulation of initialisers
+ for LinuxThreads. */
extern ThreadState *VG_(threads);
+/* In an outer valgrind, VG_(inner_threads) stores the address of
+ the inner VG_(threads) array, as reported by the inner using
+ the client request INNER_THREADS. */
+extern ThreadState *VG_(inner_threads);
+
// The running thread. m_scheduler should be the only other module
// to write to this.
extern ThreadId VG_(running_tid);
Modified: trunk/include/valgrind.h
==============================================================================
--- trunk/include/valgrind.h (original)
+++ trunk/include/valgrind.h Sat Nov 19 13:24:13 2016
@@ -6642,8 +6642,9 @@
/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
This enum comprises an ABI exported by Valgrind to programs
- which use client requests. DO NOT CHANGE THE ORDER OF THESE
- ENTRIES, NOR DELETE ANY -- add new ones at the end. */
+ which use client requests. DO NOT CHANGE THE NUMERIC VALUES OF THESE
+ ENTRIES, NOR DELETE ANY -- add new ones at the end of the most
+ relevant group. */
typedef
enum { VG_USERREQ__RUNNING_ON_VALGRIND = 0x1001,
VG_USERREQ__DISCARD_TRANSLATIONS = 0x1002,
@@ -6713,8 +6714,13 @@
Other values are not allowed. */
VG_USERREQ__CHANGE_ERR_DISABLEMENT = 0x1801,
+ /* Some requests used for Valgrind internal, such as
+ self-test or self-hosting. */
/* Initialise IR injection */
- VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901
+ VG_USERREQ__VEX_INIT_FOR_IRI = 0x1901,
+ /* Used by Inner Valgrind to inform Outer Valgrind where to
+ find the list of inner guest threads */
+ VG_USERREQ__INNER_THREADS = 0x1902
} Vg_ClientRequest;
#if !defined(__GNUC__)
@@ -6740,6 +6746,10 @@
VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS, \
_qzz_addr, _qzz_len, 0, 0, 0)
+#define VALGRIND_INNER_THREADS(_qzz_addr) \
+ VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__INNER_THREADS, \
+ _qzz_addr, 0, 0, 0, 0)
+
/* These requests are for getting Valgrind itself to print something.
Possibly with a backtrace. This is a really ugly hack. The return value
|