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
(13) |
2
(15) |
|
3
(16) |
4
(42) |
5
(9) |
6
(20) |
7
(22) |
8
(24) |
9
(12) |
|
10
(24) |
11
(11) |
12
(2) |
13
(13) |
14
(8) |
15
|
16
(16) |
|
17
(24) |
18
(36) |
19
(100) |
20
(94) |
21
(50) |
22
(39) |
23
(10) |
|
24
(14) |
25
(19) |
26
(2) |
27
(6) |
28
(17) |
29
(9) |
30
(8) |
|
31
(21) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2009-05-17 23:09:37
|
Author: sewardj
Date: 2009-05-18 00:09:28 +0100 (Mon, 18 May 2009)
New Revision: 9874
Log:
Update expected outputs to remove extraneous trailing spaces, in line
with removal of said spaces during recent rewrite of the Helgrind
error-message printing code on this branch.
Modified:
branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc23-amd64
branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-amd64
branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-x86
branches/MESSAGING_TIDYUP/helgrind/tests/tc10_rec_lock.stderr.exp
branches/MESSAGING_TIDYUP/helgrind/tests/tc12_rwl_trivial.stderr.exp
branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc25-amd64
branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc27-amd64
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc23-amd64
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc23-amd64 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc23-amd64 2009-05-17 23:09:28 UTC (rev 9874)
@@ -1,7 +1,7 @@
Thread #x is the program's root thread
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:27)
by 0x........: main (tc09_bad_unlock.c:49)
@@ -26,7 +26,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:49)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:41)
by 0x........: main (tc09_bad_unlock.c:49)
@@ -39,7 +39,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:49)
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:27)
by 0x........: main (tc09_bad_unlock.c:50)
@@ -64,7 +64,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:50)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:41)
by 0x........: main (tc09_bad_unlock.c:50)
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-amd64
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-amd64 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-amd64 2009-05-17 23:09:28 UTC (rev 9874)
@@ -1,7 +1,7 @@
Thread #x is the program's root thread
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:27)
by 0x........: main (tc09_bad_unlock.c:49)
@@ -26,7 +26,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:49)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:41)
by 0x........: main (tc09_bad_unlock.c:49)
@@ -38,7 +38,7 @@
by 0x........: main (tc09_bad_unlock.c:49)
---------------------
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:27)
by 0x........: main (tc09_bad_unlock.c:50)
@@ -73,7 +73,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:49)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:41)
by 0x........: main (tc09_bad_unlock.c:50)
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-x86
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-x86 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc09_bad_unlock.stderr.exp-glibc25-x86 2009-05-17 23:09:28 UTC (rev 9874)
@@ -1,7 +1,7 @@
Thread #x is the program's root thread
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:27)
by 0x........: main (tc09_bad_unlock.c:49)
@@ -26,7 +26,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:49)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:41)
by 0x........: main (tc09_bad_unlock.c:49)
@@ -45,7 +45,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:49)
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:27)
by 0x........: main (tc09_bad_unlock.c:50)
@@ -70,7 +70,7 @@
by 0x........: nearly_main (tc09_bad_unlock.c:31)
by 0x........: main (tc09_bad_unlock.c:50)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc09_bad_unlock.c:41)
by 0x........: main (tc09_bad_unlock.c:50)
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc10_rec_lock.stderr.exp
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc10_rec_lock.stderr.exp 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc10_rec_lock.stderr.exp 2009-05-17 23:09:28 UTC (rev 9874)
@@ -8,7 +8,7 @@
before unlock #4
Thread #x is the program's root thread
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc10_rec_lock.c:42)
by 0x........: main (tc10_rec_lock.c:47)
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc12_rwl_trivial.stderr.exp
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc12_rwl_trivial.stderr.exp 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc12_rwl_trivial.stderr.exp 2009-05-17 23:09:28 UTC (rev 9874)
@@ -1,7 +1,7 @@
Thread #x is the program's root thread
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc12_rwl_trivial.c:29)
Lock at 0x........ was first observed
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc25-amd64
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc25-amd64 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc25-amd64 2009-05-17 23:09:28 UTC (rev 9874)
@@ -58,7 +58,7 @@
at 0x........: pthread_mutex_timedlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:121)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:125)
@@ -97,7 +97,7 @@
---------------- pthread_rwlock_* ----------------
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:179)
Lock at 0x........ was first observed
@@ -107,7 +107,7 @@
(2) no error on next line
(3) ERROR on next line
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:196)
Lock at 0x........ was first observed
@@ -119,7 +119,7 @@
(7) no error on next line
(8) ERROR on next line
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:212)
Lock at 0x........ was first observed
Modified: branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc27-amd64
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc27-amd64 2009-05-17 22:43:39 UTC (rev 9873)
+++ branches/MESSAGING_TIDYUP/helgrind/tests/tc20_verifywrap.stderr.exp-glibc27-amd64 2009-05-17 23:09:28 UTC (rev 9874)
@@ -58,7 +58,7 @@
at 0x........: pthread_mutex_timedlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:121)
-Thread #x unlocked an invalid lock at 0x........
+Thread #x unlocked an invalid lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:125)
@@ -97,7 +97,7 @@
---------------- pthread_rwlock_* ----------------
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:179)
Lock at 0x........ was first observed
@@ -107,7 +107,7 @@
(2) no error on next line
(3) ERROR on next line
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:196)
Lock at 0x........ was first observed
@@ -119,7 +119,7 @@
(7) no error on next line
(8) ERROR on next line
-Thread #x unlocked a not-locked lock at 0x........
+Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (hg_intercepts.c:...)
by 0x........: main (tc20_verifywrap.c:212)
Lock at 0x........ was first observed
|
|
From: <sv...@va...> - 2009-05-17 22:43:47
|
Author: sewardj
Date: 2009-05-17 23:43:39 +0100 (Sun, 17 May 2009)
New Revision: 9873
Log:
A simple test to demonstrate heap, stack, and global overrun
detection, with XML output.
Added:
branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.c
branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stderr.exp
branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stdout.exp
branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.vgtest
Modified:
branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/Makefile.am
Modified: branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/Makefile.am
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/Makefile.am 2009-05-17 21:45:01 UTC (rev 9872)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/Makefile.am 2009-05-17 22:43:39 UTC (rev 9873)
@@ -29,6 +29,7 @@
hackedbz2.stderr.exp-glibc28-amd64 \
hp_bounds.vgtest hp_bounds.stderr.exp \
hp_dangle.vgtest hp_dangle.stderr.exp \
+ hsg.vgtest hsg.stdout.exp hsg.stderr.exp \
idiv.vgtest-disabled idiv.stderr.exp \
imul.vgtest-disabled imul.stderr.exp \
justify.vgtest justify.stderr.exp \
@@ -67,7 +68,7 @@
check_PROGRAMS = \
add and arith bad_percentify base ccc cmp fp \
globalerr hackedbz2 \
- hp_bounds hp_dangle idiv imul \
+ hp_bounds hp_dangle hsg idiv imul \
justify mm not neg or partial \
preen_invars preen_invars_so.so \
pth_create pth_specific realloc \
Added: branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.c
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.c (rev 0)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.c 2009-05-17 22:43:39 UTC (rev 9873)
@@ -0,0 +1,48 @@
+
+/* A simple test to demonstrate heap, stack, and global overrun
+ detection. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+short ga[100];
+
+__attribute__((noinline))
+int addup_wrongly ( short* arr )
+{
+ int sum = 0, i;
+ for (i = 0; i <= 100; i++)
+ sum += (int)arr[i];
+ return sum;
+}
+
+__attribute__((noinline))
+int do_other_stuff ( void )
+{
+ short la[100];
+ return 123 + addup_wrongly(la);
+}
+
+__attribute__((noinline))
+int do_stupid_malloc_stuff ( void )
+{
+ int sum = 0;
+ unsigned char* duh = malloc(100 * sizeof(char));
+ sum += duh[-1];
+ free(duh);
+ sum += duh[50];
+ return sum;
+}
+
+int main ( void )
+{
+ long s = addup_wrongly(ga);
+ s += do_other_stuff();
+ s += do_stupid_malloc_stuff();
+ if (s == 123456789) {
+ fprintf(stdout, "well, i never!\n");
+ } else {
+ fprintf(stdout, "boringly as expected\n");
+ }
+ return 0;
+}
Added: branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stderr.exp
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stderr.exp (rev 0)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stderr.exp 2009-05-17 22:43:39 UTC (rev 9873)
@@ -0,0 +1,231 @@
+<?xml version="1.0"?>
+
+<valgrindoutput>
+
+<protocolversion>4</protocolversion>
+<protocoltool>exp-ptrcheck</protocoltool>
+
+<preamble>
+ <line>...</line>
+ <line>...</line>
+ <line>...</line>
+ <line>...</line>
+ <line>...</line>
+ <line>...</line>
+ <line>...</line>
+</preamble>
+
+<pid>...</pid>
+<ppid>...</ppid>
+<tool>exp-ptrcheck</tool>
+
+<args>
+ <vargv>...</vargv>
+ <argv>
+ <exe>./hsg</exe>
+ </argv>
+</args>
+
+<status>
+ <state>RUNNING</state>
+ <time>...</time>
+</status>
+
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>SorG</kind>
+ <what>Invalid read of size 2</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>addup_wrongly</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <auxwhat>Address 0x........ expected vs actual:</auxwhat>
+ <auxwhat>Expected: global array "ga" in object with soname "NONE"</auxwhat>
+ <auxwhat>Actual: unknown</auxwhat>
+</error>
+
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>SorG</kind>
+ <what>Invalid read of size 2</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>addup_wrongly</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>do_other_stuff</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <auxwhat>Address 0x........ expected vs actual:</auxwhat>
+ <auxwhat>Expected: stack array "la" in frame 1 back from here</auxwhat>
+ <auxwhat>Actual: unknown</auxwhat>
+</error>
+
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>Heap</kind>
+ <what>Invalid read of size 1</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>do_stupid_malloc_stuff</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <auxwhat>Address 0x........ is 1 bytes before the accessing pointer's</auxwhat>
+ <auxwhat>legitimate range, a block of size 100 alloc'd</auxwhat>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>malloc</fn>
+ <dir>...</dir>
+ <file>vg_replace_malloc.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>do_stupid_malloc_stuff</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+</error>
+
+<error>
+ <unique>0x........</unique>
+ <tid>...</tid>
+ <kind>Heap</kind>
+ <what>Invalid read of size 1</what>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>do_stupid_malloc_stuff</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ <auxwhat>Address 0x........ is 50 bytes inside the accessing pointer's</auxwhat>
+ <auxwhat>once-legitimate range, a block of size 100 free'd</auxwhat>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>free</fn>
+ <dir>...</dir>
+ <file>vg_replace_malloc.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>do_stupid_malloc_stuff</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>hsg.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+</error>
+
+<status>
+ <state>FINISHED</state>
+ <time>...</time>
+</status>
+
+<errorcounts>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+</errorcounts>
+
+<suppcounts>...</suppcounts>
+
+</valgrindoutput>
+
Added: branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stdout.exp
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stdout.exp (rev 0)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.stdout.exp 2009-05-17 22:43:39 UTC (rev 9873)
@@ -0,0 +1 @@
+boringly as expected
Added: branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.vgtest
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.vgtest (rev 0)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/tests/hsg.vgtest 2009-05-17 22:43:39 UTC (rev 9873)
@@ -0,0 +1,3 @@
+prog: hsg
+vgopts: --xml=yes --xml-fd=2 --log-file=/dev/null
+stderr_filter: ../../memcheck/tests/filter_xml
|
|
From: Nicholas N. <n.n...@gm...> - 2009-05-17 22:42:56
|
On Mon, May 18, 2009 at 8:33 AM, Julian Seward <js...@ac...> wrote:
>>
>> It's probably nicer to allow NULL to be passed as the before_pp()
>> function, to save writing functions like this. Passing NULL works
>> with at least some of the other initialisation functions, eg.
>> VG_(track_*)().
>
> Oh, definitely. I just wasn't sure if that was allowable style
> (or even if it's possible). Since we have
>
> #define VG_TDICT_CALL(fn, args...) \
> ( tl_assert2(VG_(tdict).fn, \
> "you forgot to set VgToolInterface function '" #fn "'"), \
> VG_(tdict).fn(args) )
>
> then I'd have to test the fn at the call points, hence,
>
> VG_TDICT_CALL( tool_before_pp_Error, err );
>
> would become
>
> if (VG_(tdict).tool_before_pp_Error)
> VG_TDICT_CALL( tool_before_pp_Error, err );
>
> In short I wasn't aware of any macros to support checking whether a
> particular dictionary function is NULL or not. So played safe.
We have this:
#define VG_TRACK(fn, args...) \
do { \
if (VG_(tdict).track_##fn) \
VG_(tdict).track_##fn(args); \
} while(0)
It only applies to the VG_(track_*) functions. For most (all?) of the
others the function is mandatory, but in this case doing the test
should be fine. If you want to generalise, you could create a
VG_TDICT_CALL_OPTIONAL macro.
Hmm, I see that the print_extra_suppression_info() and
read_extra_suppression_info() functions are similar, but they don't
accept NULL. Perhaps they should, and then the empty functions could
be removed from Helgrind and DRD.
N
|
|
From: Julian S. <js...@ac...> - 2009-05-17 22:30:49
|
On Monday 18 May 2009, Nicholas Nethercote wrote:
> On Mon, May 18, 2009 at 2:29 AM, <sv...@va...> wrote:
> > --- branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:26:48 UTC
> > (rev 9863) +++ branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17
> > 16:29:20 UTC (rev 9864) @@ -194,6 +194,12 @@
> > return False;
> > }
> >
> > +static void drd_tool_error_before_pp(Error* const e)
> > +{
> > + /* No need to do anything; drd_tool_error_pp does all
> > + the work. */
> > +}
> > +
>
> It's probably nicer to allow NULL to be passed as the before_pp()
> function, to save writing functions like this. Passing NULL works
> with at least some of the other initialisation functions, eg.
> VG_(track_*)().
Oh, definitely. I just wasn't sure if that was allowable style
(or even if it's possible). Since we have
#define VG_TDICT_CALL(fn, args...) \
( tl_assert2(VG_(tdict).fn, \
"you forgot to set VgToolInterface function '" #fn "'"), \
VG_(tdict).fn(args) )
then I'd have to test the fn at the call points, hence,
VG_TDICT_CALL( tool_before_pp_Error, err );
would become
if (VG_(tdict).tool_before_pp_Error)
VG_TDICT_CALL( tool_before_pp_Error, err );
In short I wasn't aware of any macros to support checking whether a
particular dictionary function is NULL or not. So played safe.
J
|
|
From: Nicholas N. <n.n...@gm...> - 2009-05-17 22:22:51
|
On Mon, May 18, 2009 at 2:29 AM, <sv...@va...> wrote:
> --- branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:26:48 UTC (rev 9863)
> +++ branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:29:20 UTC (rev 9864)
> @@ -194,6 +194,12 @@
> return False;
> }
>
> +static void drd_tool_error_before_pp(Error* const e)
> +{
> + /* No need to do anything; drd_tool_error_pp does all
> + the work. */
> +}
> +
It's probably nicer to allow NULL to be passed as the before_pp()
function, to save writing functions like this. Passing NULL works
with at least some of the other initialisation functions, eg.
VG_(track_*)().
Nick
|
|
From: <sv...@va...> - 2009-05-17 21:45:09
|
Author: sewardj Date: 2009-05-17 22:45:01 +0100 (Sun, 17 May 2009) New Revision: 9872 Log: Add a simple XML output test, using tc06_two_races. Added: branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.stderr.exp branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.stdout.exp branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.vgtest Modified: branches/MESSAGING_TIDYUP/helgrind/tests/Makefile.am Modified: branches/MESSAGING_TIDYUP/helgrind/tests/Makefile.am =================================================================== --- branches/MESSAGING_TIDYUP/helgrind/tests/Makefile.am 2009-05-17 21:02:36 UTC (rev 9871) +++ branches/MESSAGING_TIDYUP/helgrind/tests/Makefile.am 2009-05-17 21:45:01 UTC (rev 9872) @@ -30,6 +30,8 @@ tc05_simple_race.stderr.exp \ tc06_two_races.vgtest tc06_two_races.stdout.exp \ tc06_two_races.stderr.exp \ + tc06_two_races_xml.vgtest tc06_two_races_xml.stdout.exp \ + tc06_two_races_xml.stderr.exp \ tc07_hbl1.vgtest tc07_hbl1.stdout.exp tc07_hbl1.stderr.exp \ tc08_hbl2.vgtest tc08_hbl2.stdout.exp tc08_hbl2.stderr.exp \ tc09_bad_unlock.vgtest tc09_bad_unlock.stdout.exp \ Added: branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.stderr.exp =================================================================== --- branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.stderr.exp (rev 0) +++ branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.stderr.exp 2009-05-17 21:45:01 UTC (rev 9872) @@ -0,0 +1,318 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>4</protocolversion> +<protocoltool>helgrind</protocoltool> + +<preamble> + <line>...</line> + <line>...</line> + <line>...</line> + <line>...</line> + <line>...</line> + <line>...</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>helgrind</tool> + +<args> + <vargv>...</vargv> + <argv> + <exe>./tc06_two_races</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +<announcethread> + <hthreadid>1</threadid> + <isrootthread></isrootthread> +</announcethread> + +<announcethread> + <hthreadid>2</threadid> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>clone</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>do_clone</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_create@@GLIBC_2.2.5</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>pthread_create@*</fn> + <dir>...</dir> + <file>hg_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + </stack> +</announcethread> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>Race</kind> + <xwhat> + <text>Possible data race during read of size 4 at 0x........ by thread #x</text> + <hthreadid>1</hthreadid> + </xwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + </stack> + <xauxwhat> + <text>This conflicts with a previous write of size 4 by thread #x</text> + <hthreadid>2</hthreadid> + </xauxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>child_fn</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>mythread_wrapper</fn> + <dir>...</dir> + <file>hg_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>start_thread</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>clone</fn> + </frame> + </stack> + <auxwhat>Location 0x........ is 0 bytes inside global var "unprot1"</auxwhat> + <xauxwhat><text>declared at tc06_two_races.c:9</text> <file>tc06_two_races.c</file> <line>...</line> </xauxwhat> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>Race</kind> + <xwhat> + <text>Possible data race during write of size 4 at 0x........ by thread #x</text> + <hthreadid>1</hthreadid> + </xwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + </stack> + <xauxwhat> + <text>This conflicts with a previous write of size 4 by thread #x</text> + <hthreadid>2</hthreadid> + </xauxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>child_fn</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>mythread_wrapper</fn> + <dir>...</dir> + <file>hg_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>start_thread</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>clone</fn> + </frame> + </stack> + <auxwhat>Location 0x........ is 0 bytes inside global var "unprot1"</auxwhat> + <xauxwhat><text>declared at tc06_two_races.c:9</text> <file>tc06_two_races.c</file> <line>...</line> </xauxwhat> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>Race</kind> + <xwhat> + <text>Possible data race during read of size 4 at 0x........ by thread #x</text> + <hthreadid>1</hthreadid> + </xwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + </stack> + <xauxwhat> + <text>This conflicts with a previous write of size 4 by thread #x</text> + <hthreadid>2</hthreadid> + </xauxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>child_fn</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>mythread_wrapper</fn> + <dir>...</dir> + <file>hg_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>start_thread</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>clone</fn> + </frame> + </stack> + <auxwhat>Location 0x........ is 0 bytes inside global var "unprot2"</auxwhat> + <xauxwhat><text>declared at tc06_two_races.c:9</text> <file>tc06_two_races.c</file> <line>...</line> </xauxwhat> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>Race</kind> + <xwhat> + <text>Possible data race during write of size 4 at 0x........ by thread #x</text> + <hthreadid>1</hthreadid> + </xwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + </stack> + <xauxwhat> + <text>This conflicts with a previous write of size 4 by thread #x</text> + <hthreadid>2</hthreadid> + </xauxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>child_fn</fn> + <dir>...</dir> + <file>tc06_two_races.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>mythread_wrapper</fn> + <dir>...</dir> + <file>hg_intercepts.c</file> + <line>...</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>start_thread</fn> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>clone</fn> + </frame> + </stack> + <auxwhat>Location 0x........ is 0 bytes inside global var "unprot2"</auxwhat> + <xauxwhat><text>declared at tc06_two_races.c:9</text> <file>tc06_two_races.c</file> <line>...</line> </xauxwhat> +</error> + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> + <pair> + <count>...</count> + <unique>0x........</unique> + </pair> +</errorcounts> + +<suppcounts>...</suppcounts> + +</valgrindoutput> + Added: branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.stdout.exp =================================================================== Added: branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.vgtest =================================================================== --- branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.vgtest (rev 0) +++ branches/MESSAGING_TIDYUP/helgrind/tests/tc06_two_races_xml.vgtest 2009-05-17 21:45:01 UTC (rev 9872) @@ -0,0 +1,3 @@ +prog: tc06_two_races +vgopts: --read-var-info=yes --xml=yes --xml-fd=2 --log-file=/dev/null +stderr_filter: ../../memcheck/tests/filter_xml |
|
From: <sv...@va...> - 2009-05-17 21:02:43
|
Author: sewardj
Date: 2009-05-17 22:02:36 +0100 (Sun, 17 May 2009)
New Revision: 9871
Log:
Update expected outputs.
Modified:
branches/MESSAGING_TIDYUP/memcheck/tests/long_namespace_xml.stderr.exp
branches/MESSAGING_TIDYUP/memcheck/tests/xml1.stderr.exp64
Modified: branches/MESSAGING_TIDYUP/memcheck/tests/long_namespace_xml.stderr.exp
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/tests/long_namespace_xml.stderr.exp 2009-05-17 21:02:14 UTC (rev 9870)
+++ branches/MESSAGING_TIDYUP/memcheck/tests/long_namespace_xml.stderr.exp 2009-05-17 21:02:36 UTC (rev 9871)
@@ -2,7 +2,8 @@
<valgrindoutput>
-<protocolversion>3</protocolversion>
+<protocolversion>4</protocolversion>
+<protocoltool>memcheck</protocoltool>
<preamble>
<line>...</line>
@@ -81,6 +82,11 @@
</stack>
</error>
+<status>
+ <state>FINISHED</state>
+ <time>...</time>
+</status>
+
<errorcounts>
<pair>
<count>...</count>
@@ -88,11 +94,6 @@
</pair>
</errorcounts>
-<status>
- <state>FINISHED</state>
- <time>...</time>
-</status>
-
<suppcounts>...</suppcounts>
</valgrindoutput>
Modified: branches/MESSAGING_TIDYUP/memcheck/tests/xml1.stderr.exp64
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/tests/xml1.stderr.exp64 2009-05-17 21:02:14 UTC (rev 9870)
+++ branches/MESSAGING_TIDYUP/memcheck/tests/xml1.stderr.exp64 2009-05-17 21:02:36 UTC (rev 9871)
@@ -2,7 +2,8 @@
<valgrindoutput>
-<protocolversion>3</protocolversion>
+<protocolversion>4</protocolversion>
+<protocoltool>memcheck</protocoltool>
<preamble>
<line>...</line>
@@ -344,47 +345,20 @@
<what>Syscall param exit(status) contains uninitialised byte(s)</what>
</error>
-<errorcounts>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
-</errorcounts>
-
<status>
<state>FINISHED</state>
<time>...</time>
</status>
-<suppcounts>...</suppcounts>
-
<error>
<unique>0x........</unique>
<tid>...</tid>
<kind>Leak_DefinitelyLost</kind>
- <what>396 bytes in 1 blocks are definitely lost in loss record ... of ...</what>
- <leakedbytes>396</leakedbytes>
- <leakedblocks>1</leakedblocks>
+ <xwhat>
+ <text>396 bytes in 1 blocks are definitely lost in loss record ... of ...</text>
+ <leakedbytes>396</leakedbytes>
+ <leakedblocks>1</leakedblocks>
+ </xwhat>
<stack>
<frame>
<ip>0x........</ip>
@@ -429,5 +403,34 @@
</stack>
</error>
+<errorcounts>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+ <pair>
+ <count>...</count>
+ <unique>0x........</unique>
+ </pair>
+</errorcounts>
+
+<suppcounts>...</suppcounts>
+
</valgrindoutput>
|
|
From: <sv...@va...> - 2009-05-17 21:02:22
|
Author: sewardj
Date: 2009-05-17 22:02:14 +0100 (Sun, 17 May 2009)
New Revision: 9870
Log:
In XML mode, fix up order of output at program termination, so as to
comply with xml-output-protocol4.txt, and also be in accordance with
anticipated fix for #186790. Output order for non-XML mode is
unchanged.
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_main.c
Modified: branches/MESSAGING_TIDYUP/coregrind/m_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_main.c 2009-05-17 19:28:14 UTC (rev 9869)
+++ branches/MESSAGING_TIDYUP/coregrind/m_main.c 2009-05-17 21:02:14 UTC (rev 9870)
@@ -2299,28 +2299,48 @@
if (VG_(clo_xml)) {
HChar buf[50];
- if (VG_(needs).core_errors || VG_(needs).tool_errors) {
- VG_(show_error_counts_as_XML)();
- VG_(printf_xml)( "\n" );
- }
VG_(elapsed_wallclock_time)(buf);
VG_(printf_xml_no_f_c)( "<status>\n"
" <state>FINISHED</state>\n"
" <time>%t</time>\n"
"</status>\n",
buf);
- VG_(printf_xml)( "\n" );
}
/* Print out file descriptor summary and stats. */
if (VG_(clo_track_fds))
VG_(show_open_fds)();
- if (VG_(needs).core_errors || VG_(needs).tool_errors)
- VG_(show_all_errors)();
+ /* ** HACK ALERT ** HACK ALERT ** HACK ALERT ** HACK ALERT ** */
+ if (VG_(clo_xml)) {
+ /* THIS IS WHAT WE SHOULD CHANGE IT TO */
+ /* For the moment, do it like this (the "right way") in XML
+ mode, so that output is as described in XML Protocol 4. */
+ /* A good test is memcheck/tests/amd64/defcfaexpr; ensure
+ the output does not change */
+ VG_TDICT_CALL(tool_fini, 0/*exitcode*/);
- VG_TDICT_CALL(tool_fini, 0/*exitcode*/);
+ /* Show the error counts. */
+ if (VG_(needs).core_errors || VG_(needs).tool_errors) {
+ VG_(printf_xml)( "\n" );
+ VG_(show_error_counts_as_XML)();
+ VG_(printf_xml)( "\n" );
+ }
+ /* In XML mode, this merely prints the used suppressions. */
+ if (VG_(needs).core_errors || VG_(needs).tool_errors)
+ VG_(show_all_errors)();
+
+ } else {
+ /* THIS IS WHAT IT HAS ALWAYS BEEN,
+ resulting in https://bugs.kde.org/show_bug.cgi?id=186790 */
+ if (VG_(needs).core_errors || VG_(needs).tool_errors)
+ VG_(show_all_errors)();
+
+ VG_TDICT_CALL(tool_fini, 0/*exitcode*/);
+ }
+ /* END ** HACK ALERT ** HACK ALERT ** HACK ALERT ** HACK ALERT ** */
+
if (VG_(clo_xml)) {
VG_(printf_xml)("\n");
VG_(printf_xml)("</valgrindoutput>\n");
|
|
From: <sv...@va...> - 2009-05-17 19:28:21
|
Author: sewardj
Date: 2009-05-17 20:28:14 +0100 (Sun, 17 May 2009)
New Revision: 9869
Log:
Document new XML output control options --xml-fd=, --xml-file= and
--xml-socket=. Also add advice on recommended flags when using XML
mode.
Modified:
branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml
Modified: branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml
===================================================================
--- branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml 2009-05-17 18:54:29 UTC (rev 9868)
+++ branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml 2009-05-17 19:28:14 UTC (rev 9869)
@@ -826,12 +826,94 @@
</term>
<listitem>
<para>When enabled, output will be in XML format. This is aimed
- at making life easier for tools that consume Valgrind's output as
- input, such as GUI front ends. Currently this option only works
- with Memcheck.</para>
+ at making life easier for tools that consume Valgrind's output
+ as input, such as GUI front ends. Currently this option works
+ with Memcheck, Helgrind and Ptrcheck. The output format is
+ specified in the
+ file
+ <computeroutput>docs/internals/xml-output-protocol4.txt</computeroutput>
+ in the source tree for Valgrind 3.5.0 or later.</para>
</listitem>
</varlistentry>
+
+
+
+ <varlistentry id="opt.xml-fd" xreflabel="--xml-fd">
+ <term>
+ <option><![CDATA[--xml-fd=<number> [default: -1, disabled] ]]></option>
+ </term>
+ <listitem>
+ <para>Specifies that Valgrind should send its XML output to the
+ specified file descriptor. By default, this is disabled. To
+ use XML output, you need to give <option>--xml=yes</option> to
+ tell the tool you want XML output. You also need to use one of
+ <option>--xml-fd=</option>, <option>--xml-file=</option>
+ or <option>--xml-socket=</option> to specify where the XML is to
+ be sent. If you request XML output but do not specify a
+ destination for it, Valgrind will refuse to start up.</para>
+
+ <para>Note that XML output is sent on a different channel (file
+ descriptor) to normal text output. It is entirely legitimate to
+ select XML output, use one
+ of <option>--xml-fd=</option>, <option>--xml-file=</option>
+ or <option>--xml-socket=</option> to specify where it should be
+ sent, and at the same time use one of
+ <option>--log-fd=</option>, <option>--log-file=</option>
+ or <option>--log-socket=</option> to specify where any residual
+ text messages should be sent.</para>
+
+ <para>The recommended flags for a GUI to pass, when requesting
+ XML output, are: <option>--xml=yes</option> to enable XML
+ output,
+ <option>--xml-file=</option> to send the XML output to a
+ (presumably GUI-selected) file, <option>--log-file=</option> to
+ send the text output to a second GUI-selected file,
+ and <option>-q</option> to restrict the text output to critical
+ error messages created by Valgrind itself. For example, failure
+ to read a specified suppressions file counts as a critical error
+ message. In this way, for a successful run the text output file
+ will be empty. But if it isn't empty, then it will contain
+ important information which the GUI user should be made aware
+ of.
+
+ <para>Note that GUIs are strongly recommended to also
+ specify <option>--child-silent-after-fork=yes</option>.
+ </para>
+
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="opt.xml-file" xreflabel="--xml-file">
+ <term>
+ <option><![CDATA[--xml-file=<filename> ]]></option>
+ </term>
+ <listitem>
+ <para>Specifies that Valgrind should send its XML output
+ to the specified file. Any <option>%p</option>
+ or <option>%q</option> sequences appearing in the filename are
+ expanded in exactly the same way as they are
+ for <option>--log-file=</option>. See the description
+ of <option>--log-file=</option> for details.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="opt.xml-socket" xreflabel="--xml-socket">
+ <term>
+ <option><![CDATA[--xml-socket=<ip-address:port-number> ]]></option>
+ </term>
+ <listitem>
+ <para>Specifies that Valgrind should send its XML output the
+ specified port at the specified IP address. This option behaves
+ identically to <option>--log-socket=</option>, except that it
+ specifies the destination for XML output rather than for text
+ output. See the description of <option>--log-socket=</option>
+ for further details.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="opt.xml-user-comment" xreflabel="--xml-user-comment">
<term>
<option><![CDATA[--xml-user-comment=<string> ]]></option>
|
|
From: <sv...@va...> - 2009-05-17 18:54:33
|
Author: sewardj Date: 2009-05-17 19:54:29 +0100 (Sun, 17 May 2009) New Revision: 9868 Log: Produce the "--tool=" documentation in the same style as all the other flags. Modified: branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml Modified: branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml =================================================================== --- branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml 2009-05-17 18:40:16 UTC (rev 9867) +++ branches/MESSAGING_TIDYUP/docs/xml/manual-core.xml 2009-05-17 18:54:29 UTC (rev 9868) @@ -575,14 +575,20 @@ <para>The single most important option.</para> -<itemizedlist> - <listitem id="tool_name"> - <para><option>--tool=<name></option> [default=memcheck]</para> - <para>Run the Valgrind tool called <emphasis>name</emphasis>, - e.g. Memcheck, Cachegrind, etc.</para> - </listitem> -</itemizedlist> +<variablelist> + <varlistentry id="tool_name" xreflabel="--tool"> + <term> + <option><![CDATA[--tool=<name> [default: memcheck] ]]></option> + </term> + <listitem> + <para>Run the Valgrind tool called <emphasis>name</emphasis>, + e.g. Memcheck, Cachegrind, etc.</para> + </listitem> + </varlistentry> + +</variablelist> + </sect2> |
|
From: <sv...@va...> - 2009-05-17 18:40:19
|
Author: sewardj
Date: 2009-05-17 19:40:16 +0100 (Sun, 17 May 2009)
New Revision: 9867
Log:
Fix a couple of broken tags.
Modified:
branches/MESSAGING_TIDYUP/docs/xml/FAQ.xml
branches/MESSAGING_TIDYUP/memcheck/docs/mc-manual.xml
Modified: branches/MESSAGING_TIDYUP/docs/xml/FAQ.xml
===================================================================
--- branches/MESSAGING_TIDYUP/docs/xml/FAQ.xml 2009-05-17 18:35:24 UTC (rev 9866)
+++ branches/MESSAGING_TIDYUP/docs/xml/FAQ.xml 2009-05-17 18:40:16 UTC (rev 9867)
@@ -145,7 +145,7 @@
<screen>valgrind: m_mallocfree.c:248 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed.</screen>
<para>or like this:</para>
<screen>valgrind: m_mallocfree.c:442 (mk_inuse_bszB): Assertion 'bszB != 0' failed.</screen>
- <para>or otherwise aborts or crashes in m_mallocfree.c.<para/>
+ <para>or otherwise aborts or crashes in m_mallocfree.c.</para>
</question>
<answer id="a-bugdeath">
Modified: branches/MESSAGING_TIDYUP/memcheck/docs/mc-manual.xml
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/docs/mc-manual.xml 2009-05-17 18:35:24 UTC (rev 9866)
+++ branches/MESSAGING_TIDYUP/memcheck/docs/mc-manual.xml 2009-05-17 18:40:16 UTC (rev 9867)
@@ -154,7 +154,7 @@
shows "reachable" and "indirectly lost" blocks. (In other words, it
shows all blocks, except suppressed ones, so
<computeroutput>--show-all</computeroutput> would be a better name for
- it.)
+ it.)</para>
</listitem>
</varlistentry>
|
|
From: <sv...@va...> - 2009-05-17 18:35:33
|
Author: sewardj
Date: 2009-05-17 19:35:24 +0100 (Sun, 17 May 2009)
New Revision: 9866
Log:
Update command line help output to take account of new XML-related
flags.
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_main.c
branches/MESSAGING_TIDYUP/none/tests/cmdline1.stdout.exp
branches/MESSAGING_TIDYUP/none/tests/cmdline2.stdout.exp
Modified: branches/MESSAGING_TIDYUP/coregrind/m_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_main.c 2009-05-17 17:10:33 UTC (rev 9865)
+++ branches/MESSAGING_TIDYUP/coregrind/m_main.c 2009-05-17 18:35:24 UTC (rev 9866)
@@ -139,8 +139,11 @@
" tools that make use of it (Memcheck, Helgrind)\n"
"\n"
" user options for Valgrind tools that report errors:\n"
-" --xml=yes all output is in XML (some tools only)\n"
-" --xml-user-comment=STR copy STR verbatim to XML output\n"
+" --xml=yes emit error output in XML (some tools only)\n"
+" --xml-fd=<number> XML output to file descriptor\n"
+" --xml-file=<file> XML output to <file>\n"
+" --xml-socket=ipaddr:port XML output to socket ipaddr:port\n"
+" --xml-user-comment=STR copy STR verbatim into XML output\n"
" --demangle=no|yes automatically demangle C++ names? [yes]\n"
" --num-callers=<number> show <number> callers in stack traces [12]\n"
" --error-limit=no|yes stop showing new errors if too many? [yes]\n"
Modified: branches/MESSAGING_TIDYUP/none/tests/cmdline1.stdout.exp
===================================================================
--- branches/MESSAGING_TIDYUP/none/tests/cmdline1.stdout.exp 2009-05-17 17:10:33 UTC (rev 9865)
+++ branches/MESSAGING_TIDYUP/none/tests/cmdline1.stdout.exp 2009-05-17 18:35:24 UTC (rev 9866)
@@ -29,8 +29,11 @@
tools that make use of it (Memcheck, Helgrind)
user options for Valgrind tools that report errors:
- --xml=yes all output is in XML (some tools only)
- --xml-user-comment=STR copy STR verbatim to XML output
+ --xml=yes emit error output in XML (some tools only)
+ --xml-fd=<number> XML output to file descriptor
+ --xml-file=<file> XML output to <file>
+ --xml-socket=ipaddr:port XML output to socket ipaddr:port
+ --xml-user-comment=STR copy STR verbatim into XML output
--demangle=no|yes automatically demangle C++ names? [yes]
--num-callers=<number> show <number> callers in stack traces [12]
--error-limit=no|yes stop showing new errors if too many? [yes]
Modified: branches/MESSAGING_TIDYUP/none/tests/cmdline2.stdout.exp
===================================================================
--- branches/MESSAGING_TIDYUP/none/tests/cmdline2.stdout.exp 2009-05-17 17:10:33 UTC (rev 9865)
+++ branches/MESSAGING_TIDYUP/none/tests/cmdline2.stdout.exp 2009-05-17 18:35:24 UTC (rev 9866)
@@ -29,8 +29,11 @@
tools that make use of it (Memcheck, Helgrind)
user options for Valgrind tools that report errors:
- --xml=yes all output is in XML (some tools only)
- --xml-user-comment=STR copy STR verbatim to XML output
+ --xml=yes emit error output in XML (some tools only)
+ --xml-fd=<number> XML output to file descriptor
+ --xml-file=<file> XML output to <file>
+ --xml-socket=ipaddr:port XML output to socket ipaddr:port
+ --xml-user-comment=STR copy STR verbatim into XML output
--demangle=no|yes automatically demangle C++ names? [yes]
--num-callers=<number> show <number> callers in stack traces [12]
--error-limit=no|yes stop showing new errors if too many? [yes]
|
|
From: <sv...@va...> - 2009-05-17 17:10:38
|
Author: sewardj
Date: 2009-05-17 18:10:33 +0100 (Sun, 17 May 2009)
New Revision: 9865
Log:
Add some further command-line checks when XML mode is requested, so as
to avoid some situations which could confuse users.
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_main.c
Modified: branches/MESSAGING_TIDYUP/coregrind/m_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_main.c 2009-05-17 16:29:20 UTC (rev 9864)
+++ branches/MESSAGING_TIDYUP/coregrind/m_main.c 2009-05-17 17:10:33 UTC (rev 9865)
@@ -358,6 +358,8 @@
vg_assert( VG_(args_for_valgrind) );
+ /* BEGIN command-line processing loop */
+
for (i = 0; i < VG_(sizeXA)( VG_(args_for_valgrind) ); i++) {
HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_valgrind), i );
@@ -574,6 +576,8 @@
}
}
+ /* END command-line processing loop */
+
/* Make VEX control parameters sane */
if (VG_(clo_vex_control).guest_chase_thresh
@@ -608,28 +612,56 @@
/*NOTREACHED*/
}
+ vg_assert( VG_(clo_gen_suppressions) >= 0 );
+ vg_assert( VG_(clo_gen_suppressions) <= 2 );
+
/* If we've been asked to emit XML, mash around various other
options so as to constrain the output somewhat, and to remove
- any need for user input during the run. */
+ any need for user input during the run.
+ */
if (VG_(clo_xml)) {
- /* Disable suppression generation (requires user input) */
- //VG_(clo_gen_suppressions) = 0;
- /* Disable attaching to GDB (requires user input) */
- //VG_(clo_db_attach) = False;
- /* Set a known verbosity level */
- //VG_(clo_verbosity) = 1;
+
+ /* We can't allow --gen-suppressions=yes, since that requires us
+ to print the error and then ask the user if she wants a
+ suppression for it, but in XML mode we won't print it until
+ we know whether we also need to print a suppression. Hence a
+ circular dependency. So disallow this.
+ (--gen-suppressions=all is still OK since we don't need any
+ user interaction in this case.) */
+ if (VG_(clo_gen_suppressions) == 1) {
+ VG_(UMSG)(
+ "When --xml=yes is specified, only --gen-suppressions=no\n"
+ "or --gen-suppressions=all are allowed, but not "
+ "--gen-suppressions=yes.\n");
+ /* FIXME: this is really a misuse of VG_(err_bad_option). */
+ VG_(err_bad_option)(
+ "--xml=yes together with --gen-suppressions=yes");
+ }
+
+ /* We can't allow DB attaching (or we maybe could, but results
+ could be chaotic ..) since it requires user input. Hence
+ disallow. */
+ if (VG_(clo_db_attach)) {
+ VG_(UMSG)("--db-attach=yes is not allowed in XML mode,\n"
+ "as it would require user input.\n");
+ /* FIXME: this is really a misuse of VG_(err_bad_option). */
+ VG_(err_bad_option)(
+ "--xml=yes together with --db-attach=yes");
+ }
+
+ /* Disallow dump_error in XML mode; sounds like a recipe for
+ chaos. No big deal; dump_error is a flag for debugging V
+ itself. */
+ if (VG_(clo_dump_error) > 0) {
+ /* FIXME: this is really a misuse of VG_(err_bad_option). */
+ VG_(err_bad_option)(
+ "--xml=yes together with --dump-error=");
+ }
+
/* Disable error limits (this might be a bad idea!) */
VG_(clo_error_limit) = False;
/* Disable emulation warnings */
- //VG_(clo_show_emwarns) = False;
- /* Disable waiting for GDB to debug Valgrind */
- //VG_(clo_wait_for_gdb) = False;
- /* No file-descriptor leak checking yet */
- //VG_(clo_track_fds) = False;
- /* Disable timestamped output */
- //VG_(clo_time_stamp) = False;
- /* Disable heap profiling, since that prints lots of stuff. */
- //VG_(clo_profile_heap) = False;
+
/* Also, we want to set options for the leak checker, but that
will have to be done in Memcheck's flag-handling code, not
here. */
@@ -795,6 +827,21 @@
}
}
+ /* If we've got this far, and XML mode was requested, but no XML
+ output channel appears to have been specified, just stop. We
+ could continue, and XML output will simply vanish into nowhere,
+ but that is likely to confuse the hell out of users, which is
+ distinctly Ungood. */
+ if (VG_(clo_xml) && tmp_xml_fd == -1) {
+ VG_(UMSG)(
+ "--xml=yes has been specified, but there is no XML output\n"
+ "destination. You must specify an XML output destination\n"
+ "using --xml-fd=, --xml-file= or --xml=socket=.\n" );
+ /* FIXME: this is really a misuse of VG_(err_bad_option). */
+ VG_(err_bad_option)(
+ "--xml=yes, but no XML destination specified");
+ }
+
// Finalise the output fds: the log fd ..
if (tmp_log_fd >= 0) {
|
|
From: <sv...@va...> - 2009-05-17 16:29:24
|
Author: sewardj
Date: 2009-05-17 17:29:20 +0100 (Sun, 17 May 2009)
New Revision: 9864
Log:
In the core/tool iface, move the .before_pp_Error method from
VG_(needs_xml_output) to VG_(needs_tool_errors), and restore
VG_(needs_xml_output) to what it needs originally. .before_pp_Error
now becomes mandatory for functions which report errors. It doesn't
have anything to do with XML output, and so putting it in the
VG_(needs_xml_output) dictionary was a mistake, which this commit
corrects.
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c
branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h
branches/MESSAGING_TIDYUP/drd/drd_error.c
branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c
branches/MESSAGING_TIDYUP/helgrind/hg_main.c
branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h
branches/MESSAGING_TIDYUP/memcheck/mc_main.c
Modified: branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -225,6 +225,7 @@
void VG_(needs_tool_errors)(
Bool (*eq) (VgRes, Error*, Error*),
+ void (*before_pp) (Error*),
void (*pp) (Error*),
Bool show_TIDs,
UInt (*update) (Error*),
@@ -237,6 +238,7 @@
{
VG_(needs).tool_errors = True;
VG_(tdict).tool_eq_Error = eq;
+ VG_(tdict).tool_before_pp_Error = before_pp;
VG_(tdict).tool_pp_Error = pp;
VG_(tdict).tool_show_ThreadIDs_for_errors = show_TIDs;
VG_(tdict).tool_update_extra = update;
@@ -315,12 +317,9 @@
VG_(tdict).tool_client_redzone_szB = client_malloc_redzone_szB;
}
-void VG_(needs_xml_output)(
- void (*before_pp_Error)( Error* )
-)
+void VG_(needs_xml_output)( void )
{
VG_(needs).xml_output = True;
- VG_(tdict).tool_before_pp_Error = before_pp_Error;
}
void VG_(needs_final_IR_tidy_pass)(
Modified: branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h 2009-05-17 16:29:20 UTC (rev 9864)
@@ -117,6 +117,7 @@
// VG_(needs).tool_errors
Bool (*tool_eq_Error) (VgRes, Error*, Error*);
+ void (*tool_before_pp_Error) (Error*);
void (*tool_pp_Error) (Error*);
Bool tool_show_ThreadIDs_for_errors;
UInt (*tool_update_extra) (Error*);
@@ -162,7 +163,7 @@
IRSB* (*tool_final_IR_tidy_pass) (IRSB*);
// VG_(needs).xml_output
- void (*tool_before_pp_Error) (Error*);
+ // (none)
// -- Event tracking functions ------------------------------------
void (*track_new_mem_startup) (Addr, SizeT, Bool, Bool, Bool, ULong);
Modified: branches/MESSAGING_TIDYUP/drd/drd_error.c
===================================================================
--- branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -194,6 +194,12 @@
return False;
}
+static void drd_tool_error_before_pp(Error* const e)
+{
+ /* No need to do anything; drd_tool_error_pp does all
+ the work. */
+}
+
static void drd_tool_error_pp(Error* const e)
{
switch (VG_(get_error_kind)(e))
@@ -450,6 +456,7 @@
{
// Tool error reporting.
VG_(needs_tool_errors)(drd_tool_error_eq,
+ drd_tool_error_before_pp,
drd_tool_error_pp,
True,
drd_tool_error_update_extra,
Modified: branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -176,6 +176,7 @@
VG_(needs_core_errors) ();
VG_(needs_tool_errors) (pc_eq_Error,
+ pc_before_pp_Error,
pc_pp_Error,
True,/*show TIDs for errors*/
pc_update_Error_extra,
@@ -185,7 +186,7 @@
pc_get_error_name,
pc_print_extra_suppression_info);
- VG_(needs_xml_output) (pc_before_pp_Error);
+ VG_(needs_xml_output) ();
VG_(needs_syscall_wrapper)( h_pre_syscall,
h_post_syscall );
Modified: branches/MESSAGING_TIDYUP/helgrind/hg_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/hg_main.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/helgrind/hg_main.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -4195,6 +4195,7 @@
VG_(needs_core_errors) ();
VG_(needs_tool_errors) (HG_(eq_Error),
+ HG_(before_pp_Error),
HG_(pp_Error),
False,/*show TIDs for errors*/
HG_(update_extra),
@@ -4204,7 +4205,7 @@
HG_(get_error_name),
HG_(print_extra_suppression_info));
- VG_(needs_xml_output) (HG_(before_pp_Error));
+ VG_(needs_xml_output) ();
VG_(needs_command_line_options)(hg_process_cmd_line_option,
hg_print_usage,
Modified: branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h
===================================================================
--- branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h 2009-05-17 16:29:20 UTC (rev 9864)
@@ -284,6 +284,16 @@
// similar errors occurring.
Bool (*eq_Error)(VgRes res, Error* e1, Error* e2),
+ // We give tools a chance to have a look at errors
+ // just before they are printed. That is, before_pp_Error is
+ // called just before pp_Error itself. This gives the tool a
+ // chance to look at the just-about-to-be-printed error, so as to
+ // emit any arbitrary output if wants to, before the error itself
+ // is printed. This functionality was added to allow Helgrind to
+ // print thread-announcement messages immediately before the
+ // errors that refer to them.
+ void (*before_pp_Error)(Error* err),
+
// Print error context.
void (*pp_Error)(Error* err),
@@ -424,17 +434,7 @@
/* Can the tool do XML output? This is a slight misnomer, because the tool
* is not requesting the core to do anything, rather saying "I can handle
* it". */
-extern void VG_(needs_xml_output)(
- // We give tools a chance to have a look at errors
- // just before they are printed. That is, before_pp_Error is
- // called just before pp_Error itself. This gives the tool a chance
- // to look at the just-about-to-be-printed error, so as to emit any
- // arbitrary output they want to, before the error itself is
- // printed. This functionality was added to allow Helgrind to print
- // thread-announcement messages in XML form, but is in fact called
- // regardless of whether or not we're in XML mode.
- void (*before_pp_Error)( Error* )
-);
+extern void VG_(needs_xml_output) ( void );
/* Does the tool want to have one final pass over the IR after tree
building but before instruction selection? If so specify the
Modified: branches/MESSAGING_TIDYUP/memcheck/mc_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/mc_main.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/memcheck/mc_main.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -5690,6 +5690,7 @@
VG_(needs_core_errors) ();
VG_(needs_tool_errors) (MC_(eq_Error),
+ MC_(before_pp_Error),
MC_(pp_Error),
True,/*show TIDs for errors*/
MC_(update_Error_extra),
@@ -5717,7 +5718,7 @@
MC_(malloc_usable_size),
MC_MALLOC_REDZONE_SZB );
- VG_(needs_xml_output) (MC_(before_pp_Error));
+ VG_(needs_xml_output) ();
VG_(track_new_mem_startup) ( mc_new_mem_startup );
VG_(track_new_mem_stack_signal)( make_mem_undefined_w_tid );
|
|
From: <sv...@va...> - 2009-05-17 16:26:52
|
Author: sewardj Date: 2009-05-17 17:26:48 +0100 (Sun, 17 May 2009) New Revision: 9863 Log: Minor wording changes. Modified: branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt Modified: branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt =================================================================== --- branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt 2009-05-17 15:50:27 UTC (rev 9862) +++ branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt 2009-05-17 16:26:48 UTC (rev 9863) @@ -81,7 +81,10 @@ The definition of Protocol 4 now follows. It is structured similarly to that of the previous protocols, except that there is a separate -definition of ERROR for each of Memcheck, Helgrind and Ptrcheck. +definition of a nonterminal called TOOLSPECIFIC for each of Memcheck, +Helgrind and Ptrcheck. The XWHAT and XAUXWHAT nonterminals also have +tool-specific components. Apart from that, the structure is common +to all supported tools. ==================================================================== |
|
From: <sv...@va...> - 2009-05-17 15:50:31
|
Author: sewardj
Date: 2009-05-17 16:50:27 +0100 (Sun, 17 May 2009)
New Revision: 9862
Log:
drd_report_data_race(): track recent changes in calling conventions
for VG_(get_data_description).
Modified:
branches/MESSAGING_TIDYUP/drd/drd_error.c
Modified: branches/MESSAGING_TIDYUP/drd/drd_error.c
===================================================================
--- branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 15:26:39 UTC (rev 9861)
+++ branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 15:50:27 UTC (rev 9862)
@@ -96,21 +96,43 @@
void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
{
AddrInfo ai;
- const unsigned descr_size = 256;
- Char* descr1 = VG_(malloc)("drd.error.drdr2.1", descr_size);
- Char* descr2 = VG_(malloc)("drd.error.drdr2.2", descr_size);
+ XArray* /* of HChar */ descr1
+ = VG_(newXA)( VG_(malloc), "drd.error.drdr2.1",
+ VG_(free), sizeof(HChar) );
+ XArray* /* of HChar */ descr2
+ = VG_(newXA)( VG_(malloc), "drd.error.drdr2.2",
+ VG_(free), sizeof(HChar) );
+
tl_assert(dri);
tl_assert(dri->addr);
tl_assert(dri->size > 0);
tl_assert(descr1);
tl_assert(descr2);
- descr1[0] = 0;
- descr2[0] = 0;
- VG_(get_data_description)(descr1, descr2, descr_size, dri->addr);
- if (descr1[0] == 0)
+ (void) VG_(get_data_description)(descr1, descr2, dri->addr);
+ /* If there's nothing in descr1/2, free them. Why is it safe to to
+ VG_(indexXA) at zero here? Because VG_(get_data_description)
+ guarantees to zero terminate descr1/2 regardless of the outcome
+ of the call. So there's always at least one element in each XA
+ after the call.
+ */
+ if (0 == VG_(strlen)( VG_(indexXA)( descr1, 0 ))) {
+ VG_(deleteXA)( descr1 );
+ descr1 = NULL;
+ }
+ if (0 == VG_(strlen)( VG_(indexXA)( descr2, 0 ))) {
+ VG_(deleteXA)( descr2 );
+ descr2 = NULL;
+ }
+ /* Assume (assert) that VG_(get_data_description) fills in descr1
+ before it fills in descr2 */
+ if (descr1 == NULL)
+ tl_assert(descr2 == NULL);
+ /* So anyway. Do we have something useful? */
+ if (descr1 == NULL)
{
+ /* No. Do Plan B. */
describe_malloced_addr(dri->addr, dri->size, &ai);
}
VG_(message)(Vg_UserMsg,
@@ -121,10 +143,11 @@
dri->addr,
dri->size);
VG_(pp_ExeContext)(VG_(get_error_where)(err));
- if (descr1[0])
+ if (descr1 != NULL)
{
- VG_(message)(Vg_UserMsg, "%s\n", descr1);
- VG_(message)(Vg_UserMsg, "%s\n", descr2);
+ VG_(message)(Vg_UserMsg, "%s\n", (HChar*)VG_(indexXA)(descr1, 0));
+ if (descr2 != NULL)
+ VG_(message)(Vg_UserMsg, "%s\n", (HChar*)VG_(indexXA)(descr2, 0));
}
else if (ai.akind == eMallocd && ai.lastchange)
{
@@ -160,8 +183,10 @@
dri->access_type);
}
- VG_(free)(descr2);
- VG_(free)(descr1);
+ if (descr2)
+ VG_(deleteXA)(descr2);
+ if (descr1)
+ VG_(deleteXA)(descr1);
}
static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2)
|
|
From: <sv...@va...> - 2009-05-17 15:26:43
|
Author: sewardj Date: 2009-05-17 16:26:39 +0100 (Sun, 17 May 2009) New Revision: 9861 Log: Hopefully finalise the spec and bring it into line with previously committed implementations. This change enhances the commonality of ERROR descriptions across the supported tools, and reduces the extent of the tool-specific aspects. Modified: branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt Modified: branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt =================================================================== --- branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt 2009-05-17 15:07:51 UTC (rev 9860) +++ branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt 2009-05-17 15:26:39 UTC (rev 9861) @@ -42,11 +42,16 @@ tool-specific. For Helgrind, a TOOLSPECIFIC may also contain a so-called thread-announcement record (described below). +Overall there is a very high degree of format commonality between the +three tools. Once a GUI is able to display the output correctly for +one tool, it should be easy to extend it for the other two. + Protocol 4 changes for Memcheck ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Protocol 4 for Memcheck is identical to Protocol 3, except that +Protocol 4 for Memcheck is similar to Protocol 3, but has a number +of changes to make it fit in the common framework: - the SUPPCOUNTS nonterminal now appears after the "Zero or more ERRORs" block, and not before it. @@ -57,12 +62,23 @@ - ERRORs for Memcheck may contain a SUPPRESSION field, which gives the corresponding suppression for it. +- ERRORs for Memcheck now use the XWHAT and XAUXWHAT nonterminals, as + well as WHAT and XWHAT. + +- The ad-hoc blocks <leakedbytes> and <leakedblocks> used by Memcheck + have been moved inside the XWHAT for the relevant error kinds. This + facilitates a common definition of ERROR across all three tools. + The first two changes are required in order to correct a longstanding design flaw in the way Memcheck interacts with Valgrind's error management mechanism. See bug #186790 (https://bugs.kde.org/show_bug.cgi?id=186790). The third change was requested in #191189 (https://bugs.kde.org/show_bug.cgi?id=191189). +For GUI authors upgrading from Protocol 3 or earlier, the most +significant new concept to grasp is the relationship between WHAT and +XWHAT, and between AUXWHAT and XAUXWHAT. + The definition of Protocol 4 now follows. It is structured similarly to that of the previous protocols, except that there is a separate definition of ERROR for each of Memcheck, Helgrind and Ptrcheck. @@ -97,9 +113,9 @@ protocol version 3. 3.5.X emits version 4. The TEXT in <protocoltool> is either "memcheck", "helgrind" or -"ptrcheck" and determines the allowed format of the ERROR nonterminal. -Note that <protocoltool> is only present when the protocol version is -4 or above. +"exp-ptrcheck" and determines the allowed format of the ERROR +nonterminal. Note that <protocoltool> is only present when the +protocol version is 4 or above. PROTOCOL for version 4 @@ -307,11 +323,14 @@ WHAT supplies a single line of text, which is a human-understandable, primary description of an error. -XWHAT is an extended version of WHAT. It also contains a piece -of text intended for human reading, but in addition may contain -arbitrary other tagged data. This extra data is tool-specific, and -is intended to supply GUIs with links to other data in the -sequence of TOOLSPECIFICs, that are associated with the error. +XWHAT is an extended version of WHAT. It also contains a piece of +text intended for human reading, but in addition may contain arbitrary +other tagged data. This extra data is tool-specific. One of its +purposes is to supply GUIs with links to other data in the sequence of +TOOLSPECIFICs, that are associated with the error. Another purpose is +wrap certain quantities (numbers, file names, etc) embedded in the +message, so that the GUIs can get hold of them without having to parse +the text itself. For example, we could get: @@ -360,8 +379,8 @@ ------------------------------------ ERROR defines an error, and is the most complex nonterminal. For all -of the tools, the structure is mostly common, and always conforms to -the following: +of the tools, the structure is common, and always conforms to the +following: <error> <unique>HEX64</unique> @@ -373,7 +392,7 @@ STACK - ... tool-specific fields ... + zero or more: (either AUXWHAT or XAUXWHAT or STACK) optionally: SUPPRESSION </error> @@ -392,14 +411,19 @@ below, for each tool. * The "(either WHAT or XWHAT)" gives a primary description of the - error. WHAT and XWHAT are described above. + error. WHAT and XWHAT are defined earlier in this file. Any XWHATs + appearing here may contain tool-specific subcomponents. * Optionally, a second line of primary description may be present. * A STACK gives the primary source location for the error. -* There then follow zero or more "... tool-specific fields ...", - which provide further (auxiliary) information about the error. +* There then follow zero or more of "(either AUXWHAT or XAUXWHAT or + STACK)". These give further (auxiliary) information about the + error, possibly including stack traces. They should be shown to the + user in the order they appear. AUXWHAT and XAUXWHAT are defined + earlier in this file. Any XAUXWHATs appearing here may contain + tool-specific subcomponents. * Optionally, as the last field, a SUPPRESSION may be provided. This contains a suppression that would hide the error. @@ -418,11 +442,6 @@ ERROR details for Memcheck -------------------------- -The "... tool-specific fields ..." for Memcheck consist of zero or -more of "(either AUXWHAT or XAUXWHAT or STACK)". They should be shown -to the user in the order they appear. - - XWHATs (for definition, see above) may contain the following extra components (along with the mandatory <text>...</text> component): @@ -529,11 +548,6 @@ ERROR details for Ptrcheck -------------------------- -The "... tool-specific fields ..." for Ptrcheck consist of -zero or more of "(either AUXWHAT or XAUXWHAT or STACK)". -They should be shown to the user in the order they appear. - - Ptrcheck does not produce any XWHAT records, despite the fact that "ERROR definition -- common structure" says that tools may do so. @@ -616,11 +630,6 @@ ERROR details for Helgrind -------------------------- -The "... tool-specific fields ..." for Helgrind consist of -zero or more of "(either AUXWHAT or XAUXWHAT or STACK)". -They should be shown to the user in the order they appear. - - XWHATs (for definition, see above) may contain the following extra components (along with the mandatory <text>...</text> component): |
|
From: <sv...@va...> - 2009-05-17 15:07:58
|
Author: sewardj
Date: 2009-05-17 16:07:51 +0100 (Sun, 17 May 2009)
New Revision: 9860
Log:
When emitting XML, use %t rather than %s for any strings that we suspect
might need escaping.
Modified:
branches/MESSAGING_TIDYUP/memcheck/mc_errors.c
Modified: branches/MESSAGING_TIDYUP/memcheck/mc_errors.c
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/mc_errors.c 2009-05-17 14:07:57 UTC (rev 9859)
+++ branches/MESSAGING_TIDYUP/memcheck/mc_errors.c 2009-05-17 15:07:51 UTC (rev 9860)
@@ -445,7 +445,7 @@
// the following code is untested. Bad.
if (xml) {
emit( " <kind>CoreMemError</kind>\n" );
- emit( " <what>%s contains unaddressable byte(s)</what>\n",
+ emiN( " <what>%t contains unaddressable byte(s)</what>\n",
VG_(get_error_string)(err));
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
} else {
@@ -503,7 +503,7 @@
MC_(any_value_errors) = True;
if (xml) {
emit( " <kind>SyscallParam</kind>\n" );
- emit( " <what>Syscall param %s contains "
+ emiN( " <what>Syscall param %t contains "
"uninitialised byte(s)</what>\n",
VG_(get_error_string)(err) );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
@@ -525,7 +525,7 @@
MC_(any_value_errors) = True;
if (xml) {
emit( " <kind>SyscallParam</kind>\n" );
- emit( " <what>Syscall param %s points to %s byte(s)</what>\n",
+ emiN( " <what>Syscall param %t points to %s byte(s)</what>\n",
VG_(get_error_string)(err),
extra->Err.MemParam.isAddrErr
? "unaddressable" : "uninitialised" );
@@ -652,8 +652,8 @@
if (xml) {
emit( " <kind>Overlap</kind>\n" );
if (extra->Err.Overlap.szB == 0) {
- emit( " <what>Source and destination overlap "
- "in %s(%#lx, %#lx)\n</what>\n",
+ emiN( " <what>Source and destination overlap "
+ "in %t(%#lx, %#lx)\n</what>\n",
VG_(get_error_string)(err),
extra->Err.Overlap.dst, extra->Err.Overlap.src );
} else {
@@ -666,7 +666,7 @@
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
} else {
if (extra->Err.Overlap.szB == 0) {
- emit( "Source and destination overlap in %s(%#lx, %#lx)\n",
+ emiN( "Source and destination overlap in %t(%#lx, %#lx)\n",
VG_(get_error_string)(err),
extra->Err.Overlap.dst, extra->Err.Overlap.src );
} else {
|
|
From: <sv...@va...> - 2009-05-17 14:08:04
|
Author: sewardj
Date: 2009-05-17 15:07:57 +0100 (Sun, 17 May 2009)
New Revision: 9859
Log:
* Make assertion failures interact with XML output better:
- ensure the stack trace goes on the text output channel
- restore printing of "</valgrindoutput>" in case of
abnormal termination
* Merge a small part of r9832 from the trunk, the part to
fix generation of bogus stack traces
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c
Modified: branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c 2009-05-17 14:02:56 UTC (rev 9858)
+++ branches/MESSAGING_TIDYUP/coregrind/m_libcassert.c 2009-05-17 14:07:57 UTC (rev 9859)
@@ -130,6 +130,7 @@
{
Addr stacktop;
Addr ips[BACKTRACE_DEPTH];
+ Int n_ips;
ThreadState *tst
= VG_(get_ThreadState)( VG_(lwpid_to_vgtid)( VG_(gettid)() ) );
@@ -141,16 +142,18 @@
}
stacktop = tst->os_state.valgrind_stack_init_SP;
+
+ n_ips =
+ VG_(get_StackTrace_wrk)(
+ 0/*tid is unknown*/,
+ ips, BACKTRACE_DEPTH,
+ NULL/*array to dump SP values in*/,
+ NULL/*array to dump FP values in*/,
+ ip, sp, fp, lr, sp, stacktop
+ );
+ VG_(clo_xml) = False;
+ VG_(pp_StackTrace) (ips, n_ips);
- VG_(get_StackTrace_wrk)(
- 0/*tid is unknown*/,
- ips, BACKTRACE_DEPTH,
- NULL/*array to dump SP values in*/,
- NULL/*array to dump FP values in*/,
- ip, sp, fp, lr, sp, stacktop
- );
- VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
-
VG_(show_sched_status)();
VG_(printf)(
"\n"
@@ -194,7 +197,7 @@
}
if (VG_(clo_xml))
- VG_(UMSG)("</valgrindoutput>\n");
+ VG_(printf_xml)("</valgrindoutput>\n");
// Treat vg_assert2(0, "foo") specially, as a panicky abort
if (VG_STREQ(expr, "0")) {
@@ -215,7 +218,7 @@
Addr ip, Addr sp, Addr fp, Addr lr )
{
if (VG_(clo_xml))
- VG_(UMSG)("</valgrindoutput>\n");
+ VG_(printf_xml)("</valgrindoutput>\n");
VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str);
report_and_quit(report, ip, sp, fp, lr);
}
@@ -239,7 +242,7 @@
void VG_(unimplemented) ( Char* msg )
{
if (VG_(clo_xml))
- VG_(UMSG)("</valgrindoutput>\n");
+ VG_(printf_xml)("</valgrindoutput>\n");
VG_(UMSG)("\n");
VG_(UMSG)("Valgrind detected that your program requires\n");
VG_(UMSG)("the following unimplemented functionality:\n");
|
|
From: <sv...@va...> - 2009-05-17 14:03:00
|
Author: sewardj
Date: 2009-05-17 15:02:56 +0100 (Sun, 17 May 2009)
New Revision: 9858
Log:
Update calls to VG_(needs_xml_output) to be in accordance with
core/tool iface change committed in r9846/7.
Modified:
branches/MESSAGING_TIDYUP/memcheck/mc_include.h
branches/MESSAGING_TIDYUP/memcheck/mc_main.c
Modified: branches/MESSAGING_TIDYUP/memcheck/mc_include.h
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/mc_include.h 2009-05-17 14:00:44 UTC (rev 9857)
+++ branches/MESSAGING_TIDYUP/memcheck/mc_include.h 2009-05-17 14:02:56 UTC (rev 9858)
@@ -305,9 +305,10 @@
/* Standard functions for error and suppressions as required by the
core/tool iface */
-Bool MC_(eq_Error) ( VgRes res, Error* e1, Error* e2 );
-void MC_(pp_Error) ( Error* err );
-UInt MC_(update_Error_extra)( Error* err );
+Bool MC_(eq_Error) ( VgRes res, Error* e1, Error* e2 );
+void MC_(before_pp_Error) ( Error* err );
+void MC_(pp_Error) ( Error* err );
+UInt MC_(update_Error_extra) ( Error* err );
Bool MC_(is_recognised_suppression) ( Char* name, Supp* su );
Modified: branches/MESSAGING_TIDYUP/memcheck/mc_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/mc_main.c 2009-05-17 14:00:44 UTC (rev 9857)
+++ branches/MESSAGING_TIDYUP/memcheck/mc_main.c 2009-05-17 14:02:56 UTC (rev 9858)
@@ -5716,8 +5716,9 @@
MC_(realloc),
MC_(malloc_usable_size),
MC_MALLOC_REDZONE_SZB );
- VG_(needs_xml_output) ();
+ VG_(needs_xml_output) (MC_(before_pp_Error));
+
VG_(track_new_mem_startup) ( mc_new_mem_startup );
VG_(track_new_mem_stack_signal)( make_mem_undefined_w_tid );
VG_(track_new_mem_brk) ( make_mem_undefined_w_tid );
|
|
From: <sv...@va...> - 2009-05-17 14:00:52
|
Author: sewardj
Date: 2009-05-17 15:00:44 +0100 (Sun, 17 May 2009)
New Revision: 9857
Log:
Update XML output for Memcheck, to sync with Protocol 4 revisions
that were committed in r9856.
Modified:
branches/MESSAGING_TIDYUP/memcheck/mc_errors.c
Modified: branches/MESSAGING_TIDYUP/memcheck/mc_errors.c
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/mc_errors.c 2009-05-17 13:59:14 UTC (rev 9856)
+++ branches/MESSAGING_TIDYUP/memcheck/mc_errors.c 2009-05-17 14:00:44 UTC (rev 9857)
@@ -41,6 +41,7 @@
#include "pub_tool_tooliface.h"
#include "pub_tool_threadstate.h"
#include "pub_tool_debuginfo.h" // VG_(get_dataname_and_offset)
+#include "pub_tool_xarray.h"
#include "mc_include.h"
@@ -109,11 +110,10 @@
PtrdiffT offset;
} DataSym;
- // Is described by Dwarf debug info. Arbitrary strings. Must
- // be the same length.
+ // Is described by Dwarf debug info. XArray*s of HChar.
struct {
- Char descr1[96];
- Char descr2[96];
+ XArray* /* of HChar */ descr1;
+ XArray* /* of HChar */ descr2;
} Variable;
// Could only narrow it down to be the PLT/GOT/etc of a given
@@ -258,6 +258,13 @@
/*--- Printing errors ---*/
/*------------------------------------------------------------*/
+/* This is the "this error is due to be printed shortly; so have a
+ look at it any print any preamble you want" function. Which, in
+ Memcheck, we don't use. Hence a no-op.
+*/
+void MC_(before_pp_Error) ( Error* err ) {
+}
+
/* Do a printf-style operation on either the XML or normal output
channel, depending on the setting of VG_(clo_xml).
*/
@@ -277,7 +284,7 @@
emit_WRK(format, vargs);
va_end(vargs);
}
-static void emit_no_f_c ( HChar* format, ... )
+static void emiN ( HChar* format, ... ) /* NO FORMAT CHECK */
{
va_list vargs;
va_start(vargs, format);
@@ -340,29 +347,36 @@
}
case Addr_DataSym:
- emit_no_f_c( "%sAddress 0x%llx is %llu bytes "
- "inside data symbol \"%t\"%s\n",
- xpre,
- (ULong)a,
- (ULong)ai->Addr.DataSym.offset,
- ai->Addr.DataSym.name,
- xpost );
+ emiN( "%sAddress 0x%llx is %llu bytes "
+ "inside data symbol \"%t\"%s\n",
+ xpre,
+ (ULong)a,
+ (ULong)ai->Addr.DataSym.offset,
+ ai->Addr.DataSym.name,
+ xpost );
break;
case Addr_Variable:
- if (ai->Addr.Variable.descr1[0] != '\0')
- emit( "%s%s%s\n", xpre, ai->Addr.Variable.descr1, xpost);
- if (ai->Addr.Variable.descr2[0] != '\0')
- emit( "%s%s%s\n", xpre, ai->Addr.Variable.descr2, xpost);
+ /* Note, no need for XML tags here, because descr1/2 will
+ already have <auxwhat> or <xauxwhat>s on them, in XML
+ mode. */
+ if (ai->Addr.Variable.descr1)
+ emit( "%s%s\n",
+ VG_(clo_xml) ? " " : " ",
+ (HChar*)VG_(indexXA)(ai->Addr.Variable.descr1, 0) );
+ if (ai->Addr.Variable.descr2)
+ emit( "%s%s\n",
+ VG_(clo_xml) ? " " : " ",
+ (HChar*)VG_(indexXA)(ai->Addr.Variable.descr2, 0) );
break;
case Addr_SectKind:
- emit_no_f_c( "%sAddress 0x%llx is in the %t segment of %t%s\n",
- xpre,
- (ULong)a,
- VG_(pp_SectKind)(ai->Addr.SectKind.kind),
- ai->Addr.SectKind.objname,
- xpost );
+ emiN( "%sAddress 0x%llx is in the %t segment of %t%s\n",
+ xpre,
+ (ULong)a,
+ VG_(pp_SectKind)(ai->Addr.SectKind.kind),
+ ai->Addr.SectKind.objname,
+ xpost );
break;
default:
@@ -394,27 +408,6 @@
return loss;
}
-static void mc_pp_msg( Char* xml_name, Error* err, const HChar* format, ... )
-{
- HChar* xpre = VG_(clo_xml) ? " <what>" : "";
- HChar* xpost = VG_(clo_xml) ? "</what>" : "";
- Char buf[256];
- va_list vargs;
-
- if (VG_(clo_xml))
- VG_(printf_xml)(" <kind>%s</kind>\n", xml_name);
- // Stick xpre and xpost on the front and back of the format string.
- VG_(snprintf)(buf, 256, "%s%s%s\n", xpre, format, xpost);
- va_start(vargs, format);
- if (VG_(clo_xml)) {
- VG_(vprintf_xml) ( buf, vargs );
- } else {
- VG_(vmessage) ( Vg_UserMsg, buf, vargs );
- }
- va_end(vargs);
- VG_(pp_ExeContext)( VG_(get_error_where)(err) );
-}
-
static void mc_pp_origin ( ExeContext* ec, UInt okind )
{
HChar* src = NULL;
@@ -429,208 +422,331 @@
tl_assert(src); /* guards against invalid 'okind' */
if (VG_(clo_xml)) {
- VG_(printf_xml)(" <origin>\n");
- VG_(printf_xml)("<what>Uninitialised value was created%s</what>",
- src);
+ emit( " <auxwhat>Uninitialised value was created%s</auxwhat>\n",
+ src);
VG_(pp_ExeContext)( ec );
- VG_(printf_xml)(" </origin>\n");
} else {
- VG_(message)(Vg_UserMsg, " Uninitialised value was created%s\n",
- src);
+ emit( " Uninitialised value was created%s\n", src);
VG_(pp_ExeContext)( ec );
}
}
void MC_(pp_Error) ( Error* err )
{
+ const Bool xml = VG_(clo_xml); /* a shorthand */
MC_Error* extra = VG_(get_error_extra)(err);
switch (VG_(get_error_kind)(err)) {
- case Err_CoreMem: {
+ case Err_CoreMem:
/* What the hell *is* a CoreMemError? jrs 2005-May-18 */
/* As of 2006-Dec-14, it's caused by unaddressable bytes in a
signal handler frame. --njn */
- mc_pp_msg("CoreMemError", err,
- "%s contains unaddressable byte(s)",
- VG_(get_error_string)(err));
+ // JRS 17 May 09: None of our regtests exercise this; hence AFAIK
+ // the following code is untested. Bad.
+ if (xml) {
+ emit( " <kind>CoreMemError</kind>\n" );
+ emit( " <what>%s contains unaddressable byte(s)</what>\n",
+ VG_(get_error_string)(err));
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ } else {
+ emit( "%s contains unaddressable byte(s)\n",
+ VG_(get_error_string)(err));
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ }
break;
- }
case Err_Value:
MC_(any_value_errors) = True;
- if (1 || extra->Err.Value.otag == 0) {
- mc_pp_msg("UninitValue", err,
- "Use of uninitialised value of size %d",
- extra->Err.Value.szB);
+ if (xml) {
+ emit( " <kind>UninitValue</kind>\n" );
+ emit( " <what>Use of uninitialised value of size %ld</what>\n",
+ extra->Err.Value.szB );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ if (extra->Err.Value.origin_ec)
+ mc_pp_origin( extra->Err.Value.origin_ec,
+ extra->Err.Value.otag & 3 );
} else {
- mc_pp_msg("UninitValue", err,
- "Use of uninitialised value of size %d (otag %u)",
- extra->Err.Value.szB, extra->Err.Value.otag);
+ /* Could also show extra->Err.Cond.otag if debugging origin
+ tracking */
+ emit( "Use of uninitialised value of size %ld\n",
+ extra->Err.Value.szB );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ if (extra->Err.Value.origin_ec)
+ mc_pp_origin( extra->Err.Value.origin_ec,
+ extra->Err.Value.otag & 3 );
}
- if (extra->Err.Value.origin_ec)
- mc_pp_origin( extra->Err.Value.origin_ec,
- extra->Err.Value.otag & 3 );
break;
case Err_Cond:
MC_(any_value_errors) = True;
- if (1 || extra->Err.Cond.otag == 0) {
- mc_pp_msg("UninitCondition", err,
- "Conditional jump or move depends"
- " on uninitialised value(s)");
+ if (xml) {
+ emit( " <kind>UninitCondition</kind>\n" );
+ emit( " <what>Conditional jump or move depends"
+ " on uninitialised value(s)</what>\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ if (extra->Err.Cond.origin_ec)
+ mc_pp_origin( extra->Err.Cond.origin_ec,
+ extra->Err.Cond.otag & 3 );
} else {
- mc_pp_msg("UninitCondition", err,
- "Conditional jump or move depends"
- " on uninitialised value(s) (otag %u)",
- extra->Err.Cond.otag);
+ /* Could also show extra->Err.Cond.otag if debugging origin
+ tracking */
+ emit( "Conditional jump or move depends"
+ " on uninitialised value(s)\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ if (extra->Err.Cond.origin_ec)
+ mc_pp_origin( extra->Err.Cond.origin_ec,
+ extra->Err.Cond.otag & 3 );
}
- if (extra->Err.Cond.origin_ec)
- mc_pp_origin( extra->Err.Cond.origin_ec,
- extra->Err.Cond.otag & 3 );
break;
case Err_RegParam:
MC_(any_value_errors) = True;
- mc_pp_msg("SyscallParam", err,
- "Syscall param %s contains uninitialised byte(s)",
- VG_(get_error_string)(err));
- if (extra->Err.RegParam.origin_ec)
- mc_pp_origin( extra->Err.RegParam.origin_ec,
- extra->Err.RegParam.otag & 3 );
+ if (xml) {
+ emit( " <kind>SyscallParam</kind>\n" );
+ emit( " <what>Syscall param %s contains "
+ "uninitialised byte(s)</what>\n",
+ VG_(get_error_string)(err) );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ if (extra->Err.RegParam.origin_ec)
+ mc_pp_origin( extra->Err.RegParam.origin_ec,
+ extra->Err.RegParam.otag & 3 );
+ } else {
+ emit( "Syscall param %s contains uninitialised byte(s)\n",
+ VG_(get_error_string)(err) );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ if (extra->Err.RegParam.origin_ec)
+ mc_pp_origin( extra->Err.RegParam.origin_ec,
+ extra->Err.RegParam.otag & 3 );
+ }
break;
case Err_MemParam:
if (!extra->Err.MemParam.isAddrErr)
MC_(any_value_errors) = True;
- mc_pp_msg("SyscallParam", err,
- "Syscall param %s points to %s byte(s)",
- VG_(get_error_string)(err),
- ( extra->Err.MemParam.isAddrErr
- ? "unaddressable" : "uninitialised" ));
- mc_pp_AddrInfo(VG_(get_error_address)(err),
- &extra->Err.MemParam.ai, False);
- if (extra->Err.MemParam.origin_ec && !extra->Err.MemParam.isAddrErr)
- mc_pp_origin( extra->Err.MemParam.origin_ec,
- extra->Err.MemParam.otag & 3 );
+ if (xml) {
+ emit( " <kind>SyscallParam</kind>\n" );
+ emit( " <what>Syscall param %s points to %s byte(s)</what>\n",
+ VG_(get_error_string)(err),
+ extra->Err.MemParam.isAddrErr
+ ? "unaddressable" : "uninitialised" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo(VG_(get_error_address)(err),
+ &extra->Err.MemParam.ai, False);
+ if (extra->Err.MemParam.origin_ec
+ && !extra->Err.MemParam.isAddrErr)
+ mc_pp_origin( extra->Err.MemParam.origin_ec,
+ extra->Err.MemParam.otag & 3 );
+ } else {
+ emit( "Syscall param %s points to %s byte(s)\n",
+ VG_(get_error_string)(err),
+ extra->Err.MemParam.isAddrErr
+ ? "unaddressable" : "uninitialised" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo(VG_(get_error_address)(err),
+ &extra->Err.MemParam.ai, False);
+ if (extra->Err.MemParam.origin_ec
+ && !extra->Err.MemParam.isAddrErr)
+ mc_pp_origin( extra->Err.MemParam.origin_ec,
+ extra->Err.MemParam.otag & 3 );
+ }
break;
case Err_User:
if (!extra->Err.User.isAddrErr)
MC_(any_value_errors) = True;
- mc_pp_msg("ClientCheck", err,
- "%s byte(s) found during client check request",
- ( extra->Err.User.isAddrErr
- ? "Unaddressable" : "Uninitialised" ));
- mc_pp_AddrInfo(VG_(get_error_address)(err), &extra->Err.User.ai,
- False);
- if (extra->Err.User.origin_ec && !extra->Err.User.isAddrErr)
- mc_pp_origin( extra->Err.User.origin_ec,
- extra->Err.User.otag & 3 );
+ if (xml) {
+ emit( " <kind>ClientCheck</kind>\n" );
+ emit( " <what>%s byte(s) found "
+ "during client check request</what>\n",
+ extra->Err.User.isAddrErr
+ ? "Unaddressable" : "Uninitialised" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo(VG_(get_error_address)(err), &extra->Err.User.ai,
+ False);
+ if (extra->Err.User.origin_ec && !extra->Err.User.isAddrErr)
+ mc_pp_origin( extra->Err.User.origin_ec,
+ extra->Err.User.otag & 3 );
+ } else {
+ emit( "%s byte(s) found during client check request\n",
+ extra->Err.User.isAddrErr
+ ? "Unaddressable" : "Uninitialised" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo(VG_(get_error_address)(err), &extra->Err.User.ai,
+ False);
+ if (extra->Err.User.origin_ec && !extra->Err.User.isAddrErr)
+ mc_pp_origin( extra->Err.User.origin_ec,
+ extra->Err.User.otag & 3 );
+ }
break;
case Err_Free:
- mc_pp_msg("InvalidFree", err,
- "Invalid free() / delete / delete[]");
- mc_pp_AddrInfo(VG_(get_error_address)(err),
- &extra->Err.Free.ai, False);
+ if (xml) {
+ emit( " <kind>InvalidFree</kind>\n" );
+ emit( " <what>Invalid free() / delete / delete[]</what>\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err),
+ &extra->Err.Free.ai, False );
+ } else {
+ emit( "Invalid free() / delete / delete[]\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err),
+ &extra->Err.Free.ai, False );
+ }
break;
case Err_FreeMismatch:
- mc_pp_msg("MismatchedFree", err,
- "Mismatched free() / delete / delete []");
- mc_pp_AddrInfo(VG_(get_error_address)(err),
- &extra->Err.FreeMismatch.ai, False);
+ if (xml) {
+ emit( " <kind>MismatchedFree</kind>\n" );
+ emit( " <what>Mismatched free() / delete / delete []</what>\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo(VG_(get_error_address)(err),
+ &extra->Err.FreeMismatch.ai, False);
+ } else {
+ emit( "Mismatched free() / delete / delete []\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo(VG_(get_error_address)(err),
+ &extra->Err.FreeMismatch.ai, False);
+ }
break;
case Err_Addr:
- if (extra->Err.Addr.isWrite) {
- mc_pp_msg("InvalidWrite", err,
- "Invalid write of size %d",
- extra->Err.Addr.szB);
+ if (xml) {
+ emit( " <kind>Invalid%s</kind>\n",
+ extra->Err.Addr.isWrite ? "Write" : "Read" );
+ emit( " <what>Invalid %s of size %ld</what>\n",
+ extra->Err.Addr.isWrite ? "write" : "read",
+ extra->Err.Addr.szB );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err),
+ &extra->Err.Addr.ai,
+ extra->Err.Addr.maybe_gcc );
} else {
- mc_pp_msg("InvalidRead", err,
- "Invalid read of size %d",
- extra->Err.Addr.szB);
+ emit( "Invalid %s of size %ld\n",
+ extra->Err.Addr.isWrite ? "write" : "read",
+ extra->Err.Addr.szB );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+
+ mc_pp_AddrInfo( VG_(get_error_address)(err),
+ &extra->Err.Addr.ai,
+ extra->Err.Addr.maybe_gcc );
}
- mc_pp_AddrInfo(VG_(get_error_address)(err), &extra->Err.Addr.ai,
- extra->Err.Addr.maybe_gcc);
break;
case Err_Jump:
- mc_pp_msg("InvalidJump", err,
- "Jump to the invalid address stated on the next line");
- mc_pp_AddrInfo(VG_(get_error_address)(err), &extra->Err.Jump.ai,
- False);
+ if (xml) {
+ emit( " <kind>InvalidJump</kind>\n" );
+ emit( " <what>Jump to the invalid address stated "
+ "on the next line</what>\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err), &extra->Err.Jump.ai,
+ False );
+ } else {
+ emit( "Jump to the invalid address stated on the next line\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err), &extra->Err.Jump.ai,
+ False );
+ }
break;
case Err_Overlap:
- if (extra->Err.Overlap.szB == 0)
- mc_pp_msg("Overlap", err,
- "Source and destination overlap in %s(%p, %p)",
- VG_(get_error_string)(err),
- extra->Err.Overlap.dst, extra->Err.Overlap.src);
- else
- mc_pp_msg("Overlap", err,
- "Source and destination overlap in %s(%p, %p, %d)",
- VG_(get_error_string)(err),
- extra->Err.Overlap.dst, extra->Err.Overlap.src,
- extra->Err.Overlap.szB);
+ if (xml) {
+ emit( " <kind>Overlap</kind>\n" );
+ if (extra->Err.Overlap.szB == 0) {
+ emit( " <what>Source and destination overlap "
+ "in %s(%#lx, %#lx)\n</what>\n",
+ VG_(get_error_string)(err),
+ extra->Err.Overlap.dst, extra->Err.Overlap.src );
+ } else {
+ emit( " <what>Source and destination overlap "
+ "in %s(%#lx, %#lx, %d)</what>\n",
+ VG_(get_error_string)(err),
+ extra->Err.Overlap.dst, extra->Err.Overlap.src,
+ extra->Err.Overlap.szB );
+ }
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ } else {
+ if (extra->Err.Overlap.szB == 0) {
+ emit( "Source and destination overlap in %s(%#lx, %#lx)\n",
+ VG_(get_error_string)(err),
+ extra->Err.Overlap.dst, extra->Err.Overlap.src );
+ } else {
+ emit( "Source and destination overlap in %s(%#lx, %#lx, %d)\n",
+ VG_(get_error_string)(err),
+ extra->Err.Overlap.dst, extra->Err.Overlap.src,
+ extra->Err.Overlap.szB );
+ }
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ }
break;
case Err_IllegalMempool:
- mc_pp_msg("InvalidMemPool", err,
- "Illegal memory pool address");
- mc_pp_AddrInfo(VG_(get_error_address)(err),
- &extra->Err.IllegalMempool.ai, False);
+ // JRS 17 May 09: None of our regtests exercise this; hence AFAIK
+ // the following code is untested. Bad.
+ if (xml) {
+ emit( " <kind>InvalidMemPool</kind>\n" );
+ emit( " <what>Illegal memory pool address</what>\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err),
+ &extra->Err.IllegalMempool.ai, False );
+ } else {
+ emit( "Illegal memory pool address\n" );
+ VG_(pp_ExeContext)( VG_(get_error_where)(err) );
+ mc_pp_AddrInfo( VG_(get_error_address)(err),
+ &extra->Err.IllegalMempool.ai, False );
+ }
break;
case Err_Leak: {
- HChar* xpre = VG_(clo_xml) ? " <what>" : "";
- HChar* xpost = VG_(clo_xml) ? "</what>" : "";
UInt n_this_record = extra->Err.Leak.n_this_record;
UInt n_total_records = extra->Err.Leak.n_total_records;
LossRecord* lr = extra->Err.Leak.lr;
-
- if (VG_(clo_xml)) {
- VG_(printf_xml_no_f_c)(" <kind>%t</kind>\n",
- xml_leak_kind(lr->key.state));
- } else {
- VG_(message)(Vg_UserMsg, "\n");
- }
-
- if (lr->indirect_szB > 0) {
- emit(
- "%s%'lu (%'lu direct, %'lu indirect) bytes in %'u blocks"
- " are %s in loss record %'u of %'u%s\n",
- xpre,
- lr->szB + lr->indirect_szB, lr->szB, lr->indirect_szB,
- lr->num_blocks,
- str_leak_lossmode(lr->key.state), n_this_record, n_total_records,
- xpost
- );
- if (VG_(clo_xml)) {
+ if (xml) {
+ emit(" <kind>%s</kind>\n", xml_leak_kind(lr->key.state));
+ if (lr->indirect_szB > 0) {
+ emit( " <xwhat>\n" );
+ emit( " <text>%'lu (%'lu direct, %'lu indirect) bytes "
+ "in %'u blocks"
+ " are %s in loss record %'u of %'u</text>\n",
+ lr->szB + lr->indirect_szB, lr->szB, lr->indirect_szB,
+ lr->num_blocks,
+ str_leak_lossmode(lr->key.state),
+ n_this_record, n_total_records );
// Nb: don't put commas in these XML numbers
- VG_(printf_xml)(" <leakedbytes>%lu</leakedbytes>\n",
- lr->szB + lr->indirect_szB);
- VG_(printf_xml)(" <leakedblocks>%u</leakedblocks>\n",
- lr->num_blocks);
+ emit( " <leakedbytes>%lu</leakedbytes>\n",
+ lr->szB + lr->indirect_szB );
+ emit( " <leakedblocks>%u</leakedblocks>\n", lr->num_blocks );
+ emit( " </xwhat>\n" );
+ } else {
+ emit( " <xwhat>\n" );
+ emit( " <text>%'lu bytes in %'u blocks"
+ " are %s in loss record %'u of %'u</text>\n",
+ lr->szB, lr->num_blocks,
+ str_leak_lossmode(lr->key.state),
+ n_this_record, n_total_records );
+ emit( " <leakedbytes>%ld</leakedbytes>\n", lr->szB);
+ emit( " <leakedblocks>%d</leakedblocks>\n", lr->num_blocks);
+ emit( " </xwhat>\n" );
}
- } else {
- emit(
- "%s%'lu bytes in %'u blocks are %s in loss record %'u of %'u%s\n",
- xpre,
- lr->szB, lr->num_blocks,
- str_leak_lossmode(lr->key.state), n_this_record, n_total_records,
- xpost
- );
- if (VG_(clo_xml)) {
- VG_(printf_xml)(" <leakedbytes>%ld</leakedbytes>\n",
- lr->szB);
- VG_(printf_xml)(" <leakedblocks>%d</leakedblocks>\n",
- lr->num_blocks);
+ VG_(pp_ExeContext)(lr->key.allocated_at);
+ } else { /* ! if (xml) */
+ emit("\n");
+ if (lr->indirect_szB > 0) {
+ emit(
+ "%'lu (%'lu direct, %'lu indirect) bytes in %'u blocks"
+ " are %s in loss record %'u of %'u\n",
+ lr->szB + lr->indirect_szB, lr->szB, lr->indirect_szB,
+ lr->num_blocks, str_leak_lossmode(lr->key.state),
+ n_this_record, n_total_records
+ );
+ } else {
+ emit(
+ "%'lu bytes in %'u blocks are %s in loss record %'u of %'u\n",
+ lr->szB, lr->num_blocks, str_leak_lossmode(lr->key.state),
+ n_this_record, n_total_records
+ );
}
- }
- VG_(pp_ExeContext)(lr->key.allocated_at);
+ VG_(pp_ExeContext)(lr->key.allocated_at);
+ } /* if (xml) */
break;
}
@@ -954,11 +1070,11 @@
tl_assert(Addr_Undescribed == ai->tag);
- /* Perhaps it's a user-def'd block? */
+ /* -- Perhaps it's a user-def'd block? -- */
if (client_block_maybe_describe( a, ai )) {
return;
}
- /* Search for a recently freed block which might bracket it. */
+ /* -- Search for a recently freed block which might bracket it. -- */
mc = MC_(get_freed_list_head)();
while (mc) {
if (addr_is_in_MC_Chunk(mc, a)) {
@@ -972,7 +1088,7 @@
}
mc = mc->next;
}
- /* Search for a currently malloc'd block which might bracket it. */
+ /* -- Search for a currently malloc'd block which might bracket it. -- */
VG_(HT_ResetIter)(MC_(malloc_list));
while ( (mc = VG_(HT_Next)(MC_(malloc_list))) ) {
if (addr_is_in_MC_Chunk(mc, a)) {
@@ -985,27 +1101,41 @@
return;
}
}
- /* Perhaps the variable type/location data describes it? */
- tl_assert(sizeof(ai->Addr.Variable.descr1)
- == sizeof(ai->Addr.Variable.descr2));
- VG_(memset)( &ai->Addr.Variable.descr1,
- 0, sizeof(ai->Addr.Variable.descr1));
- VG_(memset)( &ai->Addr.Variable.descr2,
- 0, sizeof(ai->Addr.Variable.descr2));
- if (VG_(get_data_description)(
- &ai->Addr.Variable.descr1[0],
- &ai->Addr.Variable.descr2[0],
- sizeof(ai->Addr.Variable.descr1)-1,
- a )) {
+ /* -- Perhaps the variable type/location data describes it? -- */
+ ai->Addr.Variable.descr1
+ = VG_(newXA)( VG_(malloc), "mc.da.descr1",
+ VG_(free), sizeof(HChar) );
+ ai->Addr.Variable.descr2
+ = VG_(newXA)( VG_(malloc), "mc.da.descr2",
+ VG_(free), sizeof(HChar) );
+
+ (void) VG_(get_data_description)( ai->Addr.Variable.descr1,
+ ai->Addr.Variable.descr2, a );
+ /* If there's nothing in descr1/2, free them. Why is it safe to to
+ VG_(indexXA) at zero here? Because VG_(get_data_description)
+ guarantees to zero terminate descr1/2 regardless of the outcome
+ of the call. So there's always at least one element in each XA
+ after the call.
+ */
+ if (0 == VG_(strlen)( VG_(indexXA)( ai->Addr.Variable.descr1, 0 ))) {
+ VG_(deleteXA)( ai->Addr.Variable.descr1 );
+ ai->Addr.Variable.descr1 = NULL;
+ }
+ if (0 == VG_(strlen)( VG_(indexXA)( ai->Addr.Variable.descr2, 0 ))) {
+ VG_(deleteXA)( ai->Addr.Variable.descr2 );
+ ai->Addr.Variable.descr2 = NULL;
+ }
+ /* Assume (assert) that VG_(get_data_description) fills in descr1
+ before it fills in descr2 */
+ if (ai->Addr.Variable.descr1 == NULL)
+ tl_assert(ai->Addr.Variable.descr2 == NULL);
+ /* So did we get lucky? */
+ if (ai->Addr.Variable.descr1 != NULL) {
ai->tag = Addr_Variable;
- tl_assert( ai->Addr.Variable.descr1
- [ sizeof(ai->Addr.Variable.descr1)-1 ] == 0);
- tl_assert( ai->Addr.Variable.descr2
- [ sizeof(ai->Addr.Variable.descr2)-1 ] == 0);
return;
}
- /* Have a look at the low level data symbols - perhaps it's in
- there. */
+ /* -- Have a look at the low level data symbols - perhaps it's in
+ there. -- */
VG_(memset)( &ai->Addr.DataSym.name,
0, sizeof(ai->Addr.DataSym.name));
if (VG_(get_datasym_and_offset)(
@@ -1017,7 +1147,7 @@
[ sizeof(ai->Addr.DataSym.name)-1 ] == 0);
return;
}
- /* Perhaps it's on a thread's stack? */
+ /* -- Perhaps it's on a thread's stack? -- */
VG_(thread_stack_reset_iter)(&tid);
while ( VG_(thread_stack_next)(&tid, &stack_min, &stack_max) ) {
if (stack_min - VG_STACK_REDZONE_SZB <= a && a <= stack_max) {
@@ -1026,7 +1156,7 @@
return;
}
}
- /* last ditch attempt at classification */
+ /* -- last ditch attempt at classification -- */
tl_assert( sizeof(ai->Addr.SectKind.objname) > 4 );
VG_(memset)( &ai->Addr.SectKind.objname,
0, sizeof(ai->Addr.SectKind.objname));
@@ -1040,7 +1170,7 @@
[ sizeof(ai->Addr.SectKind.objname)-1 ] == 0);
return;
}
- /* Clueless ... */
+ /* -- Clueless ... -- */
ai->tag = Addr_Unknown;
return;
}
|
|
From: <sv...@va...> - 2009-05-17 13:59:22
|
Author: sewardj
Date: 2009-05-17 14:59:14 +0100 (Sun, 17 May 2009)
New Revision: 9856
Log:
Update specification for Memcheck output, to be in line with
overall XML format overhaul committed in r9849.
Modified:
branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt
Modified: branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt
===================================================================
--- branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt 2009-05-16 10:49:03 UTC (rev 9855)
+++ branches/MESSAGING_TIDYUP/docs/internals/xml-output-protocol4.txt 2009-05-17 13:59:14 UTC (rev 9856)
@@ -407,50 +407,44 @@
====================================================================
-ERROR definition for Memcheck
------------------------------
+TOOLSPECIFIC definition for Memcheck
+------------------------------------
-The definition is:
+For Memcheck, a TOOLSPECIFIC is simply an ERROR:
- <error>
- <unique>HEX64</unique>
- <tid>INT</tid>
- <kind>KIND</kind>
- <what>TEXT</what> (either 1 or 2 times)
+TOOLSPECIFIC = ERROR
- optionally: <leakedbytes>INT</leakedbytes>
- optionally: <leakedblocks>INT</leakedblocks>
- STACK
+ERROR details for Memcheck
+--------------------------
- zero, one or two: <auxwhat>TEXT</auxwhat>
- optionally: STACK
- optionally: ORIGIN
+The "... tool-specific fields ..." for Memcheck consist of zero or
+more of "(either AUXWHAT or XAUXWHAT or STACK)". They should be shown
+to the user in the order they appear.
- optionally: SUPPRESSION
- </error>
+XWHATs (for definition, see above) may contain the following extra
+components (along with the mandatory <text>...</text> component):
-The first four fields and the last field are specified in "ERROR
-definition -- common fields" above. The remaining fields are as
-follows:
+* <leakedbytes>INT</leakedbytes>
-* For <kind> tags specifying a KIND of the form "Leak_*", the
- optional <leakedbytes> and <leakedblocks> indicate the number of
- bytes and blocks leaked by this error.
+* <leakedblocks>INT</leakedblocks>
-* The primary STACK for this error, indicating where it occurred.
+These fields are used in errors that have a <kind> tag specifying a
+KIND of the form "Leak_*", to indicate the number of leaked bytes and
+blocks.
-* Some error types may have auxiliary information attached:
- <auxwhat>TEXT</auxwhat> (zero, one or two) gives an auxiliary
- human-readable description (usually of invalid addresses)
+XAUXWHATs (for definition, see above) may contain the following extra
+components (along with the mandatory <text>...</text> component):
- STACK gives an auxiliary stack (usually the allocation/free point
- of a block). If this STACK is present then the
- <auxwhat>TEXT</auxwhat> blocks will precede it.
+* <file>TEXT</file>, as defined in FRAME
+* <line>INT</line>, as defined in FRAME
+* <dir>TEXT</dir>, as defined in FRAME
+
+
KIND for Memcheck
-----------------
@@ -522,19 +516,6 @@
memory leak; pointers to un-freed blocks are still available
-ORIGIN
-------
-ORIGIN shows the origin of uninitialised data in errors that involve
-uninitialised data. STACK shows the origin of the uninitialised
-value. TEXT gives a human-understandable hint as to the meaning of
-the information in STACK.
-
- <origin>
- <what>TEXT<what>
- STACK
- </origin>
-
-
====================================================================
TOOLSPECIFIC definition for Ptrcheck
@@ -542,7 +523,7 @@
For Ptrcheck, a TOOLSPECIFIC is simply an ERROR:
-TOOLSPECIIFIC = ERROR
+TOOLSPECIFIC = ERROR
ERROR details for Ptrcheck
@@ -554,15 +535,12 @@
Ptrcheck does not produce any XWHAT records, despite the fact that
-"ERROR definition -- common structure" says it might do.
+"ERROR definition -- common structure" says that tools may do so.
XAUXWHATs (for definition, see above) may contain the following extra
components (along with the mandatory <text>...</text> component):
-* <hthreadid>INT</hthreadid>, same meaning as when referred to in
- XWHAT
-
* <file>TEXT</file>, as defined in FRAME
* <line>INT</line>, as defined in FRAME
|
|
From: Tom H. <th...@cy...> - 2009-05-17 02:44:28
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-05-17 03:05:06 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 481 tests, 0 stderr failures, 0 stdout failures, 0 post failures == ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 480 tests, 0 stderr failures, 0 stdout failures, 0 post failures == ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sun May 17 03:24:33 2009 --- new.short Sun May 17 03:44:20 2009 *************** *** 8,10 **** ! == 480 tests, 0 stderr failures, 0 stdout failures, 0 post failures == --- 8,10 ---- ! == 481 tests, 0 stderr failures, 0 stdout failures, 0 post failures == |
|
From: Tom H. <th...@cy...> - 2009-05-17 02:27:46
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-05-17 03:10:05 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 487 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 486 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sun May 17 03:18:48 2009 --- new.short Sun May 17 03:27:37 2009 *************** *** 8,10 **** ! == 486 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) --- 8,10 ---- ! == 487 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) |