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
(17) |
2
(11) |
3
(6) |
4
(6) |
|
5
(10) |
6
(5) |
7
(3) |
8
(7) |
9
(4) |
10
(4) |
11
(3) |
|
12
(3) |
13
(17) |
14
(18) |
15
(32) |
16
(22) |
17
(18) |
18
(10) |
|
19
(4) |
20
(3) |
21
(8) |
22
(15) |
23
(32) |
24
(28) |
25
(18) |
|
26
(20) |
27
(16) |
28
(28) |
29
(28) |
30
(27) |
|
|
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 23:12:34
|
---------- Forwarded message ---------- From: Michael Sweet <ms...@ap...> Date: Fri, Apr 24, 2009 at 8:41 AM Subject: Re: [Valgrind-developers] ping on bug report To: Nicholas Nethercote <n.n...@gm...> On Apr 23, 2009, at 3:24 PM, Nicholas Nethercote wrote: ... (If anyone else has relevant use-cases they would encounter, please speak up!) FWIW, the CUPS "make test" target uses --trace-children=yes when running with valgrind specifically so we can test all of the child processes (print filters, generally) in their "native" environment when run from CUPS - we wouldn't run in any other mode. For the rest of the software I've run through valgrind (maybe a couple dozen all together), I can only think of 1 case that I specifically didn't want to trace children - EPM, which runs the corresponding package maker program after creating all of the format-specific support files/directories. ________________________________________ Michael R Sweet, Senior Printing System Engineer |
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 22:24:55
|
On Thu, Apr 23, 2009 at 7:43 PM, Julian Seward <js...@ac...> wrote: > >> I wonder >> if tracing all children is a better default than tracing no children. > > Euh .. I prefer not to do that. You could wind up tracing > a huge tree of processes unexpectedly, if not careful. I'm not convinced this is a significant risk. Can you give an example? The most common relevant case I'm aware of is when a script or scripts are used to start up a program. In that case you almost always want to trace the children, because you're not very interested in the scripts. The current behaviour is confusing -- we have a FAQ about it, just today the submitter of bug #188735 hit it, if you don't know about the behaviour it's not clear from Valgrind's behaviour that you're not tracing the children. Even for experts it's easy to get wrong -- I frequently find myself forgetting the --trace-children and having to re-run things. (In fact, you really want a whitelist approach for this. Eg. "valgrind --white-list='/bin/the-real-app *'" which skips all the startup scripts. I realised last night that this could be faked by running Nulgrind (possibly with --quiet) on all the processes that don't match the white-list. Black-lists are still useful -- Dan K mentioned the "skip all Python sub-processes" use case -- so having both would be good, but the interactions would have to be carefully defined.) On the other hand, if we did trace children by default and hit the hypothetical big-tree-of-processes example, at least it's clear what's happening, because you get multiple start-up messages with different PIDs. (If anyone else has relevant use-cases they would encounter, please speak up!) > How about this. It gives the kind of flexibility you want, whilst > preserving existing behaviour. (remember the kinds of protestation > we've had in the past w.r.t. changing meaning/behaviour of > command line options) Yeah, that does make things difficult. Maybe we would deprecate --trace-children, keep it around for one more major release and then kill it. In general I don't like having multiple options that interact, often (as in this case) you can avoid it. Nick |
|
From: <sv...@va...> - 2009-04-23 20:07:30
|
Author: bart
Date: 2009-04-23 21:07:23 +0100 (Thu, 23 Apr 2009)
New Revision: 9595
Log:
Another performance optimization.
Modified:
trunk/drd/drd_bitmap.c
Modified: trunk/drd/drd_bitmap.c
===================================================================
--- trunk/drd/drd_bitmap.c 2009-04-23 19:23:09 UTC (rev 9594)
+++ trunk/drd/drd_bitmap.c 2009-04-23 20:07:23 UTC (rev 9595)
@@ -255,15 +255,14 @@
Bool DRD_(bm_has)(struct bitmap* const bm, const Addr a1, const Addr a2,
const BmAccessTypeT access_type)
{
- Addr b;
- for (b = a1; b < a2; b++)
- {
- if (! DRD_(bm_has_1)(bm, b, access_type))
- {
- return False;
- }
- }
- return True;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(access_type == eLoad || access_type == eStore);
+#endif
+
+ if (access_type == eLoad)
+ return DRD_(bm_has_any_load)(bm, a1, a2);
+ else
+ return DRD_(bm_has_any_store)(bm, a1, a2);
}
Bool
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-23 19:50:06
|
On Thu, Apr 23, 2009 at 5:10 AM, Nicholas Nethercote <n.n...@gm...> wrote: > Some time in the last few days, on my ubuntu box, > helgrind/tests/tc19_shadowmem started running incredibly slowly under > DRD. It used to take a few seconds, now it takes about 5 minutes. It > happens with both 32-bit and 64-bit builds. It's still fast under > Helgrind. You are not doing justice to DRD with such comments. Anyone who looks at user comments or at the bug database can see that since the time DRD is no longer an experimental tool it is doing a great job. The performance of the DRD tool is acceptable: for some programs it runs slightly faster than Helgrind and for some other it runs slightly slower. The program tc19_shadowmem is an exception for which DRD runs significantly slower than Helgrind. Your e-mail creates the impression that at some time there would have been a change in DRD that caused it to process tc19_shadowmem a lot slower than before. This is not correct. About a month ago (March 10, 2009) you informed me via private e-mail that there was an error in the file drd/tests/tc19_shadowmem.vgtest which caused this test to be skipped by DRD. This error was fixed on the same day (r9337) and since then during the regression tests DRD runs the program tc19_shadowmem. After having read your e-mail I started looking at why DRD was processing tc19_shadowmem so slowly. By this time DRD should process this test program significantly faster -- on my PC it is now processed in 50s. Bart. |
|
From: <sv...@va...> - 2009-04-23 19:23:21
|
Author: bart
Date: 2009-04-23 20:23:09 +0100 (Thu, 23 Apr 2009)
New Revision: 9594
Log:
Simplified bm_clear* implementations.
Modified:
trunk/drd/drd_bitmap.c
trunk/drd/drd_bitmap.h
Modified: trunk/drd/drd_bitmap.c
===================================================================
--- trunk/drd/drd_bitmap.c 2009-04-23 19:21:10 UTC (rev 9593)
+++ trunk/drd/drd_bitmap.c 2009-04-23 19:23:09 UTC (rev 9594)
@@ -459,9 +459,14 @@
tl_assert(a1);
tl_assert(a1 <= a2);
+#if 0
+ if (a2 - a1 >= ADDR0_COUNT)
+ VG_(message)(Vg_DebugMsg, "bm_clear(bm = %p, a1 = 0x%lx, a2 = 0x%lx, delta = 0x%lx",
+ bm, a1, a2, a2 - a1);
+#endif
+
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2ref* p2ref;
struct bitmap2* p2;
Addr c;
@@ -469,30 +474,17 @@
tl_assert(a1 <= b && b < a2);
#endif
- p2ref = bm2_lookup_next_exclusive(bm, b >> ADDR0_BITS);
- if (p2ref == 0)
- break;
+ p2 = bm2_lookup_exclusive(bm, b >> ADDR0_BITS);
- p2 = p2ref->bm2;
-
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(p2ref->addr >= (b >> ADDR0_BITS));
-#endif
- b = p2ref->addr << ADDR0_BITS;
- if (b < a1)
- b = a1;
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(a1 <= b);
-#endif
- if (b >= a2)
- break;
-
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
{
b_next = a2;
}
+ if (p2 == 0)
+ continue;
+
c = b;
/* If the first address in the bitmap that must be cleared does not */
/* start on an UWord boundary, start clearing the first addresses. */
@@ -545,9 +537,14 @@
tl_assert(a1);
tl_assert(a1 <= a2);
+#if 0
+ if (a2 - a1 >= ADDR0_COUNT)
+ VG_(message)(Vg_DebugMsg, "bm_clear_load(bm = %p, a1 = 0x%lx, a2 = 0x%lx, delta = 0x%lx",
+ bm, a1, a2, a2 - a1);
+#endif
+
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2ref* p2ref;
struct bitmap2* p2;
Addr c;
@@ -555,30 +552,17 @@
tl_assert(a1 <= b && b < a2);
#endif
- p2ref = bm2_lookup_next_exclusive(bm, b >> ADDR0_BITS);
- if (p2ref == 0)
- break;
+ p2 = bm2_lookup_exclusive(bm, b >> ADDR0_BITS);
- p2 = p2ref->bm2;
-
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(p2ref->addr >= (b >> ADDR0_BITS));
-#endif
- b = p2ref->addr << ADDR0_BITS;
- if (b < a1)
- b = a1;
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(a1 <= b);
-#endif
- if (b >= a2)
- break;
-
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
{
b_next = a2;
}
+ if (p2 == 0)
+ continue;
+
c = b;
/* If the first address in the bitmap that must be cleared does not */
/* start on an UWord boundary, start clearing the first addresses. */
@@ -642,9 +626,14 @@
tl_assert(a1);
tl_assert(a1 <= a2);
+#if 0
+ if (a2 - a1 >= ADDR0_COUNT)
+ VG_(message)(Vg_DebugMsg, "bm_clear_store(bm = %p, a1 = 0x%lx, a2 = 0x%lx, delta = 0x%lx",
+ bm, a1, a2, a2 - a1);
+#endif
+
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2ref* p2ref;
struct bitmap2* p2;
Addr c;
@@ -652,30 +641,17 @@
tl_assert(a1 <= b && b < a2);
#endif
- p2ref = bm2_lookup_next_exclusive(bm, b >> ADDR0_BITS);
- if (p2ref == 0)
- break;
+ p2 = bm2_lookup_exclusive(bm, b >> ADDR0_BITS);
- p2 = p2ref->bm2;
-
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(p2ref->addr >= (b >> ADDR0_BITS));
-#endif
- b = p2ref->addr << ADDR0_BITS;
- if (b < a1)
- b = a1;
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(a1 <= b);
-#endif
- if (b >= a2)
- break;
-
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
{
b_next = a2;
}
+ if (p2 == 0)
+ continue;
+
c = b;
/* If the first address in the bitmap that must be cleared does not */
/* start on an UWord boundary, start clearing the first addresses. */
Modified: trunk/drd/drd_bitmap.h
===================================================================
--- trunk/drd/drd_bitmap.h 2009-04-23 19:21:10 UTC (rev 9593)
+++ trunk/drd/drd_bitmap.h 2009-04-23 19:23:09 UTC (rev 9594)
@@ -428,41 +428,6 @@
return bm2;
}
-/** Look up the first address in bitmap bm that is greater than or equal to
- * a1 and return a pointer to a second level bitmap that is not shared and
- * hence may be modified.
- *
- * @param a1 client address shifted right by ADDR0_BITS.
- * @param bm bitmap pointer.
- */
-static __inline__
-struct bitmap2ref*
-bm2_lookup_next_exclusive(struct bitmap* const bm, const UWord a1)
-{
- struct bitmap2ref* bm2ref;
- struct bitmap2* bm2;
-
- bm2ref = 0;
- bm2 = 0;
-
- VG_(OSetGen_ResetIterAt)(bm->oset, &a1);
- bm2ref = VG_(OSetGen_Next)(bm->oset);
-
- if (bm2ref)
- {
- bm2 = bm2ref->bm2;
- if (bm2->refcnt > 1)
- {
-#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
- tl_assert(bm2ref);
-#endif
- bm2 = bm2_make_exclusive(*(struct bitmap**)&bm, bm2ref);
- }
- }
-
- return bm2ref;
-}
-
/** Look up the address a1 in bitmap bm. The returned second level bitmap has
* reference count one and hence may be modified.
*
|
|
From: <sv...@va...> - 2009-04-23 19:21:16
|
Author: bart Date: 2009-04-23 20:21:10 +0100 (Thu, 23 Apr 2009) New Revision: 9593 Log: Added --show-confl-seg=no to the tc19_shadowmem test, which speeds up the test by about 10%. Modified: trunk/drd/tests/tc19_shadowmem.stderr.exp-32bit trunk/drd/tests/tc19_shadowmem.stderr.exp-64bit trunk/drd/tests/tc19_shadowmem.vgtest [... diff too large to include ...] |
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 17:35:02
|
Nightly build on ocean32 ( Ubuntu 8.10, Intel x86-64 (32-bit only) ) started at 2009-04-24 03:00:01 EST
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
== 446 tests, 7 stderr failures, 2 stdout failures, 0 post failures ==
memcheck/tests/linux/stack_switch (stderr)
memcheck/tests/origin1-yes (stderr)
memcheck/tests/origin5-bz2 (stderr)
none/tests/linux/mremap2 (stdout)
none/tests/shell (stdout)
none/tests/shell (stderr)
none/tests/shell_valid1 (stderr)
none/tests/shell_valid2 (stderr)
none/tests/shell_valid3 (stderr)
=================================================
./valgrind/memcheck/tests/linux/stack_switch.stderr.diff
=================================================
--- stack_switch.stderr.exp 2009-04-24 03:22:37.000000000 +1000
+++ stack_switch.stderr.out 2009-04-24 03:32:47.000000000 +1000
@@ -0,0 +1,2 @@
+Syscall param clone(child_tidptr) contains uninitialised byte(s)
+ ...
=================================================
./valgrind/memcheck/tests/origin1-yes.stderr.diff
=================================================
--- origin1-yes.stderr.exp 2009-04-24 03:22:43.000000000 +1000
+++ origin1-yes.stderr.out 2009-04-24 03:33:04.000000000 +1000
@@ -47,7 +47,7 @@
Conditional jump or move depends on uninitialised value(s)
at 0x........: main (origin1-yes.c:93)
Uninitialised value was created
- at 0x........: brk (in /...libc...)
+ at 0x........: ??? (in /lib32/ld-2.8.90.so)
by 0x........: sbrk (in /...libc...)
by 0x........: main (origin1-yes.c:90)
=================================================
./valgrind/memcheck/tests/origin5-bz2.stderr.diff-glibc25-amd64
=================================================
--- origin5-bz2.stderr.exp-glibc25-amd64 2009-04-24 03:22:43.000000000 +1000
+++ origin5-bz2.stderr.out 2009-04-24 03:33:07.000000000 +1000
@@ -11,7 +11,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: handle_compress (origin5-bz2.c:4686)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
@@ -19,7 +19,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: handle_compress (origin5-bz2.c:4686)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
@@ -27,7 +27,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: mainSort (origin5-bz2.c:2820)
by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -38,7 +38,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: mainSort (origin5-bz2.c:2823)
by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -49,7 +49,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: mainSort (origin5-bz2.c:2854)
by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -60,7 +60,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: mainSort (origin5-bz2.c:2858)
by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -71,7 +71,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: mainSort (origin5-bz2.c:2963)
by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -82,7 +82,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: mainSort (origin5-bz2.c:2964)
by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -93,7 +93,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: fallbackSort (origin5-bz2.c:2269)
by 0x........: BZ2_blockSort (origin5-bz2.c:3116)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
@@ -104,7 +104,7 @@
Uninitialised value was created by a client request
at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: fallbackSort (origin5-bz2.c:2275)
by 0x........: BZ2_blockSort (origin5-bz2.c:3116)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
=================================================
./valgrind/memcheck/tests/origin5-bz2.stderr.diff-glibc25-x86
=================================================
--- origin5-bz2.stderr.exp-glibc25-x86 2009-04-24 03:22:43.000000000 +1000
+++ origin5-bz2.stderr.out 2009-04-24 03:33:07.000000000 +1000
@@ -28,7 +28,8 @@
at 0x........: main (origin5-bz2.c:6479)
Use of uninitialised value of size 4
- at 0x........: BZ2_blockSort (origin5-bz2.c:2820)
+ at 0x........: mainSort (origin5-bz2.c:2820)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
@@ -38,7 +39,8 @@
at 0x........: main (origin5-bz2.c:6479)
Use of uninitialised value of size 4
- at 0x........: BZ2_blockSort (origin5-bz2.c:2823)
+ at 0x........: mainSort (origin5-bz2.c:2823)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
@@ -48,7 +50,8 @@
at 0x........: main (origin5-bz2.c:6479)
Use of uninitialised value of size 4
- at 0x........: BZ2_blockSort (origin5-bz2.c:2855)
+ at 0x........: mainSort (origin5-bz2.c:2854)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
@@ -58,7 +61,8 @@
at 0x........: main (origin5-bz2.c:6479)
Use of uninitialised value of size 4
- at 0x........: BZ2_blockSort (origin5-bz2.c:2859)
+ at 0x........: mainSort (origin5-bz2.c:2858)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
@@ -68,7 +72,8 @@
at 0x........: main (origin5-bz2.c:6479)
Use of uninitialised value of size 4
- at 0x........: BZ2_blockSort (origin5-bz2.c:2963)
+ at 0x........: mainSort (origin5-bz2.c:2963)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
@@ -78,7 +83,8 @@
at 0x........: main (origin5-bz2.c:6479)
Use of uninitialised value of size 4
- at 0x........: BZ2_blockSort (origin5-bz2.c:2964)
+ at 0x........: mainSort (origin5-bz2.c:2964)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
=================================================
./valgrind/memcheck/tests/origin5-bz2.stderr.diff-glibc27-ppc64
=================================================
--- origin5-bz2.stderr.exp-glibc27-ppc64 2009-04-24 03:22:43.000000000 +1000
+++ origin5-bz2.stderr.out 2009-04-24 03:33:07.000000000 +1000
@@ -1,7 +1,7 @@
Conditional jump or move depends on uninitialised value(s)
at 0x........: main (origin5-bz2.c:6481)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
Conditional jump or move depends on uninitialised value(s)
at 0x........: handle_compress (origin5-bz2.c:4686)
@@ -9,85 +9,91 @@
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: handle_compress (origin5-bz2.c:4686)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
+Use of uninitialised value of size 4
at 0x........: handle_compress (origin5-bz2.c:4686)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
- at 0x........: BZ2_blockSort (origin5-bz2.c:2820)
+Use of uninitialised value of size 4
+ at 0x........: mainSort (origin5-bz2.c:2820)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
- at 0x........: BZ2_blockSort (origin5-bz2.c:2823)
+Use of uninitialised value of size 4
+ at 0x........: mainSort (origin5-bz2.c:2823)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
- at 0x........: BZ2_blockSort (origin5-bz2.c:2854)
+Use of uninitialised value of size 4
+ at 0x........: mainSort (origin5-bz2.c:2854)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
- at 0x........: BZ2_blockSort (origin5-bz2.c:2858)
+Use of uninitialised value of size 4
+ at 0x........: mainSort (origin5-bz2.c:2858)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
by 0x........: handle_compress (origin5-bz2.c:4753)
by 0x........: BZ2_bzCompress (origin5-bz2.c:4822)
by 0x........: BZ2_bzBuffToBuffCompress (origin5-bz2.c:5630)
by 0x........: main (origin5-bz2.c:6484)
Uninitialised value was created by a client request
- at 0x........: main (origin5-bz2.c:6481)
+ at 0x........: main (origin5-bz2.c:6479)
-Use of uninitialised value of size 8
- at 0x........: BZ2_blockSort (origin5-bz2.c:2963)
+Use of uninitialised value of size 4
+ at 0x........: mainSort (origin5-bz2.c:2963)
+ by 0x........: BZ2_blockSort (origin5-bz2.c:3105)
by 0x........: BZ2_compressBlock (origin5-bz2.c:4034)
<truncated beyond 100 lines>
=================================================
./valgrind/none/tests/linux/mremap2.stdout.diff
=================================================
--- mremap2.stdout.exp 2009-04-24 03:23:51.000000000 +1000
+++ mremap2.stdout.out 2009-04-24 03:34:08.000000000 +1000
@@ -27,38 +27,38 @@
..................................................
..................................................
-maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
@@ -173,40 +173,40 @@
..................................................
..................................................
-maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXX.............................
..................................................
-maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXX.............................
..................................................
-maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....................
..................................................
-maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....................
..................................................
-maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................
<truncated beyond 100 lines>
=================================================
./valgrind/none/tests/linux/mremap2.stdout.diff-glibc28-amd64
=================================================
--- mremap2.stdout.exp-glibc28-amd64 2009-04-24 03:23:51.000000000 +1000
+++ mremap2.stdout.out 2009-04-24 03:34:08.000000000 +1000
@@ -176,49 +176,49 @@
maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXX.............................
..................................................
maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXX.............................
..................................................
maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....................
..................................................
maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....................
..................................................
maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................
..................................................
maymv 1 fixed 0 newsz 30 dstpo 1 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................
..................................................
maymv 1 fixed 0 newsz 31 dstpo 0 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................
..................................................
maymv 1 fixed 0 newsz 31 dstpo 1 dst 0x........ -> 0x........ (== other)
XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...................
..................................................
=================================================
./valgrind/none/tests/linux/mremap2.stdout.diff2
=================================================
--- mremap2.stdout.exp2 2009-04-24 03:23:51.000000000 +1000
+++ mremap2.stdout.out 2009-04-24 03:34:08.000000000 +1000
@@ -27,38 +27,38 @@
..................................................
..................................................
-maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
-maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> error 12
+XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..................................................
..................................................
@@ -173,52 +173,52 @@
..................................................
..................................................
-maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXX.............................
..................................................
-maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX
+maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXX.............................
..................................................
-maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....................
..................................................
-maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX
+maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....................
..................................................
-maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src)
-XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== other)
+XXXXXXXXX...............................XXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-..................................................
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....................
<truncated beyond 100 lines>
=================================================
./valgrind/none/tests/shell.stderr.diff
=================================================
--- shell.stderr.exp 2009-04-24 03:23:57.000000000 +1000
+++ shell.stderr.out 2009-04-24 03:34:24.000000000 +1000
@@ -1,8 +1 @@
-./shell: ./x86/: is a directory
-./shell: ./shell.vgtest: Permission denied
-execve(0x........(./shell_badinterp), 0x........, 0x........) failed, errno 2
-EXEC FAILED: I can't recover from execve() failing, so I'm dying.
-Add more stringent tests in PRE(sys_execve), or work out how to recover.
-./shell: ./shell_binaryfile: cannot execute binary file
-./shell: ./shell_nosuchfile: No such file or directory
-./shell: shell_nosuchfile: command not found
+valgrind: failed to start tool 'none' for platform 'amd64-linux': No such file or directory
=================================================
./valgrind/none/tests/shell.stderr.diff-dash
=================================================
--- shell.stderr.exp-dash 2009-04-24 03:23:57.000000000 +1000
+++ shell.stderr.out 2009-04-24 03:34:24.000000000 +1000
@@ -1,8 +1 @@
-./shell: 10: ./x86/: Permission denied
-./shell: 13: ./shell.vgtest: Permission denied
-execve(0x........(./shell_badinterp), 0x........, 0x........) failed, errno 2
-EXEC FAILED: I can't recover from execve() failing, so I'm dying.
-Add more stringent tests in PRE(sys_execve), or work out how to recover.
-./shell_binaryfile: 4: Syntax error: ")" unexpected
-./shell: 22: ./shell_nosuchfile: not found
-./shell: 25: shell_nosuchfile: not found
+valgrind: failed to start tool 'none' for platform 'amd64-linux': No such file or directory
=================================================
./valgrind/none/tests/shell.stdout.diff
=================================================
--- shell.stdout.exp 2009-04-24 03:23:57.000000000 +1000
+++ shell.stdout.out 2009-04-24 03:34:24.000000000 +1000
@@ -1,10 +0,0 @@
-Execute a directory
-Execute a non-executable file
-Execute a script with a bad interpreter name
-Execute a binary file
-Execute a non-existent file
-Execute a non-existent file (2)
-Execute a valid script with a #! line
-Execute a valid script without a #! line
-Execute a valid script with #! but no interpname
-Execute a zero-length file
=================================================
./valgrind/none/tests/shell_valid1.stderr.diff
=================================================
--- shell_valid1.stderr.exp 2009-04-24 03:23:57.000000000 +1000
+++ shell_valid1.stderr.out 2009-04-24 03:34:24.000000000 +1000
@@ -0,0 +1 @@
+valgrind: failed to start tool 'none' for platform 'amd64-linux': No such file or directory
=================================================
./valgrind/none/tests/shell_valid2.stderr.diff
=================================================
--- shell_valid2.stderr.exp 2009-04-24 03:23:57.000000000 +1000
+++ shell_valid2.stderr.out 2009-04-24 03:34:24.000000000 +1000
@@ -0,0 +1,2 @@
+valgrind: wrong ELF executable class (eg. 32-bit instead of 64-bit)
+valgrind: ./shell_valid2: bad interpreter (/bin/sh): VG_(strerror): unknown error
=================================================
./valgrind/none/tests/shell_valid3.stderr.diff
=================================================
--- shell_valid3.stderr.exp 2009-04-24 03:23:57.000000000 +1000
+++ shell_valid3.stderr.out 2009-04-24 03:34:24.000000000 +1000
@@ -0,0 +1,2 @@
+valgrind: wrong ELF executable class (eg. 32-bit instead of 64-bit)
+valgrind: ./shell_valid3: bad interpreter (/bin/sh): VG_(strerror): unknown error
|
|
From: <sv...@va...> - 2009-04-23 17:23:35
|
Author: bart
Date: 2009-04-23 18:23:24 +0100 (Thu, 23 Apr 2009)
New Revision: 9592
Log:
Removed an unused variable.
Modified:
branches/VALGRIND_3_4_BRANCH/drd/drd_pthread_intercepts.c
Modified: branches/VALGRIND_3_4_BRANCH/drd/drd_pthread_intercepts.c
===================================================================
--- branches/VALGRIND_3_4_BRANCH/drd/drd_pthread_intercepts.c 2009-04-23 17:13:28 UTC (rev 9591)
+++ branches/VALGRIND_3_4_BRANCH/drd/drd_pthread_intercepts.c 2009-04-23 17:23:24 UTC (rev 9592)
@@ -283,7 +283,6 @@
pthread_t *thread, const pthread_attr_t *attr,
void *(*start) (void *), void *arg)
{
- int res;
int ret;
OrigFn fn;
VgPosixThreadArgs vgargs;
|
|
From: Michael S. <ms...@xi...> - 2009-04-23 17:14:50
|
On Wed, Apr 22, 2009 at 8:52 PM, Nicholas Nethercote <n.n...@gm...> wrote: > So it looks like the thread stacks are 8MB, which seems rather large > -- I thought the main stack was typically something like that size, > but that thread stacks were much smaller, maybe 64KB or something? Thread stacks on linux default to 8MB. Which is absurdly large, but that's ok. I wouldn't think it likely that that would have changed system-wide - it's been the default for many years. Mike |
|
From: <sv...@va...> - 2009-04-23 17:13:45
|
Author: bart
Date: 2009-04-23 18:13:28 +0100 (Thu, 23 Apr 2009)
New Revision: 9591
Log:
Merged r9590 from trunk.
Modified:
branches/VALGRIND_3_4_BRANCH/drd/drd_thread.c
Modified: branches/VALGRIND_3_4_BRANCH/drd/drd_thread.c
===================================================================
--- branches/VALGRIND_3_4_BRANCH/drd/drd_thread.c 2009-04-23 17:12:39 UTC (rev 9590)
+++ branches/VALGRIND_3_4_BRANCH/drd/drd_thread.c 2009-04-23 17:13:28 UTC (rev 9591)
@@ -331,11 +331,19 @@
s_threadinfo[tid].synchr_nesting = 0;
}
+/**
+ * Store the POSIX thread ID for the specified thread.
+ *
+ * @note This function can be called two times for the same thread -- see also
+ * the comment block preceding the pthread_create() wrapper in
+ * drd_pthread_intercepts.c.
+ */
void thread_set_pthreadid(const DrdThreadId tid, const PThreadId ptid)
{
tl_assert(0 <= (int)tid && tid < DRD_N_THREADS
&& tid != DRD_INVALID_THREADID);
- tl_assert(s_threadinfo[tid].pt_threadid == INVALID_POSIX_THREADID);
+ tl_assert(s_threadinfo[tid].pt_threadid == INVALID_POSIX_THREADID
+ || s_threadinfo[tid].pt_threadid == ptid);
tl_assert(ptid != INVALID_POSIX_THREADID);
s_threadinfo[tid].posix_thread_exists = True;
s_threadinfo[tid].pt_threadid = ptid;
|
|
From: <sv...@va...> - 2009-04-23 17:12:43
|
Author: bart
Date: 2009-04-23 18:12:39 +0100 (Thu, 23 Apr 2009)
New Revision: 9590
Log:
Made DRD_(thread_set_pthreadid)() idempotent.
Modified:
trunk/drd/drd_thread.c
Modified: trunk/drd/drd_thread.c
===================================================================
--- trunk/drd/drd_thread.c 2009-04-23 15:42:27 UTC (rev 9589)
+++ trunk/drd/drd_thread.c 2009-04-23 17:12:39 UTC (rev 9590)
@@ -451,12 +451,19 @@
DRD_(g_threadinfo)[tid].synchr_nesting = 0;
}
-/** Store the POSIX thread ID for the specified thread. */
+/**
+ * Store the POSIX thread ID for the specified thread.
+ *
+ * @note This function can be called two times for the same thread -- see also
+ * the comment block preceding the pthread_create() wrapper in
+ * drd_pthread_intercepts.c.
+ */
void DRD_(thread_set_pthreadid)(const DrdThreadId tid, const PThreadId ptid)
{
tl_assert(0 <= (int)tid && tid < DRD_N_THREADS
&& tid != DRD_INVALID_THREADID);
- tl_assert(DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID);
+ tl_assert(DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID
+ || DRD_(g_threadinfo)[tid].pt_threadid == ptid);
tl_assert(ptid != INVALID_POSIX_THREADID);
DRD_(g_threadinfo)[tid].posix_thread_exists = True;
DRD_(g_threadinfo)[tid].pt_threadid = ptid;
|
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 16:43:56
|
Nightly build on ocean ( Ubuntu 8.10, Intel x86-64 ) started at 2009-04-24 02:00:01 EST 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 == 483 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) ================================================= ./valgrind/none/tests/linux/mremap2.stdout.diff ================================================= --- mremap2.stdout.exp 2009-04-24 02:28:19.000000000 +1000 +++ mremap2.stdout.out 2009-04-24 02:43:02.000000000 +1000 @@ -27,38 +27,38 @@ .................................................. .................................................. -maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. @@ -173,40 +173,40 @@ .................................................. .................................................. -maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXX............................. .................................................. -maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXX............................. .................................................. -maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... .................................................. -maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... .................................................. -maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... <truncated beyond 100 lines> ================================================= ./valgrind/none/tests/linux/mremap2.stdout.diff-glibc28-amd64 ================================================= --- mremap2.stdout.exp-glibc28-amd64 2009-04-24 02:28:19.000000000 +1000 +++ mremap2.stdout.out 2009-04-24 02:43:02.000000000 +1000 @@ -176,49 +176,49 @@ maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXX............................. .................................................. maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXX............................. .................................................. maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... .................................................. maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... .................................................. maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... .................................................. maymv 1 fixed 0 newsz 30 dstpo 1 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... .................................................. maymv 1 fixed 0 newsz 31 dstpo 0 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... .................................................. maymv 1 fixed 0 newsz 31 dstpo 1 dst 0x........ -> 0x........ (== other) XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX................... .................................................. ================================================= ./valgrind/none/tests/linux/mremap2.stdout.diff2 ================================================= --- mremap2.stdout.exp2 2009-04-24 02:28:19.000000000 +1000 +++ mremap2.stdout.out 2009-04-24 02:43:02.000000000 +1000 @@ -27,38 +27,38 @@ .................................................. .................................................. -maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 0 fixed 0 newsz 21 dstpo 0 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 0 fixed 0 newsz 21 dstpo 1 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 0 fixed 0 newsz 29 dstpo 0 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 0 fixed 0 newsz 29 dstpo 1 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +maymv 0 fixed 0 newsz 30 dstpo 0 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. -maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +maymv 0 fixed 0 newsz 30 dstpo 1 dst 0x........ -> error 12 +XXXXXXXXX.XXXXXXXXXXXXXXXXXXXX..........XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .................................................. .................................................. @@ -173,52 +173,52 @@ .................................................. .................................................. -maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 1 fixed 0 newsz 21 dstpo 0 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXX............................. .................................................. -maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX.........XXXXXXXXXX +maymv 1 fixed 0 newsz 21 dstpo 1 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXX............................. .................................................. -maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 1 fixed 0 newsz 29 dstpo 0 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... .................................................. -maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXX +maymv 1 fixed 0 newsz 29 dstpo 1 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..................... .................................................. -maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== src) -XXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +maymv 1 fixed 0 newsz 30 dstpo 0 dst 0x........ -> 0x........ (== other) +XXXXXXXXX...............................XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -.................................................. +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.................... <truncated beyond 100 lines> |
|
From: <sv...@va...> - 2009-04-23 15:42:38
|
Author: bart
Date: 2009-04-23 16:42:27 +0100 (Thu, 23 Apr 2009)
New Revision: 9589
Log:
Optimized the functions for clearing bits in bitmaps.
Modified:
trunk/drd/drd_bitmap.c
trunk/drd/drd_bitmap.h
Modified: trunk/drd/drd_bitmap.c
===================================================================
--- trunk/drd/drd_bitmap.c 2009-04-23 15:41:26 UTC (rev 9588)
+++ trunk/drd/drd_bitmap.c 2009-04-23 15:42:27 UTC (rev 9589)
@@ -461,47 +461,72 @@
for (b = a1; b < a2; b = b_next)
{
- struct bitmap2* const p2 = bm2_lookup_exclusive(bm, b >> ADDR0_BITS);
+ struct bitmap2ref* p2ref;
+ struct bitmap2* p2;
+ Addr c;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b < a2);
+#endif
+
+ p2ref = bm2_lookup_next_exclusive(bm, b >> ADDR0_BITS);
+ if (p2ref == 0)
+ break;
+
+ p2 = p2ref->bm2;
+
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(p2ref->addr >= (b >> ADDR0_BITS));
+#endif
+ b = p2ref->addr << ADDR0_BITS;
+ if (b < a1)
+ b = a1;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b);
+#endif
+ if (b >= a2)
+ break;
+
b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
if (b_next > a2)
{
b_next = a2;
}
- if (p2)
+ c = b;
+ /* If the first address in the bitmap that must be cleared does not */
+ /* start on an UWord boundary, start clearing the first addresses. */
+ if (UWORD_LSB(c))
{
- Addr c = b;
- /* If the first address in the bitmap that must be cleared does not */
- /* start on an UWord boundary, start clearing the first addresses. */
- if (UWORD_LSB(c))
- {
- Addr c_next = UWORD_MSB(c) + BITS_PER_UWORD;
- if (c_next > b_next)
- c_next = b_next;
- bm0_clear_range(p2->bm1.bm0_r, c & ADDR0_MASK, c_next - c);
- bm0_clear_range(p2->bm1.bm0_w, c & ADDR0_MASK, c_next - c);
- c = c_next;
- }
- /* If some UWords have to be cleared entirely, do this now. */
- if (UWORD_LSB(c) == 0)
- {
- const Addr c_next = UWORD_MSB(b_next);
- tl_assert(UWORD_LSB(c) == 0);
- tl_assert(UWORD_LSB(c_next) == 0);
- tl_assert(c_next <= b_next);
- tl_assert(c <= c_next);
- if (c_next > c)
- {
- UWord idx = (c & ADDR0_MASK) >> BITS_PER_BITS_PER_UWORD;
- VG_(memset)(&p2->bm1.bm0_r[idx], 0, (c_next - c) / 8);
- VG_(memset)(&p2->bm1.bm0_w[idx], 0, (c_next - c) / 8);
- c = c_next;
- }
- }
- /* If the last address in the bitmap that must be cleared does not */
- /* fall on an UWord boundary, clear the last addresses. */
- /* tl_assert(c <= b_next); */
+ Addr c_next = UWORD_MSB(c) + BITS_PER_UWORD;
+ if (c_next > b_next)
+ c_next = b_next;
+ bm0_clear_range(p2->bm1.bm0_r, c & ADDR0_MASK, c_next - c);
+ bm0_clear_range(p2->bm1.bm0_w, c & ADDR0_MASK, c_next - c);
+ c = c_next;
+ }
+ /* If some UWords have to be cleared entirely, do this now. */
+ if (UWORD_LSB(c) == 0)
+ {
+ const Addr c_next = UWORD_MSB(b_next);
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(UWORD_LSB(c) == 0);
+ tl_assert(UWORD_LSB(c_next) == 0);
+ tl_assert(c_next <= b_next);
+ tl_assert(c <= c_next);
+#endif
+ if (c_next > c)
+ {
+ UWord idx = (c & ADDR0_MASK) >> BITS_PER_BITS_PER_UWORD;
+ VG_(memset)(&p2->bm1.bm0_r[idx], 0, (c_next - c) / 8);
+ VG_(memset)(&p2->bm1.bm0_w[idx], 0, (c_next - c) / 8);
+ c = c_next;
+ }
+ }
+ /* If the last address in the bitmap that must be cleared does not */
+ /* fall on an UWord boundary, clear the last addresses. */
+ if (c < b_next)
+ {
bm0_clear_range(p2->bm1.bm0_r, c & ADDR0_MASK, b_next - c);
bm0_clear_range(p2->bm1.bm0_w, c & ADDR0_MASK, b_next - c);
}
@@ -514,15 +539,93 @@
*/
void DRD_(bm_clear_load)(struct bitmap* const bm, const Addr a1, const Addr a2)
{
- Addr a;
+ Addr b, b_next;
- for (a = a1; a < a2; a++)
+ tl_assert(bm);
+ tl_assert(a1);
+ tl_assert(a1 <= a2);
+
+ for (b = a1; b < a2; b = b_next)
{
- struct bitmap2* const p2 = bm2_lookup_exclusive(bm, a >> ADDR0_BITS);
- if (p2)
+ struct bitmap2ref* p2ref;
+ struct bitmap2* p2;
+ Addr c;
+
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b < a2);
+#endif
+
+ p2ref = bm2_lookup_next_exclusive(bm, b >> ADDR0_BITS);
+ if (p2ref == 0)
+ break;
+
+ p2 = p2ref->bm2;
+
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(p2ref->addr >= (b >> ADDR0_BITS));
+#endif
+ b = p2ref->addr << ADDR0_BITS;
+ if (b < a1)
+ b = a1;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b);
+#endif
+ if (b >= a2)
+ break;
+
+ b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
+ if (b_next > a2)
{
- bm0_clear(p2->bm1.bm0_r, a & ADDR0_MASK);
+ b_next = a2;
}
+
+ c = b;
+ /* If the first address in the bitmap that must be cleared does not */
+ /* start on an UWord boundary, start clearing the first addresses. */
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c < b_next && b_next <= a2);
+#endif
+ if (UWORD_LSB(c))
+ {
+ Addr c_next = UWORD_MSB(c) + BITS_PER_UWORD;
+ if (c_next > b_next)
+ c_next = b_next;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c < c_next && c_next <= b_next
+ && b_next <= a2);
+#endif
+ bm0_clear_range(p2->bm1.bm0_r, c & ADDR0_MASK, c_next - c);
+ c = c_next;
+ }
+ /* If some UWords have to be cleared entirely, do this now. */
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c <= b_next && b_next <= a2);
+#endif
+ if (UWORD_LSB(c) == 0)
+ {
+ const Addr c_next = UWORD_MSB(b_next);
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(UWORD_LSB(c) == 0);
+ tl_assert(UWORD_LSB(c_next) == 0);
+ tl_assert(a1 <= b && b <= c && c <= c_next && c_next <= b_next
+ && b_next <= a2);
+#endif
+ if (c_next > c)
+ {
+ UWord idx = (c & ADDR0_MASK) >> BITS_PER_BITS_PER_UWORD;
+ VG_(memset)(&p2->bm1.bm0_r[idx], 0, (c_next - c) / 8);
+ c = c_next;
+ }
+ }
+ /* If the last address in the bitmap that must be cleared does not */
+ /* fall on an UWord boundary, clear the last addresses. */
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c <= b_next && b_next <= a2);
+#endif
+ if (c < b_next)
+ {
+ bm0_clear_range(p2->bm1.bm0_r, c & ADDR0_MASK, b_next - c);
+ }
}
}
@@ -533,15 +636,93 @@
void DRD_(bm_clear_store)(struct bitmap* const bm,
const Addr a1, const Addr a2)
{
- Addr a;
+ Addr b, b_next;
- for (a = a1; a < a2; a++)
+ tl_assert(bm);
+ tl_assert(a1);
+ tl_assert(a1 <= a2);
+
+ for (b = a1; b < a2; b = b_next)
{
- struct bitmap2* const p2 = bm2_lookup_exclusive(bm, a >> ADDR0_BITS);
- if (p2)
+ struct bitmap2ref* p2ref;
+ struct bitmap2* p2;
+ Addr c;
+
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b < a2);
+#endif
+
+ p2ref = bm2_lookup_next_exclusive(bm, b >> ADDR0_BITS);
+ if (p2ref == 0)
+ break;
+
+ p2 = p2ref->bm2;
+
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(p2ref->addr >= (b >> ADDR0_BITS));
+#endif
+ b = p2ref->addr << ADDR0_BITS;
+ if (b < a1)
+ b = a1;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b);
+#endif
+ if (b >= a2)
+ break;
+
+ b_next = (b & ~ADDR0_MASK) + ADDR0_COUNT;
+ if (b_next > a2)
{
- bm0_clear(p2->bm1.bm0_w, a & ADDR0_MASK);
+ b_next = a2;
}
+
+ c = b;
+ /* If the first address in the bitmap that must be cleared does not */
+ /* start on an UWord boundary, start clearing the first addresses. */
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c < b_next && b_next <= a2);
+#endif
+ if (UWORD_LSB(c))
+ {
+ Addr c_next = UWORD_MSB(c) + BITS_PER_UWORD;
+ if (c_next > b_next)
+ c_next = b_next;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c < c_next && c_next <= b_next
+ && b_next <= a2);
+#endif
+ bm0_clear_range(p2->bm1.bm0_w, c & ADDR0_MASK, c_next - c);
+ c = c_next;
+ }
+ /* If some UWords have to be cleared entirely, do this now. */
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c <= b_next && b_next <= a2);
+#endif
+ if (UWORD_LSB(c) == 0)
+ {
+ const Addr c_next = UWORD_MSB(b_next);
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(UWORD_LSB(c) == 0);
+ tl_assert(UWORD_LSB(c_next) == 0);
+ tl_assert(a1 <= b && b <= c && c <= c_next && c_next <= b_next
+ && b_next <= a2);
+#endif
+ if (c_next > c)
+ {
+ UWord idx = (c & ADDR0_MASK) >> BITS_PER_BITS_PER_UWORD;
+ VG_(memset)(&p2->bm1.bm0_w[idx], 0, (c_next - c) / 8);
+ c = c_next;
+ }
+ }
+ /* If the last address in the bitmap that must be cleared does not */
+ /* fall on an UWord boundary, clear the last addresses. */
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(a1 <= b && b <= c && c <= b_next && b_next <= a2);
+#endif
+ if (c < b_next)
+ {
+ bm0_clear_range(p2->bm1.bm0_w, c & ADDR0_MASK, b_next - c);
+ }
}
}
Modified: trunk/drd/drd_bitmap.h
===================================================================
--- trunk/drd/drd_bitmap.h 2009-04-23 15:41:26 UTC (rev 9588)
+++ trunk/drd/drd_bitmap.h 2009-04-23 15:42:27 UTC (rev 9589)
@@ -428,6 +428,41 @@
return bm2;
}
+/** Look up the first address in bitmap bm that is greater than or equal to
+ * a1 and return a pointer to a second level bitmap that is not shared and
+ * hence may be modified.
+ *
+ * @param a1 client address shifted right by ADDR0_BITS.
+ * @param bm bitmap pointer.
+ */
+static __inline__
+struct bitmap2ref*
+bm2_lookup_next_exclusive(struct bitmap* const bm, const UWord a1)
+{
+ struct bitmap2ref* bm2ref;
+ struct bitmap2* bm2;
+
+ bm2ref = 0;
+ bm2 = 0;
+
+ VG_(OSetGen_ResetIterAt)(bm->oset, &a1);
+ bm2ref = VG_(OSetGen_Next)(bm->oset);
+
+ if (bm2ref)
+ {
+ bm2 = bm2ref->bm2;
+ if (bm2->refcnt > 1)
+ {
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+ tl_assert(bm2ref);
+#endif
+ bm2 = bm2_make_exclusive(*(struct bitmap**)&bm, bm2ref);
+ }
+ }
+
+ return bm2ref;
+}
+
/** Look up the address a1 in bitmap bm. The returned second level bitmap has
* reference count one and hence may be modified.
*
|
|
From: <sv...@va...> - 2009-04-23 15:41:33
|
Author: bart
Date: 2009-04-23 16:41:26 +0100 (Thu, 23 Apr 2009)
New Revision: 9588
Log:
Fixed bug in bm0_clear_range() that caused this fucntion to clear more bits than it should clear.
Modified:
trunk/drd/drd_bitmap.h
Modified: trunk/drd/drd_bitmap.h
===================================================================
--- trunk/drd/drd_bitmap.h 2009-04-23 15:39:46 UTC (rev 9587)
+++ trunk/drd/drd_bitmap.h 2009-04-23 15:41:26 UTC (rev 9588)
@@ -142,7 +142,7 @@
tl_assert(UWORD_MSB(a1) == UWORD_MSB(a1 + size - 1));
#endif
bm0[a1 >> BITS_PER_BITS_PER_UWORD]
- &= ~(((UWord)1 << size) - 1) << UWORD_LSB(a1);
+ &= ~((((UWord)1 << size) - 1) << UWORD_LSB(a1));
}
static __inline__ UWord bm0_is_set(const UWord* bm0, const Addr a)
|
|
From: <sv...@va...> - 2009-04-23 15:39:59
|
Author: bart
Date: 2009-04-23 16:39:46 +0100 (Thu, 23 Apr 2009)
New Revision: 9587
Log:
- Added more tests.
- Extended error reporting.
Modified:
trunk/drd/tests/drd_bitmap_test.c
Modified: trunk/drd/tests/drd_bitmap_test.c
===================================================================
--- trunk/drd/tests/drd_bitmap_test.c 2009-04-23 11:50:16 UTC (rev 9586)
+++ trunk/drd/tests/drd_bitmap_test.c 2009-04-23 15:39:46 UTC (rev 9587)
@@ -66,6 +66,28 @@
#endif
};
+/**
+ * Compare two bitmaps and if different, print the differences.
+ */
+int bm_equal_print_diffs(struct bitmap* bm1, struct bitmap* bm2)
+{
+ int equal;
+
+ equal = DRD_(bm_equal)(bm1, bm2);
+ if (! equal)
+ {
+ VG_(printf)("Bitmaps are different.\n");
+ VG_(printf)("Bitmap 1:\n");
+ DRD_(bm_print)(bm1);
+ VG_(printf)("\n");
+ VG_(printf)("Bitmap 2:\n");
+ DRD_(bm_print)(bm2);
+ VG_(printf)("\n");
+ }
+
+ return equal;
+}
+
void bm_test1(void)
{
struct bitmap* bm;
@@ -106,7 +128,7 @@
if (s_verbose)
DRD_(bm_print)(bm2);
//assert(bm_equal(bm, bm2));
- assert(DRD_(bm_equal)(bm2, bm));
+ assert(bm_equal_print_diffs(bm2, bm));
if (s_verbose)
VG_(printf)("Deleting bitmap bm\n");
@@ -158,34 +180,56 @@
{
DRD_(bm_access_range_load)(bm1, i, j);
DRD_(bm_clear_load)(bm1, i, j);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_load_1)(bm1, i);
DRD_(bm_clear_load)(bm1, i, i+1);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_load_2)(bm1, i);
DRD_(bm_clear_load)(bm1, i, i+2);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_load_4)(bm1, i);
DRD_(bm_clear_load)(bm1, i, i+4);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_load_8)(bm1, i);
DRD_(bm_clear_load)(bm1, i, i+8);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
+
DRD_(bm_access_range_store)(bm1, i, j);
DRD_(bm_clear_store)(bm1, i, j);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_store_1)(bm1, i);
DRD_(bm_clear_store)(bm1, i, i + 1);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_store_2)(bm1, i);
DRD_(bm_clear_store)(bm1, i, i + 2);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_store_4)(bm1, i);
DRD_(bm_clear_store)(bm1, i, i + 4);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_access_store_8)(bm1, i);
DRD_(bm_clear_store)(bm1, i, i + 8);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
+
+ DRD_(bm_access_range_load)(bm1, i, j);
+ DRD_(bm_access_range_store)(bm1, i, j);
+ DRD_(bm_clear)(bm1, i, j);
+ assert(bm_equal_print_diffs(bm1, bm2));
+ DRD_(bm_access_load_1)(bm1, i);
+ DRD_(bm_access_store_1)(bm1, i);
+ DRD_(bm_clear)(bm1, i, i+1);
+ assert(bm_equal_print_diffs(bm1, bm2));
+ DRD_(bm_access_load_2)(bm1, i);
+ DRD_(bm_access_store_2)(bm1, i);
+ DRD_(bm_clear)(bm1, i, i+2);
+ assert(bm_equal_print_diffs(bm1, bm2));
+ DRD_(bm_access_load_4)(bm1, i);
+ DRD_(bm_access_store_4)(bm1, i);
+ DRD_(bm_clear)(bm1, i, i+4);
+ assert(bm_equal_print_diffs(bm1, bm2));
+ DRD_(bm_access_load_8)(bm1, i);
+ DRD_(bm_access_store_8)(bm1, i);
+ DRD_(bm_clear)(bm1, i, i+8);
+ assert(bm_equal_print_diffs(bm1, bm2));
}
}
DRD_(bm_access_range_load)(bm1, 0, 2 * ADDR0_COUNT + 2 * BITS_PER_UWORD);
@@ -200,34 +244,34 @@
{
DRD_(bm_clear_load)(bm1, i, j);
DRD_(bm_access_range_load)(bm1, i, j);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_load)(bm1, i, i+1);
DRD_(bm_access_load_1)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_load)(bm1, i, i+2);
DRD_(bm_access_load_2)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_load)(bm1, i, i+4);
DRD_(bm_access_load_4)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_load)(bm1, i, i+8);
DRD_(bm_access_load_8)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_store)(bm1, i, j);
DRD_(bm_access_range_store)(bm1, i, j);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_store)(bm1, i, i+1);
DRD_(bm_access_store_1)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_store)(bm1, i, i+2);
DRD_(bm_access_store_2)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_store)(bm1, i, i+4);
DRD_(bm_access_store_4)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
DRD_(bm_clear_store)(bm1, i, i+8);
DRD_(bm_access_store_8)(bm1, i);
- assert(DRD_(bm_equal)(bm1, bm2));
+ assert(bm_equal_print_diffs(bm1, bm2));
}
}
DRD_(bm_delete)(bm2);
|
|
From: <sv...@va...> - 2009-04-23 11:50:22
|
Author: sewardj
Date: 2009-04-23 12:50:16 +0100 (Thu, 23 Apr 2009)
New Revision: 9586
Log:
Major rewrite of readmacho.c:
* tidy up management of fat/thin image pointers; generally makes
the logic easier to follow.
* add UUID checking, so we don't read out of date .dSYM info
* remove ability to read stabs-format info for Darwin; apparently
stabs is deprecated
* add a new flag, --auto-run-dsymutil=no|yes [no].
if --auto-run-dsymutil=yes and the dSYM is either missing or has
non-matching UUID, Valgrind automatically runs dsymutil on the
object. Skips system libraries etc.
if --auto-run-dsymutil=no (the default) and the dSYM is either
missing or has non-matching UUID, Valgrind does nothing, but does
print a message to that effect and says "consider using
--auto-run-dsymutil=yes".
Net effect is, you can just build/link code with -g, and not bother
with running dsymutil as part of your build process, because
--auto-run-dsymutil=yes will do it as/when required by Valgrind.
Modified:
branches/DARWIN/Makefile.am
branches/DARWIN/auxprogs/Makefile.am
branches/DARWIN/coregrind/Makefile.am
branches/DARWIN/coregrind/m_debuginfo/readmacho.c
branches/DARWIN/coregrind/m_main.c
branches/DARWIN/coregrind/m_options.c
branches/DARWIN/coregrind/pub_core_options.h
Modified: branches/DARWIN/Makefile.am
===================================================================
--- branches/DARWIN/Makefile.am 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/Makefile.am 2009-04-23 11:50:16 UTC (rev 9586)
@@ -112,6 +112,8 @@
distclean-local:
rm -rf $(inplacedir)
+clean-local:
+ rm -rf .in_place/*.dSYM
# These list the bits of vex we need to install
Modified: branches/DARWIN/auxprogs/Makefile.am
===================================================================
--- branches/DARWIN/auxprogs/Makefile.am 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/auxprogs/Makefile.am 2009-04-23 11:50:16 UTC (rev 9586)
@@ -124,8 +124,9 @@
## cleanery
clean-local:
rm -f libmpiwrap-.c \
- libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c \
- libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c
+ libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.c \
+ libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.c
+ rm -rf libmpiwrap-*.dSYM
#
#----------------------------------------------------------
Modified: branches/DARWIN/coregrind/Makefile.am
===================================================================
--- branches/DARWIN/coregrind/Makefile.am 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/coregrind/Makefile.am 2009-04-23 11:50:16 UTC (rev 9586)
@@ -42,6 +42,7 @@
noinst_PROGRAMS =
pkglib_LIBRARIES =
LIBVEX =
+DSYMUTIL_ME_TOO =
if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
noinst_PROGRAMS += vgpreload_core-x86-linux.so
@@ -83,12 +84,14 @@
noinst_PROGRAMS += vgpreload_core-x86-darwin.so
pkglib_LIBRARIES += libcoregrind-x86-darwin.a libreplacemalloc_toolpreload-x86-darwin.a
LIBVEX += libvex-x86-darwin.a
+DSYMUTIL_ME_TOO += vgpreload_core-x86-darwin.so
endif
if VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN
noinst_PROGRAMS += vgpreload_core-amd64-darwin.so
pkglib_LIBRARIES += libcoregrind-amd64-darwin.a libreplacemalloc_toolpreload-amd64-darwin.a
LIBVEX += libvex-amd64-darwin.a
+DSYMUTIL_ME_TOO += vgpreload_core-amd64-darwin.so
endif
@@ -367,8 +370,8 @@
m_debuginfo/readpdb.c \
m_mach/mach_vmUser.c \
m_mach/taskUser.c \
- m_mach/thread_actUser.c \
- m_mach/vm_mapUser.c \
+ m_mach/thread_actUser.c \
+ m_mach/vm_mapUser.c \
m_mach/mach_basics.c \
m_mach/mach_msg.c \
m_initimg/initimg-darwin.c \
@@ -584,10 +587,15 @@
vgpreload_core_amd64_darwin_so_LDFLAGS = $(PRELOAD_LDFLAGS_AMD64_DARWIN)
all-local: inplace-noinst_PROGRAMS
+ for f in $(DSYMUTIL_ME_TOO); do \
+ echo "dsymutil $$f"; \
+ dsymutil $$f; \
+ done
clean-local:
$(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" clean
rm -f $(mach_srcs) $(mach_server_srcs) $(mach_hdrs)
+ rm -rf vgpreload_core-*.dSYM
# Nb: The loop installs the libvex library for possible use by standalone
# tools.
Modified: branches/DARWIN/coregrind/m_debuginfo/readmacho.c
===================================================================
--- branches/DARWIN/coregrind/m_debuginfo/readmacho.c 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/coregrind/m_debuginfo/readmacho.c 2009-04-23 11:50:16 UTC (rev 9586)
@@ -77,14 +77,242 @@
#endif
-Bool ML_(is_macho_object_file)( const void *buf, SizeT size )
+/*------------------------------------------------------------*/
+/*--- ---*/
+/*--- Mach-O file mapping/unmapping helpers ---*/
+/*--- ---*/
+/*------------------------------------------------------------*/
+
+typedef
+ struct {
+ /* These two describe the entire mapped-in ("primary") image,
+ fat headers, kitchen sink, whatnot: the entire file. The
+ image is mapped into img[0 .. img_szB-1]. */
+ UChar* img;
+ SizeT img_szB;
+ /* These two describe the Mach-O object of interest, which is
+ presumably somewhere inside the primary image.
+ map_image_aboard() below, which generates this info, will
+ carefully check that the macho_ fields denote a section of
+ memory that falls entirely inside img[0 .. img_szB-1]. */
+ UChar* macho_img;
+ SizeT macho_img_szB;
+ }
+ ImageInfo;
+
+
+Bool ML_(is_macho_object_file)( const void* buf, SizeT szB )
{
// GrP fixme Mach-O headers might not be in this mapped data
- // Assume it's Mach-O and let ML_(read_macho_debug_info) sort it out.
- return True;
+
+ /* (JRS: ... because we only mapped a page for this initial check,
+ or at least not very much, and what's at the start of the file
+ is in general a so-called fat header. The Mach-O object we're
+ interested in could be arbitrarily far along the image, and so
+ we can't assume its header will fall within this page.) */
+
+ /* But we can say that either it's a fat object, in which case it
+ begins with a fat header, or it's unadorned Mach-O, in which
+ case it starts with a normal header. At least do what checks we
+ can to establish whether or not we're looking at something
+ sane. */
+
+ const struct fat_header* fh_be = buf;
+ const struct MACH_HEADER* mh = buf;
+
+ vg_assert(buf);
+ if (szB < sizeof(struct fat_header))
+ return False;
+ if (VG_(ntohl)(fh_be->magic) == FAT_MAGIC)
+ return True;
+
+ if (szB < sizeof(struct MACH_HEADER))
+ return False;
+ if (mh->magic == MAGIC)
+ return True;
+
+ return False;
}
+/* Unmap an image mapped in by map_image_aboard. */
+static void unmap_image ( /*MOD*/ImageInfo* ii )
+{
+ SysRes sres;
+ vg_assert(ii->img);
+ vg_assert(ii->img_szB > 0);
+ sres = VG_(am_munmap_valgrind)( (Addr)ii->img, ii->img_szB );
+ /* Do we care if this fails? I suppose so; it would indicate
+ some fairly serious snafu with the mapping of the file. */
+ vg_assert( !sr_isError(sres) );
+ VG_(memset)(ii, 0, sizeof(*ii));
+}
+
+
+/* Map a given fat or thin object aboard, find the thin part if
+ necessary, do some checks, and write details of both the fat and
+ thin parts into *ii. Returns False (and leaves the file unmapped)
+ on failure. Guarantees to return pointers to a valid(ish) Mach-O
+ image if it succeeds. */
+static Bool map_image_aboard ( DebugInfo* di, /* only for err msgs */
+ /*OUT*/ImageInfo* ii, UChar* filename )
+{
+ VG_(memset)(ii, 0, sizeof(*ii));
+
+ /* First off, try to map the thing in. */
+ { SizeT size;
+ SysRes fd, sres;
+ struct vg_stat stat_buf;
+
+ fd = VG_(stat)(filename, &stat_buf);
+ if (sr_isError(fd)) {
+ ML_(symerr)(di, True, "Can't stat image (to determine its size)?!");
+ return False;
+ }
+ size = stat_buf.size;
+
+ fd = VG_(open)(filename, VKI_O_RDONLY, 0);
+ if (sr_isError(fd)) {
+ ML_(symerr)(di, True, "Can't open image to read symbols?!");
+ return False;
+ }
+
+ sres = VG_(am_mmap_file_float_valgrind)
+ ( size, VKI_PROT_READ, sr_Res(fd), 0 );
+ if (sr_isError(sres)) {
+ ML_(symerr)(di, True, "Can't mmap image to read symbols?!");
+ return False;
+ }
+
+ VG_(close)(sr_Res(fd));
+
+ ii->img = (UChar*)sr_Res(sres);
+ ii->img_szB = size;
+ }
+
+ /* Now it's mapped in and we have .img and .img_szB set. Look for
+ the embedded Mach-O object. If not findable, unmap and fail. */
+ { struct fat_header* fh_be;
+ struct fat_header fh;
+ struct MACH_HEADER* mh;
+
+ // Assume initially that we have a thin image, and update
+ // these if it turns out to be fat.
+ ii->macho_img = ii->img;
+ ii->macho_img_szB = ii->img_szB;
+
+ // Check for fat header.
+ if (ii->img_szB < sizeof(struct fat_header)) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (0 too small).");
+ goto unmap_and_fail;
+ }
+
+ // Fat header is always BIG-ENDIAN
+ fh_be = (struct fat_header *)ii->img;
+ fh.magic = VG_(ntohl)(fh_be->magic);
+ fh.nfat_arch = VG_(ntohl)(fh_be->nfat_arch);
+ if (fh.magic == FAT_MAGIC) {
+ // Look for a good architecture.
+ struct fat_arch *arch_be;
+ struct fat_arch arch;
+ Int f;
+ if (ii->img_szB < sizeof(struct fat_header)
+ + fh.nfat_arch * sizeof(struct fat_arch)) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (1 too small).");
+ goto unmap_and_fail;
+ }
+ for (f = 0, arch_be = (struct fat_arch *)(fh_be+1);
+ f < fh.nfat_arch;
+ f++, arch_be++) {
+ Int cputype;
+# if defined(VGA_ppc)
+ cputype = CPU_TYPE_POWERPC;
+# elif defined(VGA_ppc64)
+ cputype = CPU_TYPE_POWERPC64;
+# elif defined(VGA_x86)
+ cputype = CPU_TYPE_X86;
+# elif defined(VGA_amd64)
+ cputype = CPU_TYPE_X86_64;
+# else
+# error "unknown architecture"
+# endif
+ arch.cputype = VG_(ntohl)(arch_be->cputype);
+ arch.cpusubtype = VG_(ntohl)(arch_be->cpusubtype);
+ arch.offset = VG_(ntohl)(arch_be->offset);
+ arch.size = VG_(ntohl)(arch_be->size);
+ if (arch.cputype == cputype) {
+ if (ii->img_szB < arch.offset + arch.size) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (2 too small).");
+ goto unmap_and_fail;
+ }
+ ii->macho_img = ii->img + arch.offset;
+ ii->macho_img_szB = arch.size;
+ break;
+ }
+ }
+ if (f == fh.nfat_arch) {
+ ML_(symerr)(di, True,
+ "No acceptable architecture found in fat file.");
+ goto unmap_and_fail;
+ }
+ }
+
+ /* Sanity check what we found. */
+
+ /* assured by logic above */
+ vg_assert(ii->img_szB >= sizeof(struct fat_header));
+
+ if (ii->macho_img_szB < sizeof(struct MACH_HEADER)) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (3 too small).");
+ goto unmap_and_fail;
+ }
+
+ if (ii->macho_img_szB > ii->img_szB) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (thin bigger than fat).");
+ goto unmap_and_fail;
+ }
+
+ if (ii->macho_img >= ii->img
+ && ii->macho_img + ii->macho_img_szB <= ii->img + ii->img_szB) {
+ /* thin entirely within fat, as expected */
+ } else {
+ ML_(symerr)(di, True, "Invalid Mach-O file (thin not inside fat).");
+ goto unmap_and_fail;
+ }
+
+ mh = (struct MACH_HEADER *)ii->macho_img;
+ if (mh->magic != MAGIC) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (bad magic).");
+ goto unmap_and_fail;
+ }
+
+ if (ii->macho_img_szB < sizeof(struct MACH_HEADER) + mh->sizeofcmds) {
+ ML_(symerr)(di, True, "Invalid Mach-O file (4 too small).");
+ goto unmap_and_fail;
+ }
+ }
+
+ vg_assert(ii->img);
+ vg_assert(ii->macho_img);
+ vg_assert(ii->img_szB > 0);
+ vg_assert(ii->macho_img_szB > 0);
+ vg_assert(ii->macho_img >= ii->img);
+ vg_assert(ii->macho_img + ii->macho_img_szB <= ii->img + ii->img_szB);
+ return True; /* success */
+ /*NOTREACHED*/
+
+ unmap_and_fail:
+ unmap_image(ii);
+ return False; /* bah! */
+}
+
+
+/*------------------------------------------------------------*/
+/*--- ---*/
+/*--- Mach-O symbol table reading ---*/
+/*--- ---*/
+/*------------------------------------------------------------*/
+
/* Read a symbol table (nlist). Add the resulting candidate symbols
to 'syms'; the caller will post-process them and hand them off to
ML_(addSym) itself. */
@@ -253,6 +481,12 @@
}
+/*------------------------------------------------------------*/
+/*--- ---*/
+/*--- Mach-O top-level processing ---*/
+/*--- ---*/
+/*------------------------------------------------------------*/
+
#if !defined(APPLE_DSYM_EXT_AND_SUBDIRECTORY)
#define APPLE_DSYM_EXT_AND_SUBDIRECTORY ".dSYM/Contents/Resources/DWARF/"
#endif
@@ -355,125 +589,10 @@
}
-static Addr map_file(Char *filename, UInt *size)
+static UChar *getsectdata(UChar* base, SizeT size,
+ Char *segname, Char *sectname,
+ /*OUT*/Word *sect_size)
{
- SysRes fd, sres;
- struct vg_stat stat_buf;
-
- fd = VG_(stat)(filename, &stat_buf);
- if (sr_isError(fd)) {
- ML_(symerr)(NULL, False, "Can't stat image (to determine its size)?!");
- return 0;
- }
- *size = stat_buf.size;
-
- fd = VG_(open)(filename, VKI_O_RDONLY, 0);
- if (sr_isError(fd)) {
- ML_(symerr)(NULL, False, "Can't open image to read symbols?!");
- return 0;
- }
-
- sres = VG_(am_mmap_file_float_valgrind)
- ( *size, VKI_PROT_READ, sr_Res(fd), 0 );
-
- VG_(close)(sr_Res(fd));
-
- if (sr_isError(sres)) return 0;
- else return sr_Res(sres);
-}
-
-
-static Addr make_thin(Addr fat, UInt fat_size, UInt *thin_size)
-{
- struct fat_header *fh_be;
- struct fat_header fh;
- struct MACH_HEADER *mh;
- Addr result = fat;
-
- // Check for fat header.
- if (fat_size < sizeof(struct fat_header)) {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (0 too small).");
- return 0;
- }
-
- // Fat header is always BIG-ENDIAN
- fh_be = (struct fat_header *)fat;
- fh.magic = VG_(ntohl)(fh_be->magic);
- fh.nfat_arch = VG_(ntohl)(fh_be->nfat_arch);
- if (fh.magic == FAT_MAGIC) {
- // Look for a good architecture.
- struct fat_arch *arch_be;
- struct fat_arch arch;
- int f;
- if (fat_size < sizeof(struct fat_header)
- + fh.nfat_arch * sizeof(struct fat_arch)) {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (1 too small).");
- return 0;
- }
- for (f = 0, arch_be = (struct fat_arch *)(fh_be+1);
- f < fh.nfat_arch;
- f++, arch_be++)
- {
- Int cputype;
-# if defined(VGA_ppc)
- cputype = CPU_TYPE_POWERPC;
-# elif defined(VGA_ppc64)
- cputype = CPU_TYPE_POWERPC64;
-# elif defined(VGA_x86)
- cputype = CPU_TYPE_X86;
-# elif defined(VGA_amd64)
- cputype = CPU_TYPE_X86_64;
-# else
-# error "unknown architecture"
-# endif
- arch.cputype = VG_(ntohl)(arch_be->cputype);
- arch.cpusubtype = VG_(ntohl)(arch_be->cpusubtype);
- arch.offset = VG_(ntohl)(arch_be->offset);
- arch.size = VG_(ntohl)(arch_be->size);
- if (arch.cputype == cputype) {
- if (fat_size < arch.offset + arch.size) {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (2 too small).");
- return 0;
- }
- result = fat + arch.offset;
- *thin_size = arch.size;
- break;
- }
- }
- if (f == fh.nfat_arch) {
- ML_(symerr)(NULL, True,
- "No acceptable architecture found in fat file.");
- return 0;
- }
- } else {
- // Not fat.
- *thin_size = fat_size;
- }
-
- if (*thin_size < sizeof(struct MACH_HEADER)) {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (3 too small).");
- VG_(printf)("%d %lu\n", *thin_size, sizeof(struct MACH_HEADER));
- return 0;
- }
-
- mh = (struct MACH_HEADER *)result;
- if (mh->magic != MAGIC) {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (bad magic).");
- return 0;
- }
-
- if (*thin_size < sizeof(struct MACH_HEADER) + mh->sizeofcmds) {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (4 too small).");
- return 0;
- }
-
- return result;
-}
-
-
-static UChar *getsectdata(Addr base, Int size,
- Char *segname, Char *sectname, Int *sect_size)
-{
struct MACH_HEADER *mh = (struct MACH_HEADER *)base;
struct load_command *cmd;
Int c;
@@ -504,20 +623,52 @@
}
+/* Brute force just simply search for uuid[0..15] in img[0..n_img-1] */
+static Bool check_uuid_matches ( Addr imgA, Word n_img, UChar* uuid )
+{
+ Word i;
+ UChar* img = (UChar*)imgA;
+ UChar first = uuid[0];
+ if (n_img < 16)
+ return False;
+ for (i = 0; i < n_img-16; i++) {
+ if (img[i] != first)
+ continue;
+ if (0 == VG_(memcmp)( &img[i], &uuid[0], 16 ))
+ return True;
+ }
+ return False;
+}
+
+
+/* Heuristic kludge: return True if this looks like an installed
+ standard library; hence we shouldn't consider automagically running
+ dsymutil on it. */
+static Bool is_systemish_library_name ( UChar* name )
+{
+ vg_assert(name);
+ if (0 == VG_(strncasecmp)(name, "/usr/", 5)
+ || 0 == VG_(strncasecmp)(name, "/bin/", 5)
+ || 0 == VG_(strncasecmp)(name, "/sbin/", 6)
+ || 0 == VG_(strncasecmp)(name, "/System/", 8)
+ || 0 == VG_(strncasecmp)(name, "/Library/", 9)) {
+ return True;
+ } else {
+ return False;
+ }
+}
+
+
Bool ML_(read_macho_debug_info)( struct _DebugInfo* di )
{
- SysRes m_res;
- Addr ob_map_base = 0, ob_oimage = 0;
- UInt ob_map_size, ob_n_oimage;
struct symtab_command *symcmd = NULL;
struct dysymtab_command *dysymcmd = NULL;
- Addr dw_map_base = 0, dw_oimage = 0;
- UInt dw_map_size, dw_n_oimage;
- Char *dsymfile = NULL;
- Bool got_nlist = False;
- Bool got_dwarf = False;
- Bool got_uuid = False;
+ HChar* dsymfilename = NULL;
+ Bool have_uuid = False;
UChar uuid[16];
+ ImageInfo ii; /* main file */
+ ImageInfo iid; /* auxiliary .dSYM file */
+ Bool ok;
/* mmap the object file to look for di->soname and di->text_bias
and uuid and nlist and STABS */
@@ -526,61 +677,68 @@
VG_(message)(Vg_DebugMsg,
"%s (%#lx)", di->filename, di->rx_map_avma );
+ VG_(memset)(&ii, 0, sizeof(ii));
+ VG_(memset)(&iid, 0, sizeof(iid));
+ VG_(memset)(&uuid, 0, sizeof(uuid));
+
+ ok = map_image_aboard( di, &ii, di->filename );
+ if (!ok) goto fail;
+
+ vg_assert(ii.macho_img != NULL && ii.macho_img_szB > 0);
+
+ /* Poke around in the Mach-O header, to find some important
+ stuff. */
+ // Find LC_SYMTAB and LC_DYSYMTAB, if present.
+ // Read di->soname from LC_ID_DYLIB if present,
+ // or from LC_ID_DYLINKER if present,
+ // or use "NONE".
+ // Get di->text_bias (aka slide) based on the corresponding LC_SEGMENT
+ // Get uuid for later dsym search
+
di->text_bias = 0;
- ob_map_base = map_file(di->filename, &ob_map_size);
- if (ob_map_base) {
- ob_oimage = make_thin(ob_map_base, ob_map_size, &ob_n_oimage);
- if (ob_oimage) {
- // Find LC_SYMTAB and LC_DYSYMTAB, if present.
- // Read di->soname from LC_ID_DYLIB if present,
- // or from LC_ID_DYLINKER if present,
- // or use "NONE".
- // Get di->text_bias (aka slide) based on the corresponding LC_SEGMENT
- // Get uuid for later dsym search
- struct MACH_HEADER *mh = (struct MACH_HEADER *)ob_oimage;
- struct load_command *cmd;
- int c;
- for (c = 0, cmd = (struct load_command *)(mh+1);
- c < mh->ncmds;
- c++, cmd = (struct load_command *)(cmd->cmdsize
- + (unsigned long)cmd))
- {
- if (cmd->cmd == LC_SYMTAB) {
- symcmd = (struct symtab_command *)cmd;
- }
- else if (cmd->cmd == LC_DYSYMTAB) {
- dysymcmd = (struct dysymtab_command *)cmd;
- }
- else if (cmd->cmd == LC_ID_DYLIB && mh->filetype == MH_DYLIB) {
- // GrP fixme bundle?
- struct dylib_command *dcmd = (struct dylib_command *)cmd;
- UChar *dylibname = dcmd->dylib.name.offset + (UChar *)dcmd;
- UChar *soname = VG_(strrchr)(dylibname, '/');
- if (!soname) soname = dylibname;
- else soname++;
- di->soname = ML_(dinfo_strdup)("di.readmacho.dylibname",
- soname);
- }
- else if (cmd->cmd==LC_ID_DYLINKER && mh->filetype==MH_DYLINKER) {
- struct dylinker_command *dcmd = (struct dylinker_command *)cmd;
- UChar *dylinkername = dcmd->name.offset + (UChar *)dcmd;
- UChar *soname = VG_(strrchr)(dylinkername, '/');
- if (!soname) soname = dylinkername;
- else soname++;
- di->soname = ML_(dinfo_strdup)("di.readmacho.dylinkername",
- soname);
- }
- else if (cmd->cmd == LC_SEGMENT_CMD) {
- struct SEGMENT_COMMAND *seg = (struct SEGMENT_COMMAND *)cmd;
- if (!di->text_present && seg->fileoff == 0 &&
- seg->filesize != 0)
- {
- di->text_present = True;
- di->text_svma = (Addr)seg->vmaddr;
- di->text_avma = di->rx_map_avma;
- di->text_size = seg->vmsize;
- di->text_bias = di->text_avma - (Addr)seg->vmaddr;
+ { struct MACH_HEADER *mh = (struct MACH_HEADER *)ii.macho_img;
+ struct load_command *cmd;
+ Int c;
+
+ for (c = 0, cmd = (struct load_command *)(mh+1);
+ c < mh->ncmds;
+ c++, cmd = (struct load_command *)(cmd->cmdsize
+ + (unsigned long)cmd)) {
+ if (cmd->cmd == LC_SYMTAB) {
+ symcmd = (struct symtab_command *)cmd;
+ }
+ else if (cmd->cmd == LC_DYSYMTAB) {
+ dysymcmd = (struct dysymtab_command *)cmd;
+ }
+ else if (cmd->cmd == LC_ID_DYLIB && mh->filetype == MH_DYLIB) {
+ // GrP fixme bundle?
+ struct dylib_command *dcmd = (struct dylib_command *)cmd;
+ UChar *dylibname = dcmd->dylib.name.offset + (UChar *)dcmd;
+ UChar *soname = VG_(strrchr)(dylibname, '/');
+ if (!soname) soname = dylibname;
+ else soname++;
+ di->soname = ML_(dinfo_strdup)("di.readmacho.dylibname",
+ soname);
+ }
+ else if (cmd->cmd==LC_ID_DYLINKER && mh->filetype==MH_DYLINKER) {
+ struct dylinker_command *dcmd = (struct dylinker_command *)cmd;
+ UChar *dylinkername = dcmd->name.offset + (UChar *)dcmd;
+ UChar *soname = VG_(strrchr)(dylinkername, '/');
+ if (!soname) soname = dylinkername;
+ else soname++;
+ di->soname = ML_(dinfo_strdup)("di.readmacho.dylinkername",
+ soname);
+ }
+ else if (cmd->cmd == LC_SEGMENT_CMD) {
+ struct SEGMENT_COMMAND *seg = (struct SEGMENT_COMMAND *)cmd;
+ if (!di->text_present && seg->fileoff == 0
+ && seg->filesize != 0) {
+ di->text_present = True;
+ di->text_svma = (Addr)seg->vmaddr;
+ di->text_avma = di->rx_map_avma;
+ di->text_size = seg->vmsize;
+ di->text_bias = di->text_avma - (Addr)seg->vmaddr;
/* Make the _debug_ values be the same as the
svma/bias for the primary object, since there is
no secondary (debuginfo) object, but nevertheless
@@ -588,73 +746,249 @@
_debug_ values. */
di->text_debug_svma = di->text_svma;
di->text_debug_bias = di->text_bias;
- }
- }
- else if (cmd->cmd == LC_UUID) {
- struct uuid_command *uuid_cmd = (struct uuid_command *)cmd;
- VG_(memcpy)(uuid, uuid_cmd->uuid, sizeof(uuid));
- got_uuid = True;
- }
- }
- }
-
- /* Don't unmap object yet; we'll read nlist and STABS after DWARF. */
+ }
+ }
+ else if (cmd->cmd == LC_UUID) {
+ struct uuid_command *uuid_cmd = (struct uuid_command *)cmd;
+ VG_(memcpy)(uuid, uuid_cmd->uuid, sizeof(uuid));
+ have_uuid = True;
+ }
+ }
}
if (!di->soname) {
di->soname = ML_(dinfo_strdup)("di.readmacho.noname", "NONE");
}
+ /* Now we have the base object to hand. Read symbols from it. */
- /* mmap the dSYM file to look for DWARF debug info */
+ if (ii.macho_img && ii.macho_img_szB > 0 && symcmd && dysymcmd) {
- dsymfile = find_separate_debug_file(di->filename);
- // fixme verify dsymfile matches uuid
+ /* Read nlist symbol table */
+ struct NLIST *syms;
+ UChar *strs;
+ XArray* /* DiSym */ candSyms = NULL;
+ Word i, nCandSyms;
- if (dsymfile) {
+ if (ii.macho_img_szB < symcmd->stroff + symcmd->strsize
+ || ii.macho_img_szB < symcmd->symoff + symcmd->nsyms
+ * sizeof(struct NLIST)) {
+ ML_(symerr)(di, False, "Invalid Mach-O file (5 too small).");
+ goto fail;
+ }
+ if (dysymcmd->ilocalsym + dysymcmd->nlocalsym > symcmd->nsyms
+ || dysymcmd->iextdefsym + dysymcmd->nextdefsym > symcmd->nsyms) {
+ ML_(symerr)(di, False, "Invalid Mach-O file (bad symbol table).");
+ goto fail;
+ }
+
+ syms = (struct NLIST *)(ii.macho_img + symcmd->symoff);
+ strs = (UChar *)(ii.macho_img + symcmd->stroff);
+
if (VG_(clo_verbosity) > 1)
- VG_(message)(Vg_DebugMsg, " dsyms= %s", dsymfile);
- dw_map_base = map_file(dsymfile, &dw_map_size);
- if (dw_map_base) {
- dw_oimage = make_thin(dw_map_base, dw_map_size, &dw_n_oimage);
+ VG_(message)(Vg_DebugMsg,
+ " reading syms from primary file (%d %d)",
+ dysymcmd->nextdefsym, dysymcmd->nlocalsym );
+
+ /* Read candidate symbols into 'candSyms', so we can truncate
+ overlapping ends and generally tidy up, before presenting
+ them to ML_(addSym). */
+ candSyms = VG_(newXA)(
+ ML_(dinfo_zalloc), "di.readmacho.candsyms.1",
+ ML_(dinfo_free), sizeof(DiSym)
+ );
+ vg_assert(candSyms);
+
+ // extern symbols
+ read_symtab(candSyms,
+ di,
+ syms + dysymcmd->iextdefsym, dysymcmd->nextdefsym,
+ strs, symcmd->strsize);
+ // static and private_extern symbols
+ read_symtab(candSyms,
+ di,
+ syms + dysymcmd->ilocalsym, dysymcmd->nlocalsym,
+ strs, symcmd->strsize);
+
+ /* tidy up the cand syms -- trim overlapping ends. May resize
+ candSyms. */
+ tidy_up_cand_syms( candSyms, di->trace_symtab );
+
+ /* and finally present them to ML_(addSym) */
+ nCandSyms = VG_(sizeXA)( candSyms );
+ for (i = 0; i < nCandSyms; i++) {
+ DiSym* cand = (DiSym*) VG_(indexXA)( candSyms, i );
+ if (di->trace_symtab)
+ VG_(printf)("nlist final: acquire avma %010lx-%010lx %s\n",
+ cand->addr, cand->addr + cand->size - 1, cand->name );
+ ML_(addSym)( di, cand );
}
+ VG_(deleteXA)( candSyms );
}
- if (dw_oimage) {
+
+ /* Now we move on to reading the DWARF3, if we can find any. Since
+ this always appears to come from dSYM files, we first need to
+ check that we can verify that we've got the right file. That
+ means, if a UUID was not found in the primary object, we might
+ as well stop now, since without it we won't be able to verify
+ that the dSYM matches the primary. And our policy is to load no
+ debug info rather than incorrect debug info. Except, don't
+ bother to complain about system libraries, it's pointless. */
+ if (!have_uuid) {
+ if (!is_systemish_library_name(di->filename)) {
+ ML_(symerr)(di, True, "no UUID in Mach-O primary; "
+ "so dSYM correctness can't be verified");
+ }
+ goto success;
+ }
+
+ /* mmap the dSYM file to look for DWARF debug info. If successful,
+ use the .macho_img and .macho_img_szB in iid. */
+
+ dsymfilename = find_separate_debug_file( di->filename );
+
+ /* Try to load it. */
+ if (dsymfilename) {
+ Bool valid;
+
+ if (VG_(clo_verbosity) > 1)
+ VG_(message)(Vg_DebugMsg, " dSYM= %s", dsymfilename);
+
+ ok = map_image_aboard( di, &iid, dsymfilename );
+ if (!ok) goto fail;
+
+ /* check it has the right uuid. */
+ vg_assert(have_uuid);
+ valid = iid.macho_img && iid.macho_img_szB > 0
+ && check_uuid_matches( (Addr)iid.macho_img,
+ iid.macho_img_szB, uuid );
+ if (valid)
+ goto read_the_dwarf;
+
+ if (VG_(clo_verbosity) > 1)
+ VG_(message)(Vg_DebugMsg, " dSYM does not have "
+ "correct UUID (out of date?)");
+ }
+
+ /* There was no dsym file, or it doesn't match. We'll have to try
+ regenerating it, unless auto-run-dsymutil is disabled, in which
+ case just complain instead. */
+
+ /* If this looks like a lib that we shouldn't run dsymutil on, just
+ give up. (possible reasons: is system lib, or in /usr etc, or
+ the dsym dir would not be writable by the user, or we're running
+ as root) */
+ vg_assert(di->filename);
+ if (is_systemish_library_name(di->filename))
+ goto success;
+
+ if (!VG_(clo_auto_run_dsymutil)) {
+ if (VG_(clo_verbosity) == 1) {
+ VG_(message)(Vg_DebugMsg, "%s:", di->filename);
+ }
+ if (VG_(clo_verbosity) > 0)
+ VG_(message)(Vg_DebugMsg, "%sdSYM directory %s; consider using "
+ "--auto-run-dsymutil=yes",
+ VG_(clo_verbosity) > 1 ? " " : "",
+ dsymfilename ? "has wrong UUID" : "is missing");
+ goto success;
+ }
+
+ /* Run dsymutil */
+
+ { Int r;
+ HChar* dsymutil = "/usr/bin/dsymutil ";
+ HChar* cmd = ML_(dinfo_zalloc)( "di.readmacho.tmp1",
+ VG_(strlen)(dsymutil)
+ + VG_(strlen)(di->filename)
+ + 30 /* misc */ );
+ VG_(strcpy)(cmd, dsymutil);
+ if (0) VG_(strcat)(cmd, "--verbose ");
+ VG_(strcat)(cmd, di->filename);
+ VG_(message)(Vg_DebugMsg, "run: %s", cmd);
+ r = VG_(system)( cmd );
+ if (r)
+ VG_(message)(Vg_DebugMsg, "run: %s FAILED", dsymutil);
+ ML_(dinfo_free)(cmd);
+ dsymfilename = find_separate_debug_file(di->filename);
+ }
+
+ /* Try again to load it. */
+ if (dsymfilename) {
+ Bool valid;
+
+ if (VG_(clo_verbosity) > 1)
+ VG_(message)(Vg_DebugMsg, " dsyms= %s", dsymfilename);
+
+ ok = map_image_aboard( di, &iid, dsymfilename );
+ if (!ok) goto fail;
+
+ /* check it has the right uuid. */
+ vg_assert(have_uuid);
+ valid = iid.macho_img && iid.macho_img_szB > 0
+ && check_uuid_matches( (Addr)iid.macho_img,
+ iid.macho_img_szB, uuid );
+ if (!valid) {
+ if (VG_(clo_verbosity) > 0) {
+ VG_(message)(Vg_DebugMsg,
+ "WARNING: did not find expected UUID %02X%02X%02X%02X"
+ "-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X"
+ " in dSYM dir",
+ (UInt)uuid[0], (UInt)uuid[1], (UInt)uuid[2], (UInt)uuid[3],
+ (UInt)uuid[4], (UInt)uuid[5], (UInt)uuid[6], (UInt)uuid[7],
+ (UInt)uuid[8], (UInt)uuid[9], (UInt)uuid[10],
+ (UInt)uuid[11], (UInt)uuid[12], (UInt)uuid[13],
+ (UInt)uuid[14], (UInt)uuid[15] );
+ VG_(message)(Vg_DebugMsg,
+ "WARNING: for %s", di->filename);
+ }
+ unmap_image( &iid );
+ /* unmap_image zeroes the fields, so the following test makes
+ sense. */
+ goto fail;
+ }
+ }
+
+ /* Right. Finally we have our best try at the dwarf image, so go
+ on to reading stuff out of it. */
+
+ read_the_dwarf:
+ if (iid.macho_img && iid.macho_img_szB > 0) {
UChar* debug_info_img = NULL;
- Int debug_info_sz;
+ Word debug_info_sz;
UChar* debug_abbv_img;
- Int debug_abbv_sz;
+ Word debug_abbv_sz;
UChar* debug_line_img;
- Int debug_line_sz;
+ Word debug_line_sz;
UChar* debug_str_img;
- Int debug_str_sz;
+ Word debug_str_sz;
UChar* debug_ranges_img;
- Int debug_ranges_sz;
+ Word debug_ranges_sz;
UChar* debug_loc_img;
- Int debug_loc_sz;
+ Word debug_loc_sz;
UChar* debug_name_img;
- Int debug_name_sz;
-
+ Word debug_name_sz;
+
debug_info_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_info", &debug_info_sz);
debug_abbv_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_abbrev", &debug_abbv_sz);
debug_line_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_line", &debug_line_sz);
debug_str_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_str", &debug_str_sz);
debug_ranges_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_ranges", &debug_ranges_sz);
debug_loc_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_loc", &debug_loc_sz);
debug_name_img =
- getsectdata(dw_oimage, dw_n_oimage,
+ getsectdata(iid.macho_img, iid.macho_img_szB,
"__DWARF", "__debug_pubnames", &debug_name_sz);
if (debug_info_img) {
@@ -662,8 +996,8 @@
if (0)
VG_(message)(Vg_DebugMsg,
"Reading dwarf3 for %s (%#lx) from %s"
- " (%d %d %d %d %d %d)",
- di->filename, di->text_avma, dsymfile,
+ " (%ld %ld %ld %ld %ld %ld)",
+ di->filename, di->text_avma, dsymfilename,
debug_info_sz, debug_abbv_sz, debug_line_sz,
debug_str_sz, debug_ranges_sz, debug_loc_sz
);
@@ -701,117 +1035,26 @@
debug_loc_img, debug_loc_sz
);
}
- got_dwarf = True;
}
}
- if (dw_map_base) {
- m_res = VG_(am_munmap_valgrind) ( dw_map_base, dw_map_size );
- vg_assert(!sr_isError(m_res));
- }
+ if (dsymfilename) ML_(dinfo_free)(dsymfilename);
- if (dsymfile) ML_(dinfo_free)(dsymfile);
+ success:
+ if (ii.img)
+ unmap_image(&ii);
+ if (iid.img)
+ unmap_image(&iid);
+ return True;
+ /* NOTREACHED */
- /* Read nlist symbol tables and (if no DWARF) STABS debuginfo.
- In particular, hand-written assembly often has an nlist entry
- but no DWARF debuginfo. Prefer the DWARF version.
- */
-
- if (ob_oimage && symcmd && dysymcmd) {
- /* Read nlist symbol table and STABS debug info */
- struct NLIST *syms;
- UChar *strs;
- XArray* /* DiSym */ candSyms = NULL;
- Word i, nCandSyms;
-
- if (ob_n_oimage < symcmd->stroff + symcmd->strsize ||
- ob_n_oimage < symcmd->symoff + symcmd->nsyms*sizeof(struct NLIST))
- {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (5 too small).");
- goto bad_nlist;
- }
- if (dysymcmd->ilocalsym + dysymcmd->nlocalsym > symcmd->nsyms ||
- dysymcmd->iextdefsym + dysymcmd->nextdefsym > symcmd->nsyms)
- {
- ML_(symerr)(NULL, False, "Invalid Mach-O file (bad symbol table).");
- goto bad_nlist;
- }
-
- syms = (struct NLIST *)(ob_oimage + symcmd->symoff);
- strs = (UChar *)(ob_oimage + symcmd->stroff);
-
- if (VG_(clo_verbosity) > 1)
- VG_(message)(Vg_DebugMsg,
- " reading syms from primary file (%d %d)",
- dysymcmd->nextdefsym, dysymcmd->nlocalsym );
-
- /* Read candidate symbols into 'candSyms', so we can truncate
- overlapping ends and generally tidy up, before presenting
- them to ML_(addSym). */
- candSyms = VG_(newXA)(
- ML_(dinfo_zalloc), "di.readmacho.candsyms.1",
- ML_(dinfo_free), sizeof(DiSym)
- );
- vg_assert(candSyms);
-
- // extern symbols
- read_symtab(candSyms,
- di,
- syms + dysymcmd->iextdefsym, dysymcmd->nextdefsym,
- strs, symcmd->strsize);
- // static and private_extern symbols
- read_symtab(candSyms,
- di,
- syms + dysymcmd->ilocalsym, dysymcmd->nlocalsym,
- strs, symcmd->strsize);
-
- /* tidy up the cand syms -- trim overlapping ends. May resize
- candSyms. */
- tidy_up_cand_syms( candSyms, di->trace_symtab );
-
- /* and finally present them to ML_(addSym) */
- nCandSyms = VG_(sizeXA)( candSyms );
- for (i = 0; i < nCandSyms; i++) {
- DiSym* cand = (DiSym*) VG_(indexXA)( candSyms, i );
- if (di->trace_symtab)
- VG_(printf)("nlist final: acquire avma %010lx-%010lx %s\n",
- cand->addr, cand->addr + cand->size - 1, cand->name );
- ML_(addSym)( di, cand );
- }
- VG_(deleteXA)( candSyms );
-
- if (!got_dwarf) {
- // debug info
- if (VG_(clo_verbosity) > 1)
- VG_(message)(Vg_DebugMsg,
- " reading stabs from primary file (%d %d)",
- dysymcmd->nextdefsym, dysymcmd->nlocalsym );
- ML_(read_debuginfo_stabs) ( di,
- (UChar *)syms,
- symcmd->nsyms * sizeof(struct NLIST),
- strs, symcmd->strsize);
- }
-
- got_nlist = True;
- }
-
- bad_nlist:
- ;
-
- ML_(shrinkSym)(di);
- ML_(shrinkLineInfo)(di);
-
- if (ob_map_base) {
- m_res = VG_(am_munmap_valgrind) ( ob_map_base, ob_map_size );
- vg_assert(!sr_isError(m_res));
- }
-
- if (got_dwarf || got_nlist) {
- return True;
- }
-
- ML_(symerr)(NULL, True, "No symbol table found.");
+ fail:
+ ML_(symerr)(di, True, "Error reading Mach-O object.");
+ if (ii.img)
+ unmap_image(&ii);
+ if (iid.img)
+ unmap_image(&iid);
return False;
}
Modified: branches/DARWIN/coregrind/m_main.c
===================================================================
--- branches/DARWIN/coregrind/m_main.c 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/coregrind/m_main.c 2009-04-23 11:50:16 UTC (rev 9586)
@@ -439,6 +439,9 @@
else if VG_STR_CLO (arg, "--kernel-variant", VG_(clo_kernel_variant)) {}
+ else if VG_BOOL_CLO(arg, "--auto-run-dsymutil",
+ VG_(clo_auto_run_dsymutil)) {}
+
else if VG_BINT_CLO(arg, "--vex-iropt-verbosity",
VG_(clo_vex_control).iropt_verbosity, 0, 10) {}
else if VG_BINT_CLO(arg, "--vex-iropt-level",
Modified: branches/DARWIN/coregrind/m_options.c
===================================================================
--- branches/DARWIN/coregrind/m_options.c 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/coregrind/m_options.c 2009-04-23 11:50:16 UTC (rev 9586)
@@ -93,6 +93,7 @@
Bool VG_(clo_wait_for_gdb) = False;
VgSmc VG_(clo_smc_check) = Vg_SmcStack;
HChar* VG_(clo_kernel_variant) = NULL;
+Bool VG_(clo_auto_run_dsymutil) = False;
/*====================================================================*/
Modified: branches/DARWIN/coregrind/pub_core_options.h
===================================================================
--- branches/DARWIN/coregrind/pub_core_options.h 2009-04-23 04:49:15 UTC (rev 9585)
+++ branches/DARWIN/coregrind/pub_core_options.h 2009-04-23 11:50:16 UTC (rev 9586)
@@ -188,6 +188,10 @@
so they can be properly handled by m_syswrap. */
extern HChar* VG_(clo_kernel_variant);
+/* Darwin-specific: automatically run /usr/bin/dsymutil to update
+ .dSYM directories as necessary? */
+extern Bool VG_(clo_auto_run_dsymutil);
+
/* --------- Functions --------- */
/* Call this if the executable is missing. This function prints an
|
|
From: Julian S. <js...@ac...> - 2009-04-23 09:41:48
|
Some possibly disjointed comments:
> I think it would be better to separate out the commas at command-line
> processing time, rather than later.
Agree.
> Another idea is to match not the executable name, but rather the entire
> command line, ie. the executable plus the arguments.
This seems like a much more general solution, yes.
> I wonder
> if tracing all children is a better default than tracing no children.
Euh .. I prefer not to do that. You could wind up tracing
a huge tree of processes unexpectedly, if not careful.
How about this. It gives the kind of flexibility you want, whilst
preserving existing behaviour. (remember the kinds of protestation
we've had in the past w.r.t. changing meaning/behaviour of
command line options)
--trace-children=no retained, and is still the default
--trace-children=yes retained, and behaves as present
--skip-children=<command-line-w-wildcards-as-you-suggest>:
(1) when --trace-children=no or is absent, produces a warning that
--skip-children= is irrelevant when --trace-children=no
(2) --trace-children=yes by itself traces all children
(3) --trace-children=yes together with --skip-children= behaves as
you'd expect.
For (1), an alternative would be to declare --trace-children=no
together with --skip-children= as nonsensical, print an error message
and refuse to start. But that would be a nuisance in the case
where I'm doing some kind of weird experiment, and running with
--trace-children=yes --skip-children=...
and then I temporarily switch to
--trace-children=no --skip-children=...
I just want it to continue with a warning; having to delete a potentially
long list of --skip-children= params just because --trace-children=no
would be a drag.
J
|
|
From: Filipe C. <fi...@gm...> - 2009-04-23 08:15:21
|
Heh, my bad. Thanks, Filipe Nicholas Nethercote wrote: > On Wed, Apr 22, 2009 at 7:22 PM, Filipe Cabecinhas <fi...@gm...> wrote: >> It's done. I also included Greg's suggestions and changed getitimer and >> setitimer's PRE_MEM_READ(..., sizeof(struct vki_itimerval) to two >> PRE_timeval_READ(...) as well as the writes. > > Committed with minor changes as r9585 -- you used PRE_timeval_WRITE in > the POST handlers; I changed them to POST_timeval_WRITE. Thanks. |
|
From: Tor L. <tm...@ik...> - 2009-04-23 07:29:40
|
> Add support for reading Windows PDB debug info (symbols and line > numbers) when Valgrind is running Wine. Yay! This code will probably also be useful when running VG on real Windows. (Sure, there is also a native API on Windows (dbghelp.dll) to read PDB files of course, but it is IMHO too complex and pulls in too many other DLLs to be used inside a VG tool, so using it would have to be relegated to a separate helper process, with some trivial shared memory and event -style request/reply IPC between the tool and helper processes.) (Of course, no new separate process is needed as such, the launcher could act also as such a helper process, after all it has nothing else to do while the tool is running.) --tml |
|
From: Julian S. <js...@ac...> - 2009-04-23 07:28:11
|
> So it looks like the thread stacks are 8MB, which seems rather large > -- I thought the main stack was typically something like that size, > but that thread stacks were much smaller, maybe 64KB or something? I thought the thread stacks are 2M, but really am not sure. > Could the thread stack size on my machine have changed spontaneously > somehow? Sounds unlikely, unless your glibc got majorly updated somehow? But that too sounds unlikely. J |
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 05:34:45
|
On Mon, Apr 20, 2009 at 4:44 AM, Dan Kegel <da...@ke...> wrote:
>
> Here's the same patch, updated slightly to apply to svn (it's
> been dragged through the mud a bit, but I think these are
> the right bits).
I think it would be better to separate out the commas at command-line
processing time, rather than later. Alternatively, we could avoid the
commas by allowing the option to be specified multiple times, as is done for
--alloc-fn in Massif.
As for whitelists vs. blacklists, I think whitelists don't make much sense.
For example, if we have this tree of processes:
A --> B --> C
--> D --> C
--> E
Ie:
- A spawns B which spawns C
- A subsequently spawns D which spawns C (the same program as the earlier C,
but a different invocation of it)
- A subsequently spawns E.
We have to trace A. It makes sense to blacklist C, for example. But it
doesn't make sense to whitelist C; in order to trace C we have to trace A,
B and D, and we don't know ahead of time that B and D will spawn C
processes. And if you blacklist something, obviously you won't trace any of
its descendents, (eg. if you blacklist B you won't get the first C).
Another idea is to match not the executable name, but rather the entire
command line, ie. the executable plus the arguments. If we allow wildcards
(which m_seqmatch.c supports) then this can be done easily. I had a case
just this morning where I wanted to skip one 'js' subprocess, but not
another, so an executable-only blacklist wouldn't have sufficed.
Examples:
--skip-children='*' # skip all subprocesses (default)
--skip-children='/usr/bin/python *' # skip all python subprocesses
--skip-children='/usr/bin/python *-v*' # skip all python
subprocesses invoked with -v
--skip-children='' # skip no subprocesses
(equivalent to --trace-children=yes)
(Note that the '*' here is a shell-style wildcard -- this pattern is
not a regular expression. The docs would make that clear.)
If you specify multiple --skip-children options, you'd skip a child if any
of the patterns matched.
With that in place, you don't really need --trace-children any more; you
could make --skip-children='*' the default, and if you specify any
--skip-children options yourself they would clobber the initial
--skip-children='*'. Alternatively, we could make --skip-children='' the
default, and then user-specified ones wouldn't need to clobber... I wonder
if tracing all children is a better default than tracing no children. In my
experience tracing no children is rarely if ever useful.
I suppose for generality it might make sense to blacklist the top process,
eg. "valgrind --trace-children-skip='/home/njn/foo' /home/njn/foo" would run
/home/njn/foo natively. But maybe that's not worth bothering with.
Anyway, for those of you who've made it far, congratulations. I'll work on
a patch implementing this more powerful version.
Nick
|
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 04:50:29
|
On Wed, Apr 22, 2009 at 7:22 PM, Filipe Cabecinhas <fi...@gm...> wrote: > > It's done. I also included Greg's suggestions and changed getitimer and > setitimer's PRE_MEM_READ(..., sizeof(struct vki_itimerval) to two > PRE_timeval_READ(...) as well as the writes. Committed with minor changes as r9585 -- you used PRE_timeval_WRITE in the POST handlers; I changed them to POST_timeval_WRITE. Thanks. |
|
From: <sv...@va...> - 2009-04-23 04:49:29
|
Author: njn
Date: 2009-04-23 05:49:15 +0100 (Thu, 23 Apr 2009)
New Revision: 9585
Log:
Fix getitimer and setitimer wrappers. Based on a patch from Filipe
Cabecinhas.
Modified:
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-23 04:40:02 UTC (rev 9584)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-23 04:49:15 UTC (rev 9585)
@@ -7039,10 +7039,10 @@
// _____(__NR_setgroups), // 80
GENX_(__NR_getpgrp, sys_getpgrp),
// _____(__NR_setpgid),
- GENX_(__NR_setitimer, sys_setitimer),
+ GENXY(__NR_setitimer, sys_setitimer),
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(84)), // old wait
// _____(__NR_swapon),
- GENX_(__NR_getitimer, sys_getitimer),
+ GENXY(__NR_getitimer, sys_getitimer),
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(87)), // old gethostname
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(88)), // old sethostname
MACXY(__NR_getdtablesize, sys_getdtablesize),
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-04-23 04:40:02 UTC (rev 9584)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-04-23 04:49:15 UTC (rev 9585)
@@ -2217,14 +2217,20 @@
PRE(sys_getitimer)
{
+ struct vki_itimerval *value = (struct vki_itimerval*)ARG2;
PRINT("sys_getitimer ( %ld, %#lx )", ARG1, ARG2);
PRE_REG_READ2(long, "getitimer", int, which, struct itimerval *, value);
- PRE_MEM_WRITE( "getitimer(value)", ARG2, sizeof(struct vki_itimerval) );
+
+ PRE_timeval_WRITE( "getitimer(value.it_interval)", &(value->it_interval));
+ PRE_timeval_WRITE( "getitimer(value.it_value)", &(value->it_value));
}
+
POST(sys_getitimer)
{
if (ARG2 != (Addr)NULL) {
- POST_MEM_WRITE(ARG2, sizeof(struct vki_itimerval));
+ struct vki_itimerval *value = (struct vki_itimerval*)ARG2;
+ POST_timeval_WRITE( &(value->it_interval) );
+ POST_timeval_WRITE( &(value->it_value) );
}
}
@@ -2234,16 +2240,28 @@
PRE_REG_READ3(long, "setitimer",
int, which,
struct itimerval *, value, struct itimerval *, ovalue);
- if (ARG2 != (Addr)NULL)
- PRE_MEM_READ( "setitimer(value)", ARG2, sizeof(struct vki_itimerval) );
- if (ARG3 != (Addr)NULL)
- PRE_MEM_WRITE( "setitimer(ovalue)", ARG3, sizeof(struct vki_itimerval));
+ if (ARG2 != (Addr)NULL) {
+ struct vki_itimerval *value = (struct vki_itimerval*)ARG2;
+ PRE_timeval_READ( "getitimer(value->it_interval)",
+ &(value->it_interval));
+ PRE_timeval_READ( "getitimer(value->it_value)",
+ &(value->it_value));
+ }
+ if (ARG3 != (Addr)NULL) {
+ struct vki_itimerval *ovalue = (struct vki_itimerval*)ARG3;
+ PRE_timeval_WRITE( "getitimer(ovalue->it_interval)",
+ &(ovalue->it_interval));
+ PRE_timeval_WRITE( "getitimer(ovalue->it_value)",
+ &(ovalue->it_value));
+ }
}
POST(sys_setitimer)
{
if (ARG3 != (Addr)NULL) {
- POST_MEM_WRITE(ARG3, sizeof(struct vki_itimerval));
+ struct vki_itimerval *ovalue = (struct vki_itimerval*)ARG3;
+ POST_timeval_WRITE( &(ovalue->it_interval) );
+ POST_timeval_WRITE( &(ovalue->it_value) );
}
}
|
|
From: Nicholas N. <n.n...@gm...> - 2009-04-23 04:41:31
|
On Fri, Apr 17, 2009 at 10:52 PM, Filipe Cabecinhas <fi...@gm...> wrote: > > I implemented two brand new Mac OS X system calls... I couldn't believe they > had implemented sem_init and sem_destroy when I first saw it! It must have > been in Leopard, for POSIX compliance... (But we still have no manpages for > the functions). > > Patch: > http://web.ist.utl.pt/~filipe.cabecinhas/patches/valgrind-sem_init_destroy.patch > > The semlimit test now runs successefully. Committed (r9584), thanks. Nick |
|
From: <sv...@va...> - 2009-04-23 04:40:14
|
Author: njn
Date: 2009-04-23 05:40:02 +0100 (Thu, 23 Apr 2009)
New Revision: 9584
Log:
Add support for sem_init() and sem_destroy(), from Filipe Cabecinhas.
Modified:
branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h
branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
Modified: branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h 2009-04-23 04:37:22 UTC (rev 9583)
+++ branches/DARWIN/coregrind/m_syswrap/priv_syswrap-darwin.h 2009-04-23 04:40:02 UTC (rev 9584)
@@ -58,6 +58,8 @@
DECL_TEMPLATE(darwin, sys_sem_close);
DECL_TEMPLATE(darwin, sys_sem_unlink);
DECL_TEMPLATE(darwin, sys_sem_post);
+DECL_TEMPLATE(darwin, sys_sem_init);
+DECL_TEMPLATE(darwin, sys_sem_destroy);
DECL_TEMPLATE(darwin, sys_sem_wait_nocancel);
DECL_TEMPLATE(darwin, sys_sem_trywait);
DECL_TEMPLATE(darwin, sys_bsdthread_create);
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-23 04:37:22 UTC (rev 9583)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-darwin.c 2009-04-23 04:40:02 UTC (rev 9584)
@@ -1348,6 +1348,26 @@
*flags |= SfMayBlock;
}
+PRE(sys_sem_destroy)
+{
+ PRINT("sem_destroy( %#lx )", ARG1);
+ PRE_REG_READ1(int, "sem_destroy", vki_sem_t *, sem);
+ PRE_MEM_READ("sem_destroy(sem)", ARG1, sizeof(vki_sem_t));
+}
+
+PRE(sys_sem_init)
+{
+ PRINT("sem_init( %#lx, %ld, %ld )", ARG1, ARG2, ARG3);
+ PRE_REG_READ3(int, "sem_init", vki_sem_t *, sem,
+ int, pshared, unsigned int, value);
+ PRE_MEM_WRITE("sem_init(sem)", ARG1, sizeof(vki_sem_t));
+}
+
+POST(sys_sem_init)
+{
+ POST_MEM_WRITE(ARG1, sizeof(vki_sem_t));
+}
+
PRE(sys_sem_wait_nocancel)
{
PRINT("sem_wait_nocancel( %#lx )", ARG1);
@@ -7212,8 +7232,8 @@
// _____(__NR_sem_post),
MACX_(__NR_sem_post, sys_sem_post),
// _____(__NR_sem_getvalue),
-// _____(__NR_sem_init),
-// _____(__NR_sem_destroy),
+ MACXY(__NR_sem_init, sys_sem_init),
+ MACX_(__NR_sem_destroy, sys_sem_destroy),
// _____(__NR_open_extended),
// _____(__NR_umask_extended),
MACXY(__NR_stat_extended, sys_statx),
|