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
(12) |
2
(11) |
3
(8) |
|
4
(9) |
5
(10) |
6
(18) |
7
(8) |
8
(12) |
9
(23) |
10
(14) |
|
11
(15) |
12
(31) |
13
(45) |
14
(28) |
15
(20) |
16
(16) |
17
(9) |
|
18
(18) |
19
(26) |
20
(49) |
21
(14) |
22
(18) |
23
(24) |
24
(28) |
|
25
(39) |
26
(17) |
27
(27) |
28
(27) |
29
(14) |
30
(44) |
|
|
From: <sv...@va...> - 2005-09-27 16:54:05
|
Author: njn
Date: 2005-09-27 17:54:02 +0100 (Tue, 27 Sep 2005)
New Revision: 203
Log:
Change "SVN Repos" to "Code Repository"; one guy didn't find it because
he was looking for CVS, hopefully this makes that less likely.
Modified:
trunk/php/menu.php
Modified: trunk/php/menu.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/php/menu.php 2005-09-27 15:21:09 UTC (rev 202)
+++ trunk/php/menu.php 2005-09-27 16:54:02 UTC (rev 203)
@@ -34,7 +34,7 @@
=20
$devel =3D array(
array( 'url'=3D>'platforms.html', 'tag'=3D>'Supported Platforms' ),
- array( 'url'=3D>'cvs_svn.html', 'tag'=3D>'SVN Repos' ),
+ array( 'url'=3D>'cvs_svn.html', 'tag'=3D>'Code Repository' ),
array( 'url'=3D>'guis.html', 'tag'=3D>'Front Ends / GUIs' ),
array( 'url'=3D>'projects.html', 'tag'=3D>'Project Suggestions' )
/*array( 'url'=3D>'consultants.html', 'tag'=3D>'Commercial Support' )=
*/
|
|
From: <sv...@va...> - 2005-09-27 15:21:22
|
Author: njn Date: 2005-09-27 16:21:09 +0100 (Tue, 27 Sep 2005) New Revision: 202 Log: minor tweaks Modified: trunk/docs/download_docs.html trunk/index.html Modified: trunk/docs/download_docs.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/download_docs.html 2005-09-22 20:37:43 UTC (rev 201) +++ trunk/docs/download_docs.html 2005-09-27 15:21:09 UTC (rev 202) @@ -43,7 +43,7 @@ <td><b>Entire Manual:</b></td> <td> </td> <td><a href=3D"/docs/manual/valgrind_manual.html.tar.bz2">html.tar.bz2<= /a></td> - <td><a href=3D"/docs/manual/valgrind_manual.pdf.bz2">pdf.tar.bz2</a></t= d> + <td><a href=3D"/docs/manual/valgrind_manual.pdf.bz2">pdf.bz2</a></td> <td><a href=3D"/docs/manual/valgrind_manual.ps.bz2">ps.bz2</a></td> </tr> </table> Modified: trunk/index.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/index.html 2005-09-22 20:37:43 UTC (rev 201) +++ trunk/index.html 2005-09-27 15:21:09 UTC (rev 202) @@ -11,7 +11,7 @@ =20 <p> </p> =20 -<p>Valgrind is an <a href=3D"http://opensource.org/OSA/">award-winning</= a>=20 +<p>Valgrind is an <a href=3D"http://www.valgrind.org/gallery/awards.html= ">award-winning</a>=20 suite of tools for debugging and profiling Linux programs. With the tools that come with Valgrind, you can automatically detect many memory management and threading bugs, |
|
From: <sv...@va...> - 2005-09-27 10:44:44
|
Author: sewardj
Date: 2005-09-27 11:44:39 +0100 (Tue, 27 Sep 2005)
New Revision: 4787
Log:
Minor adjustments, mostly to a comment.
Modified:
branches/ASPACEM/coregrind/m_commandline.c
Modified: branches/ASPACEM/coregrind/m_commandline.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_commandline.c 2005-09-27 08:34:55 UTC (r=
ev 4786)
+++ branches/ASPACEM/coregrind/m_commandline.c 2005-09-27 10:44:39 UTC (r=
ev 4787)
@@ -95,10 +95,8 @@
}
=20
=20
-// Add args out of environment, skipping multiple spaces and "--" args.
-// We split 's' into multiple strings by replacing whitespace with nuls,
-// eg. "--aa --bb --cc" --> "--aa\0--bb\0--cc". And for each new string
-// carved out of 's', we put a pointer to it in 'to'.
+// Add args from a string into VG_(args_for_valgrind), splitting the
+// string at whitespace and adding each component as a separate arg.
=20
static void add_args_from_string ( HChar* s )
{
@@ -210,7 +208,7 @@
// VG_(malloc)(). We do not free f1_clo and f2_clo as they get
// put into VG_(args_for_valgrind) and so must persist.
HChar* f1_clo =3D read_dot_valgrindrc( VG_(getenv)("HOME") );
- HChar* env_clo =3D VG_(getenv)(VALGRIND_OPTS);
+ HChar* env_clo =3D VG_(strdup)( VG_(getenv)(VALGRIND_OPTS) );
HChar* f2_clo =3D read_dot_valgrindrc(".");
=20
if (f1_clo) add_args_from_string( f1_clo );
|
|
From: <sv...@va...> - 2005-09-27 08:34:58
|
Author: tom Date: 2005-09-27 09:34:55 +0100 (Tue, 27 Sep 2005) New Revision: 4786 Log: Define VKI_O_RDWR on amd64. Modified: branches/ASPACEM/include/vki-amd64-linux.h Modified: branches/ASPACEM/include/vki-amd64-linux.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/include/vki-amd64-linux.h 2005-09-27 01:14:36 UTC (r= ev 4785) +++ branches/ASPACEM/include/vki-amd64-linux.h 2005-09-27 08:34:55 UTC (r= ev 4786) @@ -228,6 +228,7 @@ =20 #define VKI_O_RDONLY 00 #define VKI_O_WRONLY 01 +#define VKI_O_RDWR 02 #define VKI_O_CREAT 0100 /* not fcntl */ #define VKI_O_EXCL 0200 /* not fcntl */ #define VKI_O_TRUNC 01000 /* not fcntl */ |
|
From: <js...@ac...> - 2005-09-27 02:57:41
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-09-27 03:30:00 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 186 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <to...@co...> - 2005-09-27 02:42:00
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-09-27 03:30:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 188 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-27 02:28:28
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-09-27 03:15:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 14 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-27 02:25:28
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-09-27 03:10:09 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-27 02:21:17
|
Nightly build on dellow ( x86_64, Fedora Core 4 ) started at 2005-09-27 03:10:09 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-27 02:18:40
|
Nightly build on aston ( x86_64, Fedora Core 3 ) started at 2005-09-27 03:05:13 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-27 02:13:53
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-09-27 03:00:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) |
|
From: <sv...@va...> - 2005-09-27 01:14:49
|
Author: sewardj
Date: 2005-09-27 02:14:36 +0100 (Tue, 27 Sep 2005)
New Revision: 4785
Log:
Finish off command-line handling: reenable acquisition of args from
~/.valgrindrc, $VALGRIND_OPTS and ./.valgrindrc.
Modified:
branches/ASPACEM/coregrind/m_commandline.c
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
branches/ASPACEM/include/pub_tool_clientstate.h
Modified: branches/ASPACEM/coregrind/m_commandline.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_commandline.c 2005-09-26 14:50:39 UTC (r=
ev 4784)
+++ branches/ASPACEM/coregrind/m_commandline.c 2005-09-27 01:14:36 UTC (r=
ev 4785)
@@ -28,20 +28,19 @@
The GNU General Public License is contained in the file COPYING.
*/
=20
-// TODO: prune these
#include "pub_core_basics.h"
-#include "pub_core_commandline.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
#include "pub_core_mallocfree.h"
-#include "pub_core_options.h"
#include "pub_core_clientstate.h"
+#include "pub_core_commandline.h"
=20
=20
/* Add a string to an expandable array of strings. */
+
static void add_string ( XArrayStrings* xa, HChar* str )
{
Int i;
@@ -65,33 +64,108 @@
}
=20
=20
+/* Read the contents of .valgrindrc in 'dir' into malloc'd memory. */
+// Note that we deliberately don't free the malloc'd memory. See
+// comment at call site.
+
+static HChar* read_dot_valgrindrc ( HChar* dir )
+{
+ Int n;
+ SysRes fd;
+ Int size;
+ HChar* f_clo =3D NULL;
+ HChar filename[VKI_PATH_MAX];
+
+ VG_(snprintf)(filename, VKI_PATH_MAX, "%s/.valgrindrc",=20
+ ( NULL =3D=3D dir ? "" : dir ) );
+ fd =3D VG_(open)(filename, 0, VKI_S_IRUSR);
+ if ( !fd.isError ) {
+ size =3D VG_(fsize)(fd.val);
+ if (size > 0) {
+ f_clo =3D VG_(malloc)(size+1);
+ vg_assert(f_clo);
+ n =3D VG_(read)(fd.val, f_clo, size);
+ if (n =3D=3D -1) n =3D 0;
+ vg_assert(n >=3D 0 && n <=3D size+1);
+ f_clo[n] =3D '\0';
+ }
+ VG_(close)(fd.val);
+ }
+ return f_clo;
+}
+
+
+// Add args out of environment, skipping multiple spaces and "--" args.
+// We split 's' into multiple strings by replacing whitespace with nuls,
+// eg. "--aa --bb --cc" --> "--aa\0--bb\0--cc". And for each new string
+// carved out of 's', we put a pointer to it in 'to'.
+
+static void add_args_from_string ( HChar* s )
+{
+ HChar* tmp;
+ HChar* cp =3D s;
+ vg_assert(cp);
+ while (True) {
+ // We have alternating sequences: blanks, non-blanks, blanks...
+ // copy the non-blanks sequences, and add terminating '\0'
+ while (VG_(isspace)(*cp)) cp++;
+ if (*cp =3D=3D 0) break;
+ tmp =3D cp;
+ while ( !VG_(isspace)(*cp) && *cp !=3D 0 ) cp++;
+ if ( *cp !=3D 0 ) *cp++ =3D '\0'; // terminate if not the la=
st
+ add_string( &VG_(args_for_valgrind), tmp );
+ }
+}
+
+
/* Split up the args presented by the launcher to m_main.main(), and
- park them in VG_(args_for_client), VG_(args_for_valgrind),
- VG_(args_for_valgrind_extras) and VG_(args_the_exename). The
- latter are acquired from $VALGRIND_OPTS, ./.valgrindrc and
- ~/.valgrindrc.=20
-*/
-/* Scheme: args look like this:
+ park them in VG_(args_for_client) and VG_(args_for_valgrind).
=20
+ The resulting arg list is the concatenation of the following:
+ - contents of ~/.valgrindrc
+ - contents of $VALGRIND_OPTS
+ - contents of ./.valgrindrc
+ - args from the command line
+ in the stated order.
+
+ VG_(args_for_valgrind_noexecpass) is set to be the number of items
+ in the first three categories. They are not passed to child invokati=
ons
+ at exec, whereas the last group is.
+
+ If the last group contains --command-line-only=3Dyes, then the=20
+ first three groups are left empty.
+
+ Scheme: first examine the last group (the supplied argc/argv).
+ It should look like this.
+
args-for-v exe_name args-for-c
=20
args-for-v are taken until either they don't start with '-' or
a "--" is seen.
=20
- If args-for-v includes --command-line-only=3Dyes, then the extra
- sources (env vars, files) are not consulted.
-
+ The exe name and args-for-c are recorded without further ado.
Note that args-for-c[0] is the first real arg for the client, not
its executable name.
-*/
=20
+ args-for-v are then copied into tmp_xarray.
=20
+ if args-for-v does not include --command-line-only=3Dyes:
+ contents of ~/.valgrindrc, $VALGRIND_OPTS and ./.valgrindrc
+ are copied into VG_(args_for_valgrind).
+ else
+ VG_(args_for_valgrind) is made empty.
+
+ Finally, tmp_xarray is copied onto the end of VG_(args_for_valgrind).
+*/
+
void VG_(split_up_argv)( Int argc, HChar** argv )
{
Int i;
Bool augment =3D True;
static Bool already_called =3D False;
=20
+ XArrayStrings tmp_xarray =3D {0,0,NULL};
+
/* This function should be called once, at startup, and then never
again. */
vg_assert(!already_called);
@@ -109,161 +183,52 @@
augment =3D False;
if (argv[i][0] !=3D '-')
break;
- add_string( &VG_(args_for_valgrind), argv[i] );
+ add_string( &tmp_xarray, argv[i] );
}
=20
/* Should now be looking at the exe name. */
if (i < argc) {
- vg_assert(argv[i]);
+ vg_assert(argv[i]);
VG_(args_the_exename) =3D argv[i];
i++;
}
=20
/* The rest are args for the client. */
for (; i < argc; i++) {
- vg_assert(argv[i]);
- add_string( &VG_(args_for_client), argv[i] );
+ vg_assert(argv[i]);
+ add_string( &VG_(args_for_client), argv[i] );
}
=20
+ VG_(args_for_valgrind).size =3D 0;
+ VG_(args_for_valgrind).used =3D 0;
+ VG_(args_for_valgrind).strs =3D NULL;
=20
-}
+ /* Get extra args from ~/.valgrindrc, $VALGRIND_OPTS and
+ ./.valgrindrc into VG_(args_for_valgrind). */
+ if (augment) {
+ // read_dot_valgrindrc() allocates the return value with
+ // VG_(malloc)(). We do not free f1_clo and f2_clo as they get
+ // put into VG_(args_for_valgrind) and so must persist.
+ HChar* f1_clo =3D read_dot_valgrindrc( VG_(getenv)("HOME") );
+ HChar* env_clo =3D VG_(getenv)(VALGRIND_OPTS);
+ HChar* f2_clo =3D read_dot_valgrindrc(".");
=20
-
-// Note that we deliberately don't free the malloc'd memory. See commen=
t
-// at call site.
-static char* get_file_clo(char* dir)
-{
- Int n;
- SysRes fd;
- Int size;
- Char* f_clo =3D NULL;
- Char filename[VKI_PATH_MAX];
-
- VG_(snprintf)(filename, VKI_PATH_MAX, "%s/.valgrindrc",=20
- ( NULL =3D=3D dir ? "" : dir ) );
- fd =3D VG_(open)(filename, 0, VKI_S_IRUSR);
- if ( !fd.isError ) {
- if ( 0 =3D=3D (size =3D VG_(fsize)(fd.val)) ) {
- f_clo =3D VG_(malloc)(size+1);
- vg_assert(f_clo);
- n =3D VG_(read)(fd.val, f_clo, size);
- if (n =3D=3D -1) n =3D 0;
- f_clo[n] =3D '\0';
- }
- VG_(close)(fd.val);
+ if (f1_clo) add_args_from_string( f1_clo );
+ if (env_clo) add_args_from_string( env_clo );
+ if (f2_clo) add_args_from_string( f2_clo );
}
- return f_clo;
-}
=20
-static Int count_args(char* s)
-{
- Int n =3D 0;
- if (s) {
- char* cp =3D s;
- while (True) {
- // We have alternating sequences: blanks, non-blanks, blanks...
- // count the non-blanks sequences.
- while ( VG_(isspace)(*cp) ) cp++;
- if ( !*cp ) break;
- n++;
- while ( !VG_(isspace)(*cp) && *cp ) cp++;
- }
- }
- return n;
-}
+ /* .. and record how many extras we got. */
+ VG_(args_for_valgrind_noexecpass) =3D VG_(args_for_valgrind).used;
=20
-// Add args out of environment, skipping multiple spaces and "--" args.
-// We split 's' into multiple strings by replacing whitespace with nuls,
-// eg. "--aa --bb --cc" --> "--aa\0--bb\0--cc". And for each new string
-// carved out of 's', we put a pointer to it in 'to'.
-static char** copy_args( char* s, char** to )
-{
- if (s) {
- char* cp =3D s;
- while (True) {
- // We have alternating sequences: blanks, non-blanks, blanks...
- // copy the non-blanks sequences, and add terminating '\0'
- while ( VG_(isspace)(*cp) ) cp++;
- if ( !*cp ) break;
- *to++ =3D cp;
- while ( !VG_(isspace)(*cp) && *cp ) cp++;
- if ( *cp ) *cp++ =3D '\0'; // terminate if not the l=
ast
- if (VG_STREQ(to[-1], "--")) to--; // undo any '--' arg
- }
- }
- return to;
-}
+ /* Finally, copy tmp_xarray onto the end. */
+ for (i =3D 0; i < tmp_xarray.used; i++)
+ add_string( &VG_(args_for_valgrind), tmp_xarray.strs[i] );
=20
-// Augment command line with arguments from environment and .valgrindrc
-// files.
-static void augment_command_line(Int* vg_argc_inout, char*** vg_argv_ino=
ut)
-{
-#if 0
- int vg_argc0 =3D *vg_argc_inout;
- char** vg_argv0 =3D *vg_argv_inout;
-
- // get_file_clo() allocates the return value with malloc(). We do no=
t
- // free f1_clo and f2_clo as they get put into vg_argv[] which must p=
ersist.
- char* env_clo =3D VG_(getenv)(VALGRINDOPTS);
- char* f1_clo =3D get_file_clo( VG_(getenv)("HOME") );
- char* f2_clo =3D get_file_clo(".");
-
- /* copy any extra args from file or environment, if present */
- if ( (env_clo && *env_clo) || (f1_clo && *f1_clo) || (f2_clo && *f2_c=
lo) ) {
- /* ' ' separated extra options */
- char **from;
- char **to;
- int orig_arg_count, env_arg_count, f1_arg_count, f2_arg_count;
-
- for ( orig_arg_count =3D 0; vg_argv0[orig_arg_count]; orig_arg_cou=
nt++ );
-
- env_arg_count =3D count_args(env_clo);
- f1_arg_count =3D count_args(f1_clo);
- f2_arg_count =3D count_args(f2_clo);
-
- if (0)
- VG_(printf)("extra-argc=3D%d %d %d\n",
- env_arg_count, f1_arg_count, f2_arg_count);
-
- /* +2: +1 for null-termination, +1 for added '--' */
- from =3D vg_argv0;
- vg_argv0 =3D VG_(malloc)( (orig_arg_count + env_arg_count + f1_arg=
_count=20
- + f2_arg_count + 2) * sizeof(char **));
- vg_assert(vg_argv0);
- to =3D vg_argv0;
-
- /* copy argv[0] */
- *to++ =3D *from++;
-
- /* Copy extra args from env var and file, in the order: ~/.valgrin=
drc,
- * $VALGRIND_OPTS, ./.valgrindrc -- more local options are put lat=
er
- * to override less local ones. */
- to =3D copy_args(f1_clo, to);
- to =3D copy_args(env_clo, to);
- to =3D copy_args(f2_clo, to);
- =20
- /* copy original arguments, stopping at command or -- */
- while (*from) {
- if (**from !=3D '-')
- break;
- if (VG_STREQ(*from, "--")) {
- from++; /* skip -- */
- break;
- }
- *to++ =3D *from++;
- }
-
- /* add -- */
- *to++ =3D "--";
-
- vg_argc0 =3D to - vg_argv0;
-
- /* copy rest of original command line, then NULL */
- while (*from) *to++ =3D *from++;
- *to =3D NULL;
- }
-
- *vg_argc_inout =3D vg_argc0;
- *vg_argv_inout =3D vg_argv0;
-#endif
+ if (tmp_xarray.strs)
+ VG_(free)(tmp_xarray.strs);
}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-26 14:=
50:39 UTC (rev 4784)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-27 01:=
14:36 UTC (rev 4785)
@@ -2579,9 +2579,9 @@
j =3D 0;
argv[j++] =3D launcher_basename;
for (i =3D 0; i < VG_(args_for_valgrind).used; i++) {
- if (i < VG_(args_for_valgrind_noexecpass))
- continue;
- argv[j++] =3D VG_(args_for_valgrind).strs[i];
+ if (i < VG_(args_for_valgrind_noexecpass))
+ continue;
+ argv[j++] =3D VG_(args_for_valgrind).strs[i];
}
argv[j++] =3D (Char*)ARG1;
if (arg2copy && arg2copy[0])
Modified: branches/ASPACEM/include/pub_tool_clientstate.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/pub_tool_clientstate.h 2005-09-26 14:50:39 U=
TC (rev 4784)
+++ branches/ASPACEM/include/pub_tool_clientstate.h 2005-09-27 01:14:36 U=
TC (rev 4785)
@@ -52,10 +52,13 @@
- contents of $VALGRIND_OPTS
- contents of ./.valgrindrc
- args from the command line
+ in the stated order.
+
Only the last of these is passed onwards to child Valgrinds at
- client sys_execve, since the children will re-acquire the first=20
- 3 categories for themselves. Therefore we also record the=20
- number of these no-pass-at-execve arguments. */
+ client sys_execve, since the children will re-acquire the first 3
+ categories for themselves. Therefore we also record the number of
+ these no-pass-at-execve arguments -- that is what
+ VG_(args_for_valgrind_noexecpass) is. */
extern XArrayStrings VG_(args_for_valgrind);
=20
/* Number of leading args in VG_(args_for_valgrind) not to pass on at
|
|
From: <sv...@va...> - 2005-09-26 14:50:48
|
Author: njn Date: 2005-09-26 15:50:39 +0100 (Mon, 26 Sep 2005) New Revision: 4784 Log: add note Modified: trunk/docs/internals/roadmap.txt Modified: trunk/docs/internals/roadmap.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/internals/roadmap.txt 2005-09-26 13:42:16 UTC (rev 4783) +++ trunk/docs/internals/roadmap.txt 2005-09-26 14:50:39 UTC (rev 4784) @@ -30,7 +30,8 @@ lot since. Get Cachegrind working with it (Nick). =20 * Rewrite address space manager; statically link the core with - each tool; remove all glibc dependencies (Julian). + each tool; remove all glibc dependencies (Julian). [What about + --time-stamp=3Dyes?] =20 * Make it work with GCC 2.95 (bug #111781) -- don't put declarations aft= er statements in blocks. Do it after merging ASPACEM with the trunk. |
|
From: <sv...@va...> - 2005-09-26 13:42:33
|
Author: sewardj
Date: 2005-09-26 14:42:16 +0100 (Mon, 26 Sep 2005)
New Revision: 4783
Log:
Add a simulation for /proc/self/cmdline using the scheme suggested by
Tom Hughes. As a side effect, we now have VG_(mkstemp), and
VG_(random) is generalised to allow multiple simultaneous generators.
OOo finally runs successfully on this branch now.
Modified:
branches/ASPACEM/coregrind/m_clientstate.c
branches/ASPACEM/coregrind/m_debugger.c
branches/ASPACEM/coregrind/m_libcbase.c
branches/ASPACEM/coregrind/m_libcfile.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/coregrind/m_skiplist.c
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
branches/ASPACEM/coregrind/m_syswrap/syswrap-main.c
branches/ASPACEM/coregrind/pub_core_clientstate.h
branches/ASPACEM/coregrind/pub_core_libcfile.h
branches/ASPACEM/include/pub_tool_libcbase.h
branches/ASPACEM/include/pub_tool_libcfile.h
Modified: branches/ASPACEM/coregrind/m_clientstate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_clientstate.c 2005-09-26 10:05:38 UTC (r=
ev 4782)
+++ branches/ASPACEM/coregrind/m_clientstate.c 2005-09-26 13:42:16 UTC (r=
ev 4783)
@@ -53,8 +53,10 @@
Addr VG_(brk_limit) =3D 0; /* current brk */
=20
/* A fd which refers to the client executable. */
-Int VG_(clexecfd) =3D -1;
+Int VG_(cl_exec_fd) =3D -1;
=20
+/* A fd which refers to the fake /proc/<pid>/cmdline in /tmp. */
+Int VG_(cl_cmdline_fd) =3D -1;
=20
// Command line pieces, after they have been extracted from argv in
// m_main.main(). The payload vectors are allocated in VG_AR_TOOL
Modified: branches/ASPACEM/coregrind/m_debugger.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_debugger.c 2005-09-26 10:05:38 UTC (rev =
4782)
+++ branches/ASPACEM/coregrind/m_debugger.c 2005-09-26 13:42:16 UTC (rev =
4783)
@@ -122,7 +122,7 @@
Char *cmdptr;
=20
VG_(sprintf)(pidbuf, "%d", pid);
- VG_(sprintf)(file, "/proc/%d/fd/%d", pid, VG_(clexecfd));
+ VG_(sprintf)(file, "/proc/%d/fd/%d", pid, VG_(cl_exec_fd));
=20
bufptr =3D buf;
cmdptr =3D VG_(clo_db_command);
Modified: branches/ASPACEM/coregrind/m_libcbase.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcbase.c 2005-09-26 10:05:38 UTC (rev =
4782)
+++ branches/ASPACEM/coregrind/m_libcbase.c 2005-09-26 13:42:16 UTC (rev =
4783)
@@ -497,19 +497,22 @@
#undef SORT
}
=20
+// This random number generator is based on the one suggested in Kernigh=
an
+// and Ritchie's "The C Programming Language".
+
+// A pseudo-random number generator returning a random UInt. If pSeed
+// is NULL, it uses its own seed, which starts at zero. If pSeed is
+// non-NULL, it uses and updates whatever pSeed points at.
+
static UInt seed =3D 0;
=20
-void VG_(srandom)(UInt s)
+UInt VG_(random)( /*MOD*/UInt* pSeed )
{
- seed =3D s;
-}
+ if (pSeed =3D=3D NULL)=20
+ pSeed =3D &seed;
=20
-// This random number generator is based on the one suggested in Kernigh=
an
-// and Ritchie's "The C Programming Language".
-UInt VG_(random)(void)
-{
- seed =3D (1103515245*seed + 12345);
- return seed;
+ *pSeed =3D (1103515245 * *pSeed + 12345);
+ return *pSeed;
}
=20
/*--------------------------------------------------------------------*/
Modified: branches/ASPACEM/coregrind/m_libcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcfile.c 2005-09-26 10:05:38 UTC (rev =
4782)
+++ branches/ASPACEM/coregrind/m_libcfile.c 2005-09-26 13:42:16 UTC (rev =
4783)
@@ -33,6 +33,7 @@
#include "pub_core_libcassert.h"
#include "pub_core_libcfile.h"
#include "pub_core_libcprint.h" // For VG_(sprintf)()
+#include "pub_core_libcproc.h" // VG_(getpid), VG_(getppid)
#include "pub_core_syscall.h"
#include "vki_unistd.h"
=20
@@ -140,10 +141,9 @@
return res.isError ? (-1) : buf.st_size;
}
=20
-Int VG_(dup2) ( Int oldfd, Int newfd )
+SysRes VG_(dup) ( Int oldfd )
{
- SysRes res =3D VG_(do_syscall2)(__NR_dup2, oldfd, newfd);
- return res.isError ? (-1) : res.val;
+ return VG_(do_syscall1)(__NR_dup, oldfd);
}
=20
/* Returns -1 on error. */
@@ -219,6 +219,48 @@
return res;
}
=20
+/* Create and open (-rw------) a tmp file name incorporating said arg.
+ Returns -1 on failure, else the fd of the file. If fullname is
+ non-NULL, the file's name is written into it. The number of bytes
+ written is guaranteed not to exceed 64+strlen(part_of_name). */
+
+Int VG_(mkstemp) ( HChar* part_of_name, /*OUT*/HChar* fullname )
+{
+ HChar buf[200];
+ Int n, tries, fd;
+ UInt seed;
+ SysRes sres;
+
+ vg_assert(part_of_name);
+ n =3D VG_(strlen)(part_of_name);
+ vg_assert(n > 0 && n < 100);
+
+ seed =3D (VG_(getpid)() << 9) ^ VG_(getppid)();
+
+ tries =3D 0;
+ while (True) {
+ if (tries > 10)=20
+ return -1;
+ VG_(sprintf)( buf, "/tmp/valgrind_%s_%08x",=20
+ part_of_name, VG_(random)( &seed ));
+ if (0)
+ VG_(printf)("VG_(mkstemp): trying: %s\n", buf);
+
+ sres =3D VG_(open)(buf,
+ VKI_O_CREAT|VKI_O_RDWR|VKI_O_EXCL|VKI_O_TRUNC,
+ VKI_S_IRUSR|VKI_S_IWUSR);
+ if (sres.isError)
+ continue;
+ /* VG_(safe_fd) doesn't return if it fails. */
+ fd =3D VG_(safe_fd)( sres.val );
+ if (fullname)
+ VG_(strcpy)( fullname, buf );
+ return fd;
+ }
+ /* NOTREACHED */
+}
+
+
/* ---------------------------------------------------------------------
Socket-related stuff. This is very Linux-kernel specific.
------------------------------------------------------------------ */
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-26 10:05:38 UTC (rev 4782=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-26 13:42:16 UTC (rev 4783=
)
@@ -853,7 +853,7 @@
executable. This is needed for attaching to GDB. */
res =3D VG_(open)(exec, VKI_O_RDONLY, VKI_S_IRUSR);
if (!res.isError)
- VG_(clexecfd) =3D res.val;
+ VG_(cl_exec_fd) =3D res.val;
=20
/* Copy necessary bits of 'info' that were filled in */
*client_eip =3D info->init_eip;
@@ -1681,8 +1681,8 @@
/* Update the soft limit. */
VG_(setrlimit)(VKI_RLIMIT_NOFILE, &rl);
=20
- if (VG_(clexecfd) !=3D -1)
- VG_(clexecfd) =3D VG_(safe_fd)( VG_(clexecfd) );
+ if (VG_(cl_exec_fd) !=3D -1)
+ VG_(cl_exec_fd) =3D VG_(safe_fd)( VG_(cl_exec_fd) );
}
=20
=20
@@ -2125,15 +2125,15 @@
// p: load_client() [for 'info' and hence VG_(brk_base)]
//--------------------------------------------------------------
if (!need_help) {=20
- SizeT m1 =3D 1024 * 1024;
- SizeT m8 =3D 8 * m1;
- SizeT dseg_max_size =3D (SizeT)VG_(client_rlimit_data).rlim_cur;
- VG_(debugLog)(1, "main", "Setup client data (brk) segment\n");
- if (dseg_max_size < m1) dseg_max_size =3D m1;
- if (dseg_max_size > m8) dseg_max_size =3D m8;
- dseg_max_size =3D VG_PGROUNDUP(dseg_max_size);
+ SizeT m1 =3D 1024 * 1024;
+ SizeT m8 =3D 8 * m1;
+ SizeT dseg_max_size =3D (SizeT)VG_(client_rlimit_data).rlim_cur;
+ VG_(debugLog)(1, "main", "Setup client data (brk) segment\n");
+ if (dseg_max_size < m1) dseg_max_size =3D m1;
+ if (dseg_max_size > m8) dseg_max_size =3D m8;
+ dseg_max_size =3D VG_PGROUNDUP(dseg_max_size);
=20
- setup_client_dataseg( dseg_max_size );
+ setup_client_dataseg( dseg_max_size );
}
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -2150,6 +2150,51 @@
setup_file_descriptors();
=20
//--------------------------------------------------------------
+ // create the fake /proc/<pid>/cmdline file and then unlink it,
+ // but hold onto the fd, so we can hand it out to the client
+ // when it tries to open /proc/<pid>/cmdline for itself.
+ // p: setup file descriptors
+ //--------------------------------------------------------------
+ if (!need_help) {
+ HChar buf[50], buf2[50+64];
+ HChar nul[1];
+ Int fd, r;
+ HChar* exename;
+
+ VG_(debugLog)(1, "main", "Create fake /proc/<pid>/cmdline\n");
+
+ VG_(sprintf)(buf, "proc_%d_cmdline", VG_(getpid)());
+ fd =3D VG_(mkstemp)( buf, buf2 );
+ if (fd =3D=3D -1)
+ config_error("Can't create client cmdline file in /tmp.");
+
+ nul[0] =3D 0;
+ exename =3D VG_(args_the_exename) ? VG_(args_the_exename)
+ : "unknown_exename";
+
+ VG_(write)(fd, VG_(args_the_exename),=20
+ VG_(strlen)( VG_(args_the_exename) ));
+ VG_(write)(fd, nul, 1);
+
+ for (i =3D 0; i < VG_(args_for_client).used; i++) {
+ VG_(write)(fd, VG_(args_for_client).strs[i],
+ VG_(strlen)( VG_(args_for_client).strs[i] ));
+ VG_(write)(fd, nul, 1);
+ }
+
+ /* Don't bother to seek the file back to the start; instead do
+ it every time a copy of it is given out (by PRE(sys_open)).=20
+ That is probably more robust across fork() etc. */
+
+ /* Now delete it, but hang on to the fd. */
+ r =3D VG_(unlink)( buf2 );
+ if (r)
+ config_error("Can't delete client cmdline file in /tmp.");
+
+ VG_(cl_cmdline_fd) =3D fd;
+ }
+
+ //--------------------------------------------------------------
// Init tool part 1: pre_clo_init
// p: setup_client_stack() [for 'VG_(client_arg[cv]']
// p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
Modified: branches/ASPACEM/coregrind/m_skiplist.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_skiplist.c 2005-09-26 10:05:38 UTC (rev =
4782)
+++ branches/ASPACEM/coregrind/m_skiplist.c 2005-09-26 13:42:16 UTC (rev =
4783)
@@ -119,7 +119,7 @@
{
UInt ret =3D 0;
=20
- while((ret < SK_MAXHEIGHT - 1) && (VG_(random)() & 1))
+ while((ret < SK_MAXHEIGHT - 1) && (VG_(random)(NULL) & 1))
ret++;
=20
return ret;
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-26 10:=
05:38 UTC (rev 4782)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-26 13:=
42:16 UTC (rev 4783)
@@ -4937,7 +4937,9 @@
=20
PRE(sys_open)
{
- *flags |=3D SfMayBlock;
+ HChar name[30];
+ SysRes sres;
+
if (ARG2 & VKI_O_CREAT) {
// 3-arg version
PRINT("sys_open ( %p(%s), %d, %d )",ARG1,ARG1,ARG2,ARG3);
@@ -4950,6 +4952,28 @@
const char *, filename, int, flags);
}
PRE_MEM_RASCIIZ( "open(filename)", ARG1 );
+
+ /* Handle the case where the open is of /proc/self/cmdline or
+ /proc/<pid>/cmdline, and just give it a copy of the fd for the
+ fake file we cooked up at startup (in m_main). Also, seek the
+ cloned fd back to the start. */
+
+ VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
+ if (ML_(safe_to_deref)( (void*)ARG1, 1 )
+ && (VG_(strcmp)((Char *)ARG1, name) =3D=3D 0=20
+ || VG_(strcmp)((Char *)ARG1, "/proc/self/cmdline") =3D=3D 0))=
{
+ sres =3D VG_(dup)( VG_(cl_cmdline_fd) );
+ SET_STATUS_from_SysRes( sres );
+ if (!sres.isError) {
+ OffT off =3D VG_(lseek)( sres.val, 0, VKI_SEEK_SET );
+ if (off)
+ SET_STATUS_Failure( VKI_EMFILE );
+ }
+ return;
+ }
+
+ /* Otherwise handle normally */
+ *flags |=3D SfMayBlock;
}
=20
POST(sys_open)
@@ -5110,7 +5134,7 @@
VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
if (VG_(strcmp)((Char *)ARG1, name) =3D=3D 0 ||
VG_(strcmp)((Char *)ARG1, "/proc/self/exe") =3D=3D 0) {
- VG_(sprintf)(name, "/proc/self/fd/%d", VG_(clexecfd));
+ VG_(sprintf)(name, "/proc/self/fd/%d", VG_(cl_exec_fd));
SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, (UWord)name, AR=
G2, ARG3));
}
}
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-main.c 2005-09-26 10:05:=
38 UTC (rev 4782)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-main.c 2005-09-26 13:42:=
16 UTC (rev 4783)
@@ -673,7 +673,7 @@
success. */
PRINT(" --> [pre-success] Success(0x%llx)\n", (Long)sci->status.va=
l );
=20
- /* In this case thes allowable flag are to ask for a signal-poll
+ /* In this case the allowable flags are to ask for a signal-poll
and/or a yield after the call. Changing the args isn't
allowed. */
vg_assert(0 =3D=3D (sci->flags & ~(SfPollAfter | SfYieldAfter)));
Modified: branches/ASPACEM/coregrind/pub_core_clientstate.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_clientstate.h 2005-09-26 10:05:38=
UTC (rev 4782)
+++ branches/ASPACEM/coregrind/pub_core_clientstate.h 2005-09-26 13:42:16=
UTC (rev 4783)
@@ -52,8 +52,19 @@
extern Addr VG_(brk_limit); // current brk
=20
/* A fd which refers to the client executable. */
-extern Int VG_(clexecfd);
+extern Int VG_(cl_exec_fd);
=20
+/* A fd which refers to the fake /proc/<pid>/cmdline in /tmp. The
+ idea is: make up the /proc/<pid>/cmdline file the client would
+ expect to see if it was running natively. Copy into a file in
+ /tmp. When the client then does an open of /proc/<pid>/cmdline or
+ /proc/self/cmdline, instead give it a file handle to the file in
+ /tmp. The problem of deleting said file when Valgrind exits is
+ neatly sidestepped by unlinking it as soon as it has been created,
+ but holding on to the file handle. That causes the kernel to keep
+ the file contents alive exactly until the process exits. */
+extern Int VG_(cl_cmdline_fd);
+
// Client's original rlimit data and rlimit stack
extern struct vki_rlimit VG_(client_rlimit_data);
extern struct vki_rlimit VG_(client_rlimit_stack);
Modified: branches/ASPACEM/coregrind/pub_core_libcfile.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_libcfile.h 2005-09-26 10:05:38 UT=
C (rev 4782)
+++ branches/ASPACEM/coregrind/pub_core_libcfile.h 2005-09-26 13:42:16 UT=
C (rev 4783)
@@ -67,6 +67,12 @@
=20
extern SysRes VG_(pread) ( Int fd, void* buf, Int count, Int offset );
=20
+/* Create and open (-rw------) a tmp file name incorporating said arg.
+ Returns -1 on failure, else the fd of the file. If fullname is
+ non-NULL, the file's name is written into it. The number of bytes
+ written is guaranteed not to exceed 64+strlen(part_of_name). */
+extern Int VG_(mkstemp) ( HChar* part_of_name, /*OUT*/HChar* fullname );
+
#endif // __PUB_CORE_LIBCFILE_H
=20
/*--------------------------------------------------------------------*/
Modified: branches/ASPACEM/include/pub_tool_libcbase.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/pub_tool_libcbase.h 2005-09-26 10:05:38 UTC =
(rev 4782)
+++ branches/ASPACEM/include/pub_tool_libcbase.h 2005-09-26 13:42:16 UTC =
(rev 4783)
@@ -114,10 +114,10 @@
/* Returns the base-2 logarithm of x. */
extern Int VG_(log2) ( Int x );
=20
-// A pseudo-random number generator returning a random UInt, and its
-// seed function.
-extern void VG_(srandom) ( UInt seed );
-extern UInt VG_(random) ( void );
+// A pseudo-random number generator returning a random UInt. If pSeed
+// is NULL, it uses its own seed, which starts at zero. If pSeed is
+// non-NULL, it uses and updates whatever pSeed points at.
+extern UInt VG_(random) ( /*MOD*/UInt* pSeed );
=20
#endif // __PUB_TOOL_LIBCBASE_H
=20
Modified: branches/ASPACEM/include/pub_tool_libcfile.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/pub_tool_libcfile.h 2005-09-26 10:05:38 UTC =
(rev 4782)
+++ branches/ASPACEM/include/pub_tool_libcfile.h 2005-09-26 13:42:16 UTC =
(rev 4783)
@@ -44,7 +44,7 @@
=20
extern SysRes VG_(stat) ( Char* file_name, struct vki_stat* buf );
extern Int VG_(fstat) ( Int fd, struct vki_stat* buf );
-extern Int VG_(dup2) ( Int oldfd, Int newfd );
+extern SysRes VG_(dup) ( Int oldfd );
extern Int VG_(rename) ( Char* old_name, Char* new_name );
extern Int VG_(unlink) ( Char* file_name );
=20
|
|
From: <sv...@va...> - 2005-09-26 10:05:45
|
Author: sewardj
Date: 2005-09-26 11:05:38 +0100 (Mon, 26 Sep 2005)
New Revision: 4782
Log:
Make the leak checker work properly again: don't use client heap
sections as sources of roots. This requires aspacem to keep track of
which anonymous client mappings 'belong' to m_mallocfree.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
branches/ASPACEM/coregrind/m_mallocfree.c
branches/ASPACEM/include/pub_tool_aspacemgr.h
branches/ASPACEM/memcheck/mac_leakcheck.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-26 01:55:1=
4 UTC (rev 4781)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-26 10:05:3=
8 UTC (rev 4782)
@@ -512,47 +512,50 @@
case SkAnonC: case SkAnonV:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %010llx-%010llx %s %c%c%c%c\n",
+ "%3d: %s %010llx-%010llx %s %c%c%c%c%c\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
- seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-'=20
+ seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-',
+ seg->isCH ? 'H' : '-'
);
break;
=20
case SkFileC: case SkFileV:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %010llx-%010llx %s %c%c%c%c d=3D0x%03llx "
+ "%3d: %s %010llx-%010llx %s %c%c%c%c%c d=3D0x%03llx "
"i=3D%-7lld o=3D%-7lld (%d)\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-',=20
+ seg->isCH ? 'H' : '-',
(ULong)seg->dev, (ULong)seg->ino, (Long)seg->offset, seg->fn=
Idx
);
break;
=20
- case SkResvn:
- VG_(debugLog)(
- logLevel, "aspacem",
- "%3d: %s %010llx-%010llx %s %c%c%c%c %s\n",
- segNo, show_SegKind(seg->kind),
- (ULong)seg->start, (ULong)seg->end, len_buf,
- seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
- seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-',=20
- show_ShrinkMode(seg->smode)
- );
- break;
+ case SkResvn:
+ VG_(debugLog)(
+ logLevel, "aspacem",
+ "%3d: %s %010llx-%010llx %s %c%c%c%c%c %s\n",
+ segNo, show_SegKind(seg->kind),
+ (ULong)seg->start, (ULong)seg->end, len_buf,
+ seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
+ seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-',=20
+ seg->isCH ? 'H' : '-',
+ show_ShrinkMode(seg->smode)
+ );
+ break;
=20
- default:
- VG_(debugLog)(
- logLevel, "aspacem",
- "%3d: ???? UNKNOWN SEGMENT KIND\n",=20
- segNo=20
- );
- break;
- }
+ default:
+ VG_(debugLog)(
+ logLevel, "aspacem",
+ "%3d: ???? UNKNOWN SEGMENT KIND\n",=20
+ segNo=20
+ );
+ break;
+ }
}
=20
/* Print out the segment array (debugging only!). */
@@ -668,21 +671,25 @@
return=20
s->smode =3D=3D SmFixed
&& s->dev =3D=3D 0 && s->ino =3D=3D 0 && s->offset =3D=3D 0 =
&& s->fnIdx =3D=3D -1=20
- && !s->hasR && !s->hasW && !s->hasX && !s->hasT;
+ && !s->hasR && !s->hasW && !s->hasX && !s->hasT
+ && !s->isCH;
=20
case SkAnonC: case SkAnonV:
return=20
s->smode =3D=3D SmFixed=20
- && s->dev =3D=3D 0 && s->ino =3D=3D 0 && s->offset =3D=3D 0 =
&& s->fnIdx =3D=3D -1;
+ && s->dev =3D=3D 0 && s->ino =3D=3D 0 && s->offset =3D=3D 0 =
&& s->fnIdx =3D=3D -1
+ && (s->kind=3D=3DSkAnonC ? True : !s->isCH);
=20
case SkFileC: case SkFileV:
return=20
- s->smode =3D=3D SmFixed;
+ s->smode =3D=3D SmFixed
+ && !s->isCH;
=20
case SkResvn:=20
return=20
s->dev =3D=3D 0 && s->ino =3D=3D 0 && s->offset =3D=3D 0 && =
s->fnIdx =3D=3D -1=20
- && !s->hasR && !s->hasW && !s->hasX && !s->hasT;
+ && !s->hasR && !s->hasW && !s->hasX && !s->hasT
+ && !s->isCH;
=20
default:
return False;
@@ -713,8 +720,8 @@
return True;
=20
case SkAnonC: case SkAnonV:
- if (s1->hasR =3D=3D s2->hasR=20
- && s1->hasW =3D=3D s2->hasW && s1->hasX =3D=3D s2->hasX) {
+ if (s1->hasR =3D=3D s2->hasR && s1->hasW =3D=3D s2->hasW=20
+ && s1->hasX =3D=3D s2->hasX && s1->isCH =3D=3D s2->isCH) {
s1->end =3D s2->end;
s1->hasT |=3D s2->hasT;
return True;
@@ -1345,7 +1352,7 @@
seg->ino =3D 0;
seg->offset =3D 0;
seg->fnIdx =3D -1;
- seg->hasR =3D seg->hasW =3D seg->hasX =3D seg->hasT =3D False;
+ seg->hasR =3D seg->hasW =3D seg->hasX =3D seg->hasT =3D seg->isCH =3D=
False;
seg->mark =3D False;
}
=20
Modified: branches/ASPACEM/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_mallocfree.c 2005-09-26 01:55:14 UTC (re=
v 4781)
+++ branches/ASPACEM/coregrind/m_mallocfree.c 2005-09-26 10:05:38 UTC (re=
v 4782)
@@ -537,6 +537,7 @@
{
Superblock* sb;
SysRes sres;
+ NSegment* seg;
=20
// Take into account admin bytes in the Superblock.
cszB +=3D sizeof(Superblock);
@@ -551,6 +552,12 @@
if (sres.isError)
return 0;
sb =3D (Superblock*)sres.val;
+ // Mark this segment as containing client heap. The leak
+ // checker needs to be able to identify such segments so as not
+ // to use them as sources of roots during leak checks.
+ seg =3D VG_(am_find_nsegment)( (Addr)sb );
+ vg_assert(seg && seg->kind =3D=3D SkAnonC);
+ seg->isCH =3D True;
} else {
// non-client allocation -- abort if it fails
sres =3D VG_(am_mmap_anon_float_valgrind)( cszB );
Modified: branches/ASPACEM/include/pub_tool_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/pub_tool_aspacemgr.h 2005-09-26 01:55:14 UTC=
(rev 4781)
+++ branches/ASPACEM/include/pub_tool_aspacemgr.h 2005-09-26 10:05:38 UTC=
(rev 4782)
@@ -101,7 +101,9 @@
Bool hasW;
Bool hasX;
Bool hasT; // True --> translations have (or MAY have)
- /* Admin */ // been taken from this segment
+ // been taken from this segment
+ Bool isCH; // True --> is client heap (SkAnonC ONLY)
+ /* Admin */
Bool mark;
}
NSegment;
Modified: branches/ASPACEM/memcheck/mac_leakcheck.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/memcheck/mac_leakcheck.c 2005-09-26 01:55:14 UTC (re=
v 4781)
+++ branches/ASPACEM/memcheck/mac_leakcheck.c 2005-09-26 10:05:38 UTC (re=
v 4782)
@@ -117,19 +117,23 @@
-- Unreached; so far, no pointers to any part of it have been found.=20
-- IndirectLeak; leaked, but referred to by another leaked block
*/
-typedef enum {=20
- Unreached,=20
- IndirectLeak,
- Interior,=20
- Proper
- } Reachedness;
+typedef=20
+ enum {=20
+ Unreached,=20
+ IndirectLeak,
+ Interior,=20
+ Proper
+ }
+ Reachedness;
=20
/* An entry in the mark stack */
-typedef struct {
- Int next:30; /* Index of next in mark stack */
- UInt state:2; /* Reachedness */
- SizeT indirect; /* if Unreached, how much is unreachable from here *=
/
-} MarkStack;
+typedef=20
+ struct {
+ Int next:30; /* Index of next in mark stack */
+ UInt state:2; /* Reachedness */
+ SizeT indirect; /* if Unreached, how much is unreachable from here=
*/
+ }=20
+ MarkStack;
=20
/* A block record, used for generating err msgs. */
typedef
@@ -147,11 +151,13 @@
LossRecord;
=20
/* The 'extra' struct for leak errors. */
-typedef struct {
- UInt n_this_record;
- UInt n_total_records;
- LossRecord* lossRecord;
-} LeakExtra;
+typedef=20
+ struct {
+ UInt n_this_record;
+ UInt n_total_records;
+ LossRecord* lossRecord;
+ }
+ LeakExtra;
=20
/* Find the i such that ptr points at or inside the block described by
shadows[i]. Return -1 if none found. This assumes that shadows[]
@@ -324,7 +330,7 @@
/* If ptr is pointing to a heap-allocated block which hasn't been seen
before, push it onto the mark stack. Clique is the index of the
clique leader; -1 if none. */
-static void _lc_markstack_push(Addr ptr, Int clique)
+static void lc_markstack_push_WRK(Addr ptr, Int clique)
{
Int sh_no;
=20
@@ -353,6 +359,8 @@
lc_markstack_top =3D sh_no;
}
=20
+ tl_assert(clique >=3D -1 && clique < lc_n_shadows);
+
if (clique !=3D -1) {
if (0)
VG_(printf)("mopup: %d: %p is %d\n",=20
@@ -394,7 +402,7 @@
=20
static void lc_markstack_push(Addr ptr)
{
- _lc_markstack_push(ptr, -1);
+ lc_markstack_push_WRK(ptr, -1);
}
=20
/* Return the top of the mark stack, if any. */
@@ -416,7 +424,7 @@
=20
If clique !=3D -1, it means we're gathering leaked memory into
cliques, and clique is the index of the current clique leader. */
-static void _lc_scan_memory(Addr start, SizeT len, Int clique)
+static void lc_scan_memory_WRK(Addr start, SizeT len, Int clique)
{
Addr ptr =3D VG_ROUNDUP(start, sizeof(Addr));
Addr end =3D VG_ROUNDDN(start+len, sizeof(Addr));
@@ -427,7 +435,7 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, NULL, &sigmask);
VG_(set_fault_catcher)(scan_all_valid_memory_catcher);
=20
- lc_scanned +=3D end-ptr;
+ // lc_scanned +=3D end-ptr;
=20
if (!VG_(am_is_valid_for_client)(ptr, sizeof(Addr), VKI_PROT_READ))
ptr =3D VG_PGROUNDUP(ptr+1); /* first page bad */
@@ -449,8 +457,9 @@
=20
if (__builtin_setjmp(memscan_jmpbuf) =3D=3D 0) {
if ((*lc_is_valid_aligned_word)(ptr)) {
+ lc_scanned +=3D sizeof(Addr);
addr =3D *(Addr *)ptr;
- _lc_markstack_push(addr, clique);
+ lc_markstack_push_WRK(addr, clique);
} else if (0 && VG_DEBUG_LEAKCHECK)
VG_(printf)("%p not valid\n", ptr);
ptr +=3D sizeof(Addr);
@@ -470,7 +479,7 @@
=20
static void lc_scan_memory(Addr start, SizeT len)
{
- _lc_scan_memory(start, len, -1);
+ lc_scan_memory_WRK(start, len, -1);
}
=20
/* Process the mark stack until empty. If mopup is true, then we're
@@ -484,7 +493,7 @@
tl_assert(top >=3D 0 && top < lc_n_shadows); =20
tl_assert(lc_markstack[top].state !=3D Unreached);
=20
- _lc_scan_memory(lc_shadows[top]->data, lc_shadows[top]->size, cliq=
ue);
+ lc_scan_memory_WRK(lc_shadows[top]->data, lc_shadows[top]->size, c=
lique);
}
}
=20
@@ -521,7 +530,7 @@
if (VG_DEBUG_CLIQUE)
VG_(printf)("%d: gathering clique %p\n", i, lc_shadows[i]->data);
=20
- _lc_markstack_push(lc_shadows[i]->data, i);
+ lc_markstack_push_WRK(lc_shadows[i]->data, i);
=20
lc_do_leakcheck(i);
=20
@@ -726,14 +735,22 @@
=20
lc_scanned =3D 0;
=20
- /* Do the scan of memory, pushing any pointers onto the mark stack.
- Here, we iterate over the segment array, handing any RW client
- sections to lc_scan_memory. */
+ /* Push roots onto the mark stack. Roots are:
+ - the integer registers of all threads
+ - all mappings belonging to the client, including stacks
+ - .. but excluding any client heap segments.
+ Client heap segments are excluded because we wish to differentiate
+ client heap blocks which are referenced only from inside the heap
+ from those outside. This facilitates the indirect vs direct loss
+ categorisation, which [if the users ever manage to understand it]
+ is really useful for detecting lost cycles.
+ */
{ NSegment* seg;
Addr* seg_starts;
Int n_seg_starts;
seg_starts =3D get_seg_starts( &n_seg_starts );
tl_assert(seg_starts && n_seg_starts > 0);
+ /* VG_(am_show_nsegments)( 0,"leakcheck"); */
for (i =3D 0; i < n_seg_starts; i++) {
seg =3D VG_(am_find_nsegment)( seg_starts[i] );
tl_assert(seg);
@@ -741,6 +758,10 @@
continue;
if (!(seg->hasR && seg->hasW))
continue;
+ if (seg->isCH)
+ continue;
+ if (0)
+ VG_(printf)("ACCEPT %2d %p %p\n", i, seg->start, seg->end);
lc_scan_memory(seg->start, seg->end+1 - seg->start);
}
}
|
|
From: <js...@ac...> - 2005-09-26 02:58:02
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-09-26 03:30:00 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 186 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <to...@co...> - 2005-09-26 02:42:03
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-09-26 03:30:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 188 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-26 02:27:55
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-09-26 03:15:04 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 == 187 tests, 14 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/x86/yield (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 == 187 tests, 14 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Sep 26 03:21:22 2005 --- new.short Mon Sep 26 03:27:46 2005 *************** *** 8,10 **** ! == 187 tests, 14 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) --- 8,10 ---- ! == 187 tests, 14 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) *************** *** 23,24 **** --- 23,25 ---- none/tests/x86/int (stderr) + none/tests/x86/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-09-26 02:25:23
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-09-26 03:10:07 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 == 187 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) ================================================= == 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 == 187 tests, 2 stderr failures, 1 stdout failure ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/x86/yield (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Sep 26 03:19:23 2005 --- new.short Mon Sep 26 03:25:17 2005 *************** *** 8,13 **** ! == 187 tests, 2 stderr failures, 1 stdout failure ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) - none/tests/x86/yield (stdout) --- 8,12 ---- ! == 187 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-26 02:21:07
|
Nightly build on dellow ( x86_64, Fedora Core 4 ) started at 2005-09-26 03:10:07 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-26 02:18:21
|
Nightly build on aston ( x86_64, Fedora Core 3 ) started at 2005-09-26 03:05:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 6 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) |
|
From: Tom H. <th...@cy...> - 2005-09-26 02:14:33
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-09-26 03:00:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 165 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) |
|
From: <sv...@va...> - 2005-09-26 01:55:16
|
Author: njn Date: 2005-09-26 02:55:14 +0100 (Mon, 26 Sep 2005) New Revision: 4781 Log: record an email Modified: trunk/docs/internals/segments-seginfos.txt Modified: trunk/docs/internals/segments-seginfos.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/internals/segments-seginfos.txt 2005-09-26 01:49:39 UTC (r= ev 4780) +++ trunk/docs/internals/segments-seginfos.txt 2005-09-26 01:55:14 UTC (r= ev 4781) @@ -57,3 +57,74 @@ That would be unusual, but possible. You could imagine ld generating an ELF file via a mapping this way (which would probably upset Valgrind no end). + +------------------------------------------------------------------------= ----- +More from John Reiser +------------------------------------------------------------------------= ----- +> Can a Segment get split (eg. by mprotect)? + +This happens when a debugger inserts a breakpoint, or when ld-linux +relocates a module that has DT_TEXTREL, or when a co-resident monitor +rewrites some instructions. On x86, a shared lib with relocations to +.text "works" just fine. The modified pages are no longer sharable, +but the instruction stream is functional. It's even rather common, +when a builder forgets to use -fpic for one or more files. It +can be done on purpose when the modularity is more important than +the page sharing. Non-pic code is faster, too: register %ebx is +not dedicated to _GLOBAL_OFFSET_TABLE_ addressing, and global variables +can be accessed by [relocated] inline 32-bit offset rather than by +address fetched from the GOT. + +> Can a new mmap appear in the address range of an existing SegInfo? + +On x86_64 the static linker ld inserts a 1MB "hole" between .text +and .data. This is on advice from the hardware performance mavens, +because various caching+prefetching hardware can look ahead that far. +Currently ld-linux leaves this as PROT_NONE, but anybody else is +free to override that assignment. + +> From peering at various /proc/*/maps files, the following scheme +> sounds plausible: +> +> Load symbols following an mmap if: +> +> map is to a file +> map has r-x permissions +> file has a valid ELF header +> possibly: mapping is > 1 page (catches the case of mapping first +> page just to examine the header) +> +> If the client wants to subsequently chop up the mapping, or change its +> permissions, we ignore that. I have never seen any evidence in +> proc/*/maps that ld.so does such things. + +glibc-2.3.5 ld-linux does. It finds the minimum interval of pages which +covers the p_memsz of all PT_LOAD, mmap()s that much from the file [even= if +this maps beyond EOF of the file], then munmap()s [or mprotect(,,PROT_NO= NE)] +everything that is not covered by the first PT_LOAD, then +mmap(,,,MAP_FIXED,,) each remaining PT_LOAD. This is done to overcome t= he +possibility that a kernel which randomizes the placement of mmap(0, ...) +might place the first PT_LOAD so that subsequent PT_LOAD [must maintain +relative addressing to other PT_LOAD from the same file] would evict +something else. Needless to say, ld-linux assumes that it is the only a= ctor +(well, dlopen() does try for mutual exclusion) and that any "holes" betw= een +PT_LOAD from the same module are ignorable as far as allocation is +concerned. Also, there is nothing to stop a file from having PT_LOAD th= at +overlap, or appear in non-ascending order, etc. The results might depen= d on +order of processing, but always it has been by order of appearance in th= e +file. [Probably this is a good way to trigger "bugs" in ld-linux and/or= the +kernel.] + +Some algorithms and data structures internal to glibc-2.3.5 assume that +modules do not overlap. In particular, ld-linux sometimes searches +for __builtin_return_address_(0) in a set of intervals in order to deter= mine +which shared lib called ld-linux. This matters for dlsym(), dlmopen(), +etc., and assumes that the intervals are a disjoint cover of any +"legal" callers. ld-linux tries to hide all of this from the prying +eyes of anyone else [the internal version of struct link_map contains +much more than specified in <link.h>]. Some of this is good because +it changes very frequently, but some parts are bad because in the past +ld-linux has been slow to provide needed services [such as +dl_iterate_phdr()] and even antagonistic towards anybody else +trying for peaceful co-existence without the blessing of ld-linux. + |
|
From: <sv...@va...> - 2005-09-26 01:49:45
|
Author: njn
Date: 2005-09-26 02:49:39 +0100 (Mon, 26 Sep 2005)
New Revision: 4780
Log:
update
Modified:
trunk/docs/internals/3_0_BUGSTATUS.txt
Modified: trunk/docs/internals/3_0_BUGSTATUS.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/internals/3_0_BUGSTATUS.txt 2005-09-26 01:12:57 UTC (rev 4=
779)
+++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-09-26 01:49:39 UTC (rev 4=
780)
@@ -150,12 +150,24 @@
FIXED-30BRANCH: TODO
=20
----------------------------------------------------------------
+112199 naked ar tool is used in vex makefile
+
+FIXED-TRUNK: vex:1397
+FIXED-30BRANCH: TODO
+
+----------------------------------------------------------------
112501 vex x86->IR: movq (0xF 0x7F 0xC1 0xF)
=20
FIXED-TRUNK: TODO
FIXED-30BRANCH: TODO
=20
----------------------------------------------------------------
+113190 Broken links in docs/html/
+
+FIXED-TRUNK: vg:4778
+FIXED-30BRANCH: TODO
+
+----------------------------------------------------------------
113230 Valgrind sys_pipe on x86-64 wrongly thinks file descriptors
should be 64bit
=20
@@ -169,13 +181,7 @@
FIXED-TRUNK: vg:4769
FIXED-30BRANCH: TODO
=20
-----------------------------------------------------------------
-113190 Broken links in docs/html/
=20
-FIXED-TRUNK: vg:4778
-FIXED-30BRANCH: TODO
-
-
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D Bugs targeted for 3.1.0 and 3.0.1 (all done, 3.0.1 released) =
=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|
|
From: <sv...@va...> - 2005-09-26 01:12:58
|
Author: njn Date: 2005-09-26 02:12:57 +0100 (Mon, 26 Sep 2005) New Revision: 4779 Log: update Modified: trunk/docs/internals/3_0_BUGSTATUS.txt Modified: trunk/docs/internals/3_0_BUGSTATUS.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/internals/3_0_BUGSTATUS.txt 2005-09-26 01:11:40 UTC (rev 4= 778) +++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-09-26 01:12:57 UTC (rev 4= 779) @@ -169,7 +169,13 @@ FIXED-TRUNK: vg:4769 FIXED-30BRANCH: TODO =20 +---------------------------------------------------------------- +113190 Broken links in docs/html/ =20 +FIXED-TRUNK: vg:4778 +FIXED-30BRANCH: TODO + + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D Bugs targeted for 3.1.0 and 3.0.1 (all done, 3.0.1 released) = =3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D |