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-30 22:58:28
|
On Fri, May 1, 2009 at 8:34 AM, Philippe Waroquiers <phi...@sk...> wrote: > > I am still puzzled by this behaviour. I can understand cache effects caused > by code which is called, but cache effects caused by a (smaller) piece of > code not being called is beyond my brain. The extra code will change the code layout in memory, and possibly also the data layout. That could be enough to trigger some extra cache conflicts. You could try running Cachegrind on it (see README_DEVELOPERS for how) and see if you get significantly different results... it would take a while, but might answer your question. Or you could use something (oprofile?) that reads performance counters, which would be quicker but wouldn't give you the line-by-line cache results that Cachegrind does. Nick |
|
From: Philippe W. <phi...@sk...> - 2009-04-30 22:34:21
|
> > I am working on improving the performance of the leak search client request > > (which has a quadratic aspect). > What's the quadratic aspect? I have just filed bug report 191182 explaining the problem and a patch fixing this quadratic behaviour. (If the bug report or patch is raising questions, I might not be able to answer to my mail before sunday evening: this week-end, it will be family). > I tried your experiment on my machine, and there was no difference in > performance. If you have access to another machine, you could try it > there. I'd blame "inscrutable cache effects" myself... I am doing this at home, where I only have this single fedora x86 computer. I will try at work, but there, I have no pentium x86 which is similar to the home version. I am still puzzled by this behaviour. I can understand cache effects caused by code which is called, but cache effects caused by a (smaller) piece of code not being called is beyond my brain. A friend suggested to add some more such loops till I obtain a negative runtime for the perf test :). Philippe |
|
From: Nicholas N. <n.n...@gm...> - 2009-04-30 17:31:34
|
Nightly build on ocean32 ( Ubuntu 9.04, Intel x86-64 (32-bit only) ) started at 2009-05-01 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-05-01 03:18:25.000000000 +1000
+++ stack_switch.stderr.out 2009-05-01 03:29:20.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-05-01 03:18:39.000000000 +1000
+++ origin1-yes.stderr.out 2009-05-01 03:29:38.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.9.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-05-01 03:18:39.000000000 +1000
+++ origin5-bz2.stderr.out 2009-05-01 03:29:43.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-05-01 03:18:39.000000000 +1000
+++ origin5-bz2.stderr.out 2009-05-01 03:29:43.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-05-01 03:18:39.000000000 +1000
+++ origin5-bz2.stderr.out 2009-05-01 03:29:43.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-05-01 03:20:12.000000000 +1000
+++ mremap2.stdout.out 2009-05-01 03:30:48.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
..................................................
..................................................
-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
..................................................
..................................................
-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-05-01 03:20:12.000000000 +1000
+++ mremap2.stdout.out 2009-05-01 03:30:48.000000000 +1000
@@ -188,37 +188,37 @@
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-05-01 03:20:12.000000000 +1000
+++ mremap2.stdout.out 2009-05-01 03:30:48.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
..................................................
..................................................
-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
..................................................
..................................................
-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-05-01 03:20:18.000000000 +1000
+++ shell.stderr.out 2009-05-01 03:31:03.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-05-01 03:20:18.000000000 +1000
+++ shell.stderr.out 2009-05-01 03:31:03.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-05-01 03:20:18.000000000 +1000
+++ shell.stdout.out 2009-05-01 03:31:03.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-05-01 03:20:18.000000000 +1000
+++ shell_valid1.stderr.out 2009-05-01 03:31:04.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-05-01 03:20:18.000000000 +1000
+++ shell_valid2.stderr.out 2009-05-01 03:31:04.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-05-01 03:20:18.000000000 +1000
+++ shell_valid3.stderr.out 2009-05-01 03:31:04.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: Nicholas N. <n.n...@gm...> - 2009-04-30 16:39:10
|
Nightly build on ocean ( Ubuntu 9.04, Intel x86-64 ) started at 2009-05-01 02:00:01 EST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 483 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 483 tests, 1 stderr failure, 1 stdout failure, 0 post failures == memcheck/tests/varinfo5 (stderr) none/tests/linux/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Fri May 1 02:16:43 2009 --- new.short Fri May 1 02:39:01 2009 *************** *** 8,11 **** ! == 483 tests, 1 stderr failure, 1 stdout failure, 0 post failures == ! memcheck/tests/varinfo5 (stderr) none/tests/linux/mremap2 (stdout) --- 8,10 ---- ! == 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-05-01 02:22:56.000000000 +1000 +++ mremap2.stdout.out 2009-05-01 02:38:28.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 .................................................. .................................................. -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 .................................................. .................................................. -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-05-01 02:22:56.000000000 +1000 +++ mremap2.stdout.out 2009-05-01 02:38:28.000000000 +1000 @@ -188,37 +188,37 @@ 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-05-01 02:22:56.000000000 +1000 +++ mremap2.stdout.out 2009-05-01 02:38:28.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 .................................................. .................................................. -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 .................................................. .................................................. -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: Filipe C. <fi...@gm...> - 2009-04-30 09:19:03
|
Hi,
I'm having a little problem running the heap test, and can't figure out
what's wrong:
[filcab@farnsworth ~/dev/stuff/valgrind-darwin64] $ ./perf/vg_perf
perf/heap.vgperf
heap valgrind-darwin64:0.36s no:
*** Command returned non-zero (32256)
*** See perf.{cmd,stdout,stderr} to determine what went wrong.
[filcab@farnsworth ~/dev/stuff/valgrind-darwin64] $ cat perf/perf.std*
valgrind: ./heap: cannot execute binary file
real 0.01
user 0.00
sys 0.00
[filcab@farnsworth ~/dev/stuff/valgrind-darwin64] $ cd perf
/Users/filcab/dev/stuff/valgrind-darwin64/perf
[filcab@farnsworth ~/dev/stuff/valgrind-darwin64/perf] $ bash perf.cmd
valgrind: ./heap: cannot execute binary file
real 0.00
user 0.00
sys 0.00
[filcab@farnsworth ~/dev/stuff/valgrind-darwin64/perf] $ cd ..
[filcab@farnsworth ~/dev/stuff/valgrind-darwin64] $ sed -e
's!\./heap!./perf/heap!g' perf/perf.cmd |bashinitialisingrunningdonereal
7.09
user 2.76
sys 4.17
The weird thing is... if I'm not in the perf directory, valgrind can run
the test... If I'm in the perf directory, it can't execute the file...
Any clues?
Regards,
Filipe
|
|
From: <sv...@va...> - 2009-04-30 07:53:00
|
Author: njn
Date: 2009-04-30 08:52:52 +0100 (Thu, 30 Apr 2009)
New Revision: 9703
Log:
Merged r9702 (sync_sighandler refactoring) from the trunk.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 07:41:24 UTC (rev 9702)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 07:52:52 UTC (rev 9703)
@@ -1924,116 +1924,49 @@
fault_catcher = catcher;
}
-
-/*
- Receive a sync signal from the host.
-*/
-/* Darwin inside-vs-outside examples:
- Segfault from within the same process (sync signal)
- info->si_signo 11
- info->si_errno 0
- info->si_code 1
- info->si_pid 0
- info->si_uid 0
- info->si_status 0
- info->si_addr 0x90000000
- Segfault from outside this process (async signal)
- sync_sighandler(11, 0xF21ACDF4, 0xF21ACE34)
- info->si_signo 11
- info->si_errno 0
- info->si_code 0
- info->si_pid 0
- info->si_uid 0
- info->si_status 0
- info->si_addr 0xF00C2E90
-*/
static
-void sync_signalhandler ( Int sigNo,
- vki_siginfo_t *info, struct vki_ucontext *uc )
+void sync_signalhandler_from_outside ( ThreadId tid,
+ Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc )
{
- ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
- Bool from_outside;
+ ThreadId qtid;
- if (0)
- VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
+ /* If some user-process sent us a sync signal (ie, they're not the result
+ of a faulting instruction), then how we treat it depends on when it
+ arrives... */
- vg_assert(info != NULL);
- vg_assert(info->si_signo == sigNo);
- vg_assert(sigNo == VKI_SIGSEGV ||
- sigNo == VKI_SIGBUS ||
- sigNo == VKI_SIGFPE ||
- sigNo == VKI_SIGILL ||
- sigNo == VKI_SIGTRAP);
+ if (VG_(threads)[tid].status == VgTs_WaitSys) {
+ /* Signal arrived while we're blocked in a syscall. This means that
+ the client's signal mask was applied. In other words, so we can't
+ get here unless the client wants this signal right now. This means
+ we can simply use the async_signalhandler. */
+ if (VG_(clo_trace_signals))
+ VG_DMSG("Delivering user-sent sync signal %d as async signal", sigNo);
- info->si_code = sanitize_si_code(info->si_code);
+ async_signalhandler(sigNo, info, uc);
+ VG_(core_panic)("async_signalhandler returned!?\n");
- from_outside = !is_signal_from_kernel(info->si_code);
+ } else {
+ /* Signal arrived while in generated client code, or while running
+ Valgrind core code. That means that every thread has these signals
+ unblocked, so we can't rely on the kernel to route them properly, so
+ we need to queue them manually. */
+ if (VG_(clo_trace_signals))
+ VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
- if (VG_(clo_trace_signals)) {
- VG_DMSG("sync signal handler: "
- "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s",
- sigNo, info->si_code, VG_(get_IP)(tid),
- VG_UCONTEXT_INSTR_PTR(uc),
- ( from_outside ? "outside" : "inside" ));
- }
- vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
-
- /* // debug code:
- if (0) {
- VG_(printf)("info->si_signo %d\n", info->si_signo);
- VG_(printf)("info->si_errno %d\n", info->si_errno);
- VG_(printf)("info->si_code %d\n", info->si_code);
- VG_(printf)("info->si_pid %d\n", info->si_pid);
- VG_(printf)("info->si_uid %d\n", info->si_uid);
- VG_(printf)("info->si_status %d\n", info->si_status);
- VG_(printf)("info->si_addr %p\n", info->si_addr);
- }
- */
-
- /* Figure out if the signal is being sent from outside the process.
- (Why do we care?) If the signal is from the user rather than the
- kernel,, then treat it more like an async signal than a sync signal --
- that is, merely queue it for later delivery. */
-
- if (from_outside) {
- ThreadId qtid;
- /* If some user-process sent us one of these signals (ie,
- they're not the result of a faulting instruction), then treat
- it as an async signal. This is tricky because we could get
- this almost anywhere:
- - while generated client code
- Action: queue signal and return
- - while running Valgrind code
- Action: queue signal and return
- - while blocked in a syscall
- Action: make thread runnable, queue signal, resume scheduler
- */
- if (VG_(threads)[tid].status == VgTs_WaitSys) {
- /* Since this signal interrupted a syscall, it means the
- client's signal mask was applied, so we can't get here
- unless the client wants this signal right now. This means
- we can simply use the async_signalhandler. */
- if (VG_(clo_trace_signals))
- VG_DMSG("Delivering user-sent sync signal %d as async signal",
- sigNo);
-
- async_signalhandler(sigNo, info, uc);
- VG_(core_panic)("async_signalhandler returned!?\n");
- }
-
# if defined(VGO_linux)
+ /* On Linux, first we have to do a sanity check of the siginfo. */
if (info->VKI_SIGINFO_si_pid == 0) {
- /* There's a per-user limit of pending siginfo signals. If
- you exceed this, by having more than that number of
- pending signals with siginfo, then new signals are
- delivered without siginfo. This condition can be caused
- by any unrelated program you're running at the same time
- as Valgrind, if it has a large number of pending siginfo
- signals which it isn't taking delivery of.
+ /* There's a per-user limit of pending siginfo signals. If
+ you exceed this, by having more than that number of
+ pending signals with siginfo, then new signals are
+ delivered without siginfo. This condition can be caused
+ by any unrelated program you're running at the same time
+ as Valgrind, if it has a large number of pending siginfo
+ signals which it isn't taking delivery of.
- Since we depend on siginfo to work out why we were sent a
- signal and what we should do about it, we really can't
- continue unless we get it. */
+ Since we depend on siginfo to work out why we were sent a
+ signal and what we should do about it, we really can't
+ continue unless we get it. */
VG_UMSG("Signal %d (%s) appears to have lost its siginfo; "
"I can't go on.", sigNo, signame(sigNo));
VG_(printf)(
@@ -2048,115 +1981,124 @@
" is no easy way to do this. Apparently the problem was fixed in kernel\n"
" 2.6.12.\n");
- /* It's a fatal signal, so we force the default handler. */
- VG_(set_default_handler)(sigNo);
- deliver_signal(tid, info, uc);
- resume_scheduler(tid);
- VG_(exit)(99); /* If we can't resume, then just exit */
+ /* It's a fatal signal, so we force the default handler. */
+ VG_(set_default_handler)(sigNo);
+ deliver_signal(tid, info, uc);
+ resume_scheduler(tid);
+ VG_(exit)(99); /* If we can't resume, then just exit */
}
# endif
- if (VG_(clo_trace_signals))
- VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
-
- /* Since every thread has these signals unblocked, we can't rely
- on the kernel to route them properly, so we need to queue
- them manually. */
qtid = 0; /* shared pending by default */
# if defined(VGO_linux)
if (info->si_code == VKI_SI_TKILL)
- qtid = tid; /* directed to us specifically */
+ qtid = tid; /* directed to us specifically */
# endif
queue_signal(qtid, info);
+ }
+}
- return;
- } /* if (!is_signal_from_kernel(info->si_code)) */
+/* Returns True if the sync signal was due to the stack requiring extension
+ and the extension was successful.
+*/
+static Bool extend_stack_if_appropriate(ThreadId tid, vki_siginfo_t* info)
+{
+ Addr fault;
+ Addr esp;
+ NSegment const* seg;
+ NSegment const* seg_next;
- /* Check to see if someone is interested in faults. The fault
- catcher should never be set whilst we're in generated code, so
+ if (info->si_signo != VKI_SIGSEGV)
+ return False;
+
+ fault = (Addr)info->VKI_SIGINFO_si_addr;
+ esp = VG_(get_SP)(tid);
+ seg = VG_(am_find_nsegment)(fault);
+ seg_next = seg ? VG_(am_next_nsegment)( (NSegment*)seg, True/*fwds*/ )
+ : NULL;
+
+ if (VG_(clo_trace_signals)) {
+ if (seg == NULL)
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=NULL",
+ info->si_code, fault, tid, esp);
+ else
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=%#lx-%#lx",
+ info->si_code, fault, tid, esp, seg->start, seg->end);
+ }
+
+ if (info->si_code == VKI_SEGV_MAPERR
+ && seg
+ && seg->kind == SkResvn
+ && seg->smode == SmUpper
+ && seg_next
+ && seg_next->kind == SkAnonC
+ && seg->end+1 == seg_next->start
+ && fault >= (esp - VG_STACK_REDZONE_SZB)) {
+ /* If the fault address is above esp but below the current known
+ stack segment base, and it was a fault because there was
+ nothing mapped there (as opposed to a permissions fault),
+ then extend the stack segment.
+ */
+ Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
+ if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
+ if (VG_(clo_trace_signals))
+ VG_DMSG(" -> extended stack base to %#lx",
+ VG_PGROUNDDN(fault));
+ return True;
+ } else {
+ VG_UMSG("Stack overflow in thread %d: can't grow stack to %#lx",
+ tid, fault);
+ return False;
+ }
+ } else {
+ return False;
+ }
+}
+
+static
+void sync_signalhandler_from_inside ( ThreadId tid,
+ Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc )
+{
+ /* Check to see if some part of Valgrind itself is interested in faults.
+ The fault catcher should never be set whilst we're in generated code, so
check for that. AFAIK the only use of the catcher right now is
- memcheck's leak detector.
- */
+ memcheck's leak detector. */
if (fault_catcher) {
vg_assert(VG_(in_generated_code) == False);
(*fault_catcher)(sigNo, (Addr)info->VKI_SIGINFO_si_addr);
/* If the catcher returns, then it didn't handle the fault,
- so carry on panicing. */
+ so carry on panicking. */
}
- /* Special fault-handling case. We can now get signals which can
- act upon and immediately restart the faulting instruction.
- */
- if (info->si_signo == VKI_SIGSEGV) {
- Addr fault = (Addr)info->VKI_SIGINFO_si_addr;
- Addr esp = VG_(get_SP)(tid);
- NSegment const* seg
- = VG_(am_find_nsegment)(fault);
- NSegment const* seg_next
- = seg ? VG_(am_next_nsegment)( (NSegment*)seg, True/*fwds*/ )
- : NULL;
+ if (extend_stack_if_appropriate(tid, info)) {
+ /* Stack extension occurred, so we don't need to do anything else; upon
+ returning from this function, we'll restart the host (hence guest)
+ instruction. */
+ } else {
+ /* OK, this is a signal we really have to deal with. If it came
+ from the client's code, then we can jump back into the scheduler
+ and have it delivered. Otherwise it's a Valgrind bug. */
+ ThreadState *tst = VG_(get_ThreadState)(tid);
- if (VG_(clo_trace_signals)) {
- if (seg == NULL)
- VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=NULL",
- info->si_code, fault, tid, esp);
- else
- VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=%#lx-%#lx",
- info->si_code, fault, tid, esp, seg->start, seg->end);
- }
- if (info->si_code == VKI_SEGV_MAPERR
- && seg
- && seg->kind == SkResvn
- && seg->smode == SmUpper
- && seg_next
- && seg_next->kind == SkAnonC
- && seg->end+1 == seg_next->start
- && fault >= (esp - VG_STACK_REDZONE_SZB)) {
- /* If the fault address is above esp but below the current known
- stack segment base, and it was a fault because there was
- nothing mapped there (as opposed to a permissions fault),
- then extend the stack segment.
- */
- Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
- if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
- if (VG_(clo_trace_signals))
- VG_DMSG(" -> extended stack base to %#lx",
- VG_PGROUNDDN(fault));
- return; // extension succeeded, restart host (hence guest)
- // instruction
- } else
- VG_UMSG("Stack overflow in thread %d: can't grow stack to %#lx",
- tid, fault);
- }
- /* Fall into normal signal handling for all other cases */
- }
-
- /* OK, this is a signal we really have to deal with. If it came
- from the client's code, then we can jump back into the scheduler
- and have it delivered. Otherwise it's a Valgrind bug. */
- {
- ThreadState *tst
- = VG_(get_ThreadState)(VG_(lwpid_to_vgtid)(VG_(gettid)()));
-
if (VG_(sigismember)(&tst->sig_mask, sigNo)) {
- /* signal is blocked, but they're not allowed to block faults */
- VG_(set_default_handler)(sigNo);
+ /* signal is blocked, but they're not allowed to block faults */
+ VG_(set_default_handler)(sigNo);
}
if (VG_(in_generated_code)) {
- /* Can't continue; must longjmp back to the scheduler and thus
- enter the sighandler immediately. */
- deliver_signal(tid, info, uc);
- resume_scheduler(tid);
+ /* Can't continue; must longjmp back to the scheduler and thus
+ enter the sighandler immediately. */
+ deliver_signal(tid, info, uc);
+ resume_scheduler(tid);
}
/* If resume_scheduler returns or its our fault, it means we
- don't have longjmp set up, implying that we weren't running
- client code, and therefore it was actually generated by
- Valgrind internally.
+ don't have longjmp set up, implying that we weren't running
+ client code, and therefore it was actually generated by
+ Valgrind internally.
*/
VG_DMSG("VALGRIND INTERNAL ERROR: Valgrind received "
"a signal %d (%s) - exiting",
@@ -2167,7 +2109,7 @@
VG_UCONTEXT_STACK_PTR(uc));
if (0)
- VG_(kill_self)(sigNo); /* generate a core dump */
+ VG_(kill_self)(sigNo); /* generate a core dump */
//if (tid == 0) /* could happen after everyone has exited */
// tid = VG_(master_tid);
@@ -2181,7 +2123,83 @@
}
}
+/*
+ Receive a sync signal from the host.
+*/
+/* Darwin inside-vs-outside examples:
+ Segfault from within the same process (sync signal)
+ info->si_signo 11
+ info->si_errno 0
+ info->si_code 1
+ info->si_pid 0
+ info->si_uid 0
+ info->si_status 0
+ info->si_addr 0x90000000
+ Segfault from outside this process (async signal)
+ sync_sighandler(11, 0xF21ACDF4, 0xF21ACE34)
+ info->si_signo 11
+ info->si_errno 0
+ info->si_code 0
+ info->si_pid 0
+ info->si_uid 0
+ info->si_status 0
+ info->si_addr 0xF00C2E90
+*/
+static
+void sync_signalhandler ( Int sigNo,
+ vki_siginfo_t *info, struct vki_ucontext *uc )
+{
+ ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
+ Bool from_outside;
+ if (0)
+ VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
+
+ vg_assert(info != NULL);
+ vg_assert(info->si_signo == sigNo);
+ vg_assert(sigNo == VKI_SIGSEGV ||
+ sigNo == VKI_SIGBUS ||
+ sigNo == VKI_SIGFPE ||
+ sigNo == VKI_SIGILL ||
+ sigNo == VKI_SIGTRAP);
+
+ info->si_code = sanitize_si_code(info->si_code);
+
+ from_outside = !is_signal_from_kernel(info->si_code);
+
+ if (VG_(clo_trace_signals)) {
+ VG_DMSG("sync signal handler: "
+ "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s",
+ sigNo, info->si_code, VG_(get_IP)(tid),
+ VG_UCONTEXT_INSTR_PTR(uc),
+ ( from_outside ? "outside" : "inside" ));
+ }
+ vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
+
+ /* // debug code:
+ if (0) {
+ VG_(printf)("info->si_signo %d\n", info->si_signo);
+ VG_(printf)("info->si_errno %d\n", info->si_errno);
+ VG_(printf)("info->si_code %d\n", info->si_code);
+ VG_(printf)("info->si_pid %d\n", info->si_pid);
+ VG_(printf)("info->si_uid %d\n", info->si_uid);
+ VG_(printf)("info->si_status %d\n", info->si_status);
+ VG_(printf)("info->si_addr %p\n", info->si_addr);
+ }
+ */
+
+ /* Figure out if the signal is being sent from outside the process.
+ (Why do we care?) If the signal is from the user rather than the
+ kernel, then treat it more like an async signal than a sync signal --
+ that is, merely queue it for later delivery. */
+ if (from_outside) {
+ sync_signalhandler_from_outside(tid, sigNo, info, uc);
+ } else {
+ sync_signalhandler_from_inside( tid, sigNo, info, uc);
+ }
+}
+
+
/*
Kill this thread. Makes it leave any syscall it might be currently
blocked in, and return to the scheduler. This doesn't mark the thread
|
|
From: Bart V. A. <bar...@gm...> - 2009-04-30 07:50:15
|
Nightly build on georgia-tech-cellbuzz-native ( cellbuzz, ppc64, Fedora 7, native ) started at 2009-04-30 02:08:40 EDT Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 407 tests, 36 stderr failures, 12 stdout failures, 0 post failures == exp-ptrcheck/tests/bad_percentify (stdout) exp-ptrcheck/tests/bad_percentify (stderr) exp-ptrcheck/tests/base (stderr) exp-ptrcheck/tests/ccc (stderr) exp-ptrcheck/tests/fp (stderr) exp-ptrcheck/tests/globalerr (stderr) exp-ptrcheck/tests/hackedbz2 (stdout) exp-ptrcheck/tests/hackedbz2 (stderr) exp-ptrcheck/tests/hp_bounds (stderr) exp-ptrcheck/tests/hp_dangle (stderr) exp-ptrcheck/tests/justify (stderr) exp-ptrcheck/tests/partial_bad (stderr) exp-ptrcheck/tests/partial_good (stderr) exp-ptrcheck/tests/preen_invars (stdout) exp-ptrcheck/tests/preen_invars (stderr) exp-ptrcheck/tests/pth_create (stderr) exp-ptrcheck/tests/pth_specific (stderr) exp-ptrcheck/tests/realloc (stderr) exp-ptrcheck/tests/stackerr (stderr) exp-ptrcheck/tests/strcpy (stderr) exp-ptrcheck/tests/supp (stderr) exp-ptrcheck/tests/tricky (stderr) exp-ptrcheck/tests/unaligned (stderr) exp-ptrcheck/tests/zero (stderr) helgrind/tests/hg05_race2 (stderr) memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cases-full (stderr) memcheck/tests/leak-cases-summary (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/origin5-bz2 (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/wrap8 (stderr) none/tests/linux/mremap (stderr) none/tests/linux/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-vmx (stdout) none/tests/ppc32/round (stdout) none/tests/ppc32/test_gx (stdout) none/tests/ppc64/jm-fp (stdout) none/tests/ppc64/jm-vmx (stdout) none/tests/ppc64/round (stdout) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) |
|
From: <sv...@va...> - 2009-04-30 07:41:28
|
Author: njn
Date: 2009-04-30 08:41:24 +0100 (Thu, 30 Apr 2009)
New Revision: 9702
Log:
Split up sync_sighandler into three functions, and refactor the code within
those functions a bit. The net result is that the control flow is much more
obvious now.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 05:25:26 UTC (rev 9701)
+++ trunk/coregrind/m_signals.c 2009-04-30 07:41:24 UTC (rev 9702)
@@ -1756,97 +1756,49 @@
fault_catcher = catcher;
}
-
-/*
- Receive a sync signal from the host.
-*/
static
-void sync_signalhandler ( Int sigNo,
- vki_siginfo_t *info, struct vki_ucontext *uc )
+void sync_signalhandler_from_outside ( ThreadId tid,
+ Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc )
{
- ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
- Bool from_outside;
+ ThreadId qtid;
- if (0)
- VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
+ /* If some user-process sent us a sync signal (ie, they're not the result
+ of a faulting instruction), then how we treat it depends on when it
+ arrives... */
- vg_assert(info != NULL);
- vg_assert(info->si_signo == sigNo);
- vg_assert(sigNo == VKI_SIGSEGV ||
- sigNo == VKI_SIGBUS ||
- sigNo == VKI_SIGFPE ||
- sigNo == VKI_SIGILL ||
- sigNo == VKI_SIGTRAP);
+ if (VG_(threads)[tid].status == VgTs_WaitSys) {
+ /* Signal arrived while we're blocked in a syscall. This means that
+ the client's signal mask was applied. In other words, so we can't
+ get here unless the client wants this signal right now. This means
+ we can simply use the async_signalhandler. */
+ if (VG_(clo_trace_signals))
+ VG_DMSG("Delivering user-sent sync signal %d as async signal", sigNo);
- info->si_code = sanitize_si_code(info->si_code);
+ async_signalhandler(sigNo, info, uc);
+ VG_(core_panic)("async_signalhandler returned!?\n");
- from_outside = !is_signal_from_kernel(info->si_code);
+ } else {
+ /* Signal arrived while in generated client code, or while running
+ Valgrind core code. That means that every thread has these signals
+ unblocked, so we can't rely on the kernel to route them properly, so
+ we need to queue them manually. */
+ if (VG_(clo_trace_signals))
+ VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
- if (VG_(clo_trace_signals)) {
- VG_DMSG("sync signal handler: "
- "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s",
- sigNo, info->si_code, VG_(get_IP)(tid),
- VG_UCONTEXT_INSTR_PTR(uc),
- ( from_outside ? "outside" : "inside" ));
- }
- vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
-
- /* // debug code:
- if (0) {
- VG_(printf)("info->si_signo %d\n", info->si_signo);
- VG_(printf)("info->si_errno %d\n", info->si_errno);
- VG_(printf)("info->si_code %d\n", info->si_code);
- VG_(printf)("info->si_pid %d\n", info->si_pid);
- VG_(printf)("info->si_uid %d\n", info->si_uid);
- VG_(printf)("info->si_status %d\n", info->si_status);
- VG_(printf)("info->si_addr %p\n", info->si_addr);
- }
- */
-
- /* Figure out if the signal is being sent from outside the process.
- (Why do we care?) If the signal is from the user rather than the
- kernel,, then treat it more like an async signal than a sync signal --
- that is, merely queue it for later delivery. */
-
- if (from_outside) {
- ThreadId qtid;
- /* If some user-process sent us one of these signals (ie,
- they're not the result of a faulting instruction), then treat
- it as an async signal. This is tricky because we could get
- this almost anywhere:
- - while generated client code
- Action: queue signal and return
- - while running Valgrind code
- Action: queue signal and return
- - while blocked in a syscall
- Action: make thread runnable, queue signal, resume scheduler
- */
- if (VG_(threads)[tid].status == VgTs_WaitSys) {
- /* Since this signal interrupted a syscall, it means the
- client's signal mask was applied, so we can't get here
- unless the client wants this signal right now. This means
- we can simply use the async_signalhandler. */
- if (VG_(clo_trace_signals))
- VG_DMSG("Delivering user-sent sync signal %d as async signal",
- sigNo);
-
- async_signalhandler(sigNo, info, uc);
- VG_(core_panic)("async_signalhandler returned!?\n");
- }
-
# if defined(VGO_linux)
+ /* On Linux, first we have to do a sanity check of the siginfo. */
if (info->VKI_SIGINFO_si_pid == 0) {
- /* There's a per-user limit of pending siginfo signals. If
- you exceed this, by having more than that number of
- pending signals with siginfo, then new signals are
- delivered without siginfo. This condition can be caused
- by any unrelated program you're running at the same time
- as Valgrind, if it has a large number of pending siginfo
- signals which it isn't taking delivery of.
+ /* There's a per-user limit of pending siginfo signals. If
+ you exceed this, by having more than that number of
+ pending signals with siginfo, then new signals are
+ delivered without siginfo. This condition can be caused
+ by any unrelated program you're running at the same time
+ as Valgrind, if it has a large number of pending siginfo
+ signals which it isn't taking delivery of.
- Since we depend on siginfo to work out why we were sent a
- signal and what we should do about it, we really can't
- continue unless we get it. */
+ Since we depend on siginfo to work out why we were sent a
+ signal and what we should do about it, we really can't
+ continue unless we get it. */
VG_UMSG("Signal %d (%s) appears to have lost its siginfo; "
"I can't go on.", sigNo, signame(sigNo));
VG_(printf)(
@@ -1861,115 +1813,124 @@
" is no easy way to do this. Apparently the problem was fixed in kernel\n"
" 2.6.12.\n");
- /* It's a fatal signal, so we force the default handler. */
- VG_(set_default_handler)(sigNo);
- deliver_signal(tid, info, uc);
- resume_scheduler(tid);
- VG_(exit)(99); /* If we can't resume, then just exit */
+ /* It's a fatal signal, so we force the default handler. */
+ VG_(set_default_handler)(sigNo);
+ deliver_signal(tid, info, uc);
+ resume_scheduler(tid);
+ VG_(exit)(99); /* If we can't resume, then just exit */
}
# endif
- if (VG_(clo_trace_signals))
- VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
-
- /* Since every thread has these signals unblocked, we can't rely
- on the kernel to route them properly, so we need to queue
- them manually. */
qtid = 0; /* shared pending by default */
# if defined(VGO_linux)
if (info->si_code == VKI_SI_TKILL)
- qtid = tid; /* directed to us specifically */
+ qtid = tid; /* directed to us specifically */
# endif
queue_signal(qtid, info);
+ }
+}
- return;
- } /* if (!is_signal_from_kernel(info->si_code)) */
+/* Returns True if the sync signal was due to the stack requiring extension
+ and the extension was successful.
+*/
+static Bool extend_stack_if_appropriate(ThreadId tid, vki_siginfo_t* info)
+{
+ Addr fault;
+ Addr esp;
+ NSegment const* seg;
+ NSegment const* seg_next;
- /* Check to see if someone is interested in faults. The fault
- catcher should never be set whilst we're in generated code, so
+ if (info->si_signo != VKI_SIGSEGV)
+ return False;
+
+ fault = (Addr)info->VKI_SIGINFO_si_addr;
+ esp = VG_(get_SP)(tid);
+ seg = VG_(am_find_nsegment)(fault);
+ seg_next = seg ? VG_(am_next_nsegment)( (NSegment*)seg, True/*fwds*/ )
+ : NULL;
+
+ if (VG_(clo_trace_signals)) {
+ if (seg == NULL)
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=NULL",
+ info->si_code, fault, tid, esp);
+ else
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=%#lx-%#lx",
+ info->si_code, fault, tid, esp, seg->start, seg->end);
+ }
+
+ if (info->si_code == VKI_SEGV_MAPERR
+ && seg
+ && seg->kind == SkResvn
+ && seg->smode == SmUpper
+ && seg_next
+ && seg_next->kind == SkAnonC
+ && seg->end+1 == seg_next->start
+ && fault >= (esp - VG_STACK_REDZONE_SZB)) {
+ /* If the fault address is above esp but below the current known
+ stack segment base, and it was a fault because there was
+ nothing mapped there (as opposed to a permissions fault),
+ then extend the stack segment.
+ */
+ Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
+ if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
+ if (VG_(clo_trace_signals))
+ VG_DMSG(" -> extended stack base to %#lx",
+ VG_PGROUNDDN(fault));
+ return True;
+ } else {
+ VG_UMSG("Stack overflow in thread %d: can't grow stack to %#lx",
+ tid, fault);
+ return False;
+ }
+ } else {
+ return False;
+ }
+}
+
+static
+void sync_signalhandler_from_inside ( ThreadId tid,
+ Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc )
+{
+ /* Check to see if some part of Valgrind itself is interested in faults.
+ The fault catcher should never be set whilst we're in generated code, so
check for that. AFAIK the only use of the catcher right now is
- memcheck's leak detector.
- */
+ memcheck's leak detector. */
if (fault_catcher) {
vg_assert(VG_(in_generated_code) == False);
(*fault_catcher)(sigNo, (Addr)info->VKI_SIGINFO_si_addr);
/* If the catcher returns, then it didn't handle the fault,
- so carry on panicing. */
+ so carry on panicking. */
}
- /* Special fault-handling case. We can now get signals which can
- act upon and immediately restart the faulting instruction.
- */
- if (info->si_signo == VKI_SIGSEGV) {
- Addr fault = (Addr)info->VKI_SIGINFO_si_addr;
- Addr esp = VG_(get_SP)(tid);
- NSegment const* seg
- = VG_(am_find_nsegment)(fault);
- NSegment const* seg_next
- = seg ? VG_(am_next_nsegment)( (NSegment*)seg, True/*fwds*/ )
- : NULL;
+ if (extend_stack_if_appropriate(tid, info)) {
+ /* Stack extension occurred, so we don't need to do anything else; upon
+ returning from this function, we'll restart the host (hence guest)
+ instruction. */
+ } else {
+ /* OK, this is a signal we really have to deal with. If it came
+ from the client's code, then we can jump back into the scheduler
+ and have it delivered. Otherwise it's a Valgrind bug. */
+ ThreadState *tst = VG_(get_ThreadState)(tid);
- if (VG_(clo_trace_signals)) {
- if (seg == NULL)
- VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=NULL",
- info->si_code, fault, tid, esp);
- else
- VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=%#lx-%#lx",
- info->si_code, fault, tid, esp, seg->start, seg->end);
- }
- if (info->si_code == VKI_SEGV_MAPERR
- && seg
- && seg->kind == SkResvn
- && seg->smode == SmUpper
- && seg_next
- && seg_next->kind == SkAnonC
- && seg->end+1 == seg_next->start
- && fault >= (esp - VG_STACK_REDZONE_SZB)) {
- /* If the fault address is above esp but below the current known
- stack segment base, and it was a fault because there was
- nothing mapped there (as opposed to a permissions fault),
- then extend the stack segment.
- */
- Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
- if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
- if (VG_(clo_trace_signals))
- VG_DMSG(" -> extended stack base to %#lx",
- VG_PGROUNDDN(fault));
- return; // extension succeeded, restart host (hence guest)
- // instruction
- } else
- VG_UMSG("Stack overflow in thread %d: can't grow stack to %#lx",
- tid, fault);
- }
- /* Fall into normal signal handling for all other cases */
- }
-
- /* OK, this is a signal we really have to deal with. If it came
- from the client's code, then we can jump back into the scheduler
- and have it delivered. Otherwise it's a Valgrind bug. */
- {
- ThreadState *tst
- = VG_(get_ThreadState)(VG_(lwpid_to_vgtid)(VG_(gettid)()));
-
if (VG_(sigismember)(&tst->sig_mask, sigNo)) {
- /* signal is blocked, but they're not allowed to block faults */
- VG_(set_default_handler)(sigNo);
+ /* signal is blocked, but they're not allowed to block faults */
+ VG_(set_default_handler)(sigNo);
}
if (VG_(in_generated_code)) {
- /* Can't continue; must longjmp back to the scheduler and thus
- enter the sighandler immediately. */
- deliver_signal(tid, info, uc);
- resume_scheduler(tid);
+ /* Can't continue; must longjmp back to the scheduler and thus
+ enter the sighandler immediately. */
+ deliver_signal(tid, info, uc);
+ resume_scheduler(tid);
}
/* If resume_scheduler returns or its our fault, it means we
- don't have longjmp set up, implying that we weren't running
- client code, and therefore it was actually generated by
- Valgrind internally.
+ don't have longjmp set up, implying that we weren't running
+ client code, and therefore it was actually generated by
+ Valgrind internally.
*/
VG_DMSG("VALGRIND INTERNAL ERROR: Valgrind received "
"a signal %d (%s) - exiting",
@@ -1980,7 +1941,7 @@
VG_UCONTEXT_STACK_PTR(uc));
if (0)
- VG_(kill_self)(sigNo); /* generate a core dump */
+ VG_(kill_self)(sigNo); /* generate a core dump */
//if (tid == 0) /* could happen after everyone has exited */
// tid = VG_(master_tid);
@@ -1994,7 +1955,64 @@
}
}
+/*
+ Receive a sync signal from the host.
+*/
+static
+void sync_signalhandler ( Int sigNo,
+ vki_siginfo_t *info, struct vki_ucontext *uc )
+{
+ ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
+ Bool from_outside;
+ if (0)
+ VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
+
+ vg_assert(info != NULL);
+ vg_assert(info->si_signo == sigNo);
+ vg_assert(sigNo == VKI_SIGSEGV ||
+ sigNo == VKI_SIGBUS ||
+ sigNo == VKI_SIGFPE ||
+ sigNo == VKI_SIGILL ||
+ sigNo == VKI_SIGTRAP);
+
+ info->si_code = sanitize_si_code(info->si_code);
+
+ from_outside = !is_signal_from_kernel(info->si_code);
+
+ if (VG_(clo_trace_signals)) {
+ VG_DMSG("sync signal handler: "
+ "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s",
+ sigNo, info->si_code, VG_(get_IP)(tid),
+ VG_UCONTEXT_INSTR_PTR(uc),
+ ( from_outside ? "outside" : "inside" ));
+ }
+ vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
+
+ /* // debug code:
+ if (0) {
+ VG_(printf)("info->si_signo %d\n", info->si_signo);
+ VG_(printf)("info->si_errno %d\n", info->si_errno);
+ VG_(printf)("info->si_code %d\n", info->si_code);
+ VG_(printf)("info->si_pid %d\n", info->si_pid);
+ VG_(printf)("info->si_uid %d\n", info->si_uid);
+ VG_(printf)("info->si_status %d\n", info->si_status);
+ VG_(printf)("info->si_addr %p\n", info->si_addr);
+ }
+ */
+
+ /* Figure out if the signal is being sent from outside the process.
+ (Why do we care?) If the signal is from the user rather than the
+ kernel, then treat it more like an async signal than a sync signal --
+ that is, merely queue it for later delivery. */
+ if (from_outside) {
+ sync_signalhandler_from_outside(tid, sigNo, info, uc);
+ } else {
+ sync_signalhandler_from_inside( tid, sigNo, info, uc);
+ }
+}
+
+
/*
Kill this thread. Makes it leave any syscall it might be currently
blocked in, and return to the scheduler. This doesn't mark the thread
|
|
From: <sv...@va...> - 2009-04-30 05:25:29
|
Author: njn Date: 2009-04-30 06:25:26 +0100 (Thu, 30 Apr 2009) New Revision: 9701 Log: Merge r9700 (remove VKI_SI_TKILL from some platforms) from the trunk. Modified: branches/DARWIN/include/vki/vki-darwin.h branches/DARWIN/include/vki/vki-ppc32-aix5.h branches/DARWIN/include/vki/vki-ppc64-aix5.h Modified: branches/DARWIN/include/vki/vki-darwin.h =================================================================== --- branches/DARWIN/include/vki/vki-darwin.h 2009-04-30 05:23:22 UTC (rev 9700) +++ branches/DARWIN/include/vki/vki-darwin.h 2009-04-30 05:25:26 UTC (rev 9701) @@ -445,7 +445,6 @@ #define VKI_SA_USERTRAMP SA_USERTRAMP #define VKI_SA_64REGSET SA_64REGSET #define VKI_SA_RESTORER 0 /* Darwin doesn't have this */ -#define VKI_SI_TKILL 0 /* Darwin doesn't have this */ #define VKI_SIG_BLOCK SIG_BLOCK #define VKI_SIG_UNBLOCK SIG_UNBLOCK Modified: branches/DARWIN/include/vki/vki-ppc32-aix5.h =================================================================== --- branches/DARWIN/include/vki/vki-ppc32-aix5.h 2009-04-30 05:23:22 UTC (rev 9700) +++ branches/DARWIN/include/vki/vki-ppc32-aix5.h 2009-04-30 05:25:26 UTC (rev 9701) @@ -278,8 +278,7 @@ #define VKI_MINSIGSTKSZ 1168 -#define VKI_SI_TKILL 0 /* AIX doesn't have this */ -#define VKI_SI_USER 0 /* but it does have this */ +#define VKI_SI_USER 0 #define VKI_SIG_BLOCK 0 #define VKI_SIG_SETMASK 2 Modified: branches/DARWIN/include/vki/vki-ppc64-aix5.h =================================================================== --- branches/DARWIN/include/vki/vki-ppc64-aix5.h 2009-04-30 05:23:22 UTC (rev 9700) +++ branches/DARWIN/include/vki/vki-ppc64-aix5.h 2009-04-30 05:25:26 UTC (rev 9701) @@ -280,8 +280,7 @@ #define VKI_MINSIGSTKSZ 1200 -#define VKI_SI_TKILL 0 /* AIX doesn't have this */ -#define VKI_SI_USER 0 /* but it does have this */ +#define VKI_SI_USER 0 #define VKI_SIG_BLOCK 0 #define VKI_SIG_SETMASK 2 |
|
From: <sv...@va...> - 2009-04-30 05:23:28
|
Author: njn Date: 2009-04-30 06:23:22 +0100 (Thu, 30 Apr 2009) New Revision: 9700 Log: Remove VKI_SI_TKILL for platforms that don't have it. Modified: trunk/include/vki/vki-ppc32-aix5.h trunk/include/vki/vki-ppc64-aix5.h Modified: trunk/include/vki/vki-ppc32-aix5.h =================================================================== --- trunk/include/vki/vki-ppc32-aix5.h 2009-04-30 05:21:38 UTC (rev 9699) +++ trunk/include/vki/vki-ppc32-aix5.h 2009-04-30 05:23:22 UTC (rev 9700) @@ -278,8 +278,7 @@ #define VKI_MINSIGSTKSZ 1168 -#define VKI_SI_TKILL 0 /* AIX doesn't have this */ -#define VKI_SI_USER 0 /* but it does have this */ +#define VKI_SI_USER 0 #define VKI_SIG_BLOCK 0 #define VKI_SIG_SETMASK 2 Modified: trunk/include/vki/vki-ppc64-aix5.h =================================================================== --- trunk/include/vki/vki-ppc64-aix5.h 2009-04-30 05:21:38 UTC (rev 9699) +++ trunk/include/vki/vki-ppc64-aix5.h 2009-04-30 05:23:22 UTC (rev 9700) @@ -280,8 +280,7 @@ #define VKI_MINSIGSTKSZ 1200 -#define VKI_SI_TKILL 0 /* AIX doesn't have this */ -#define VKI_SI_USER 0 /* but it does have this */ +#define VKI_SI_USER 0 #define VKI_SIG_BLOCK 0 #define VKI_SIG_SETMASK 2 |
|
From: <sv...@va...> - 2009-04-30 05:21:41
|
Author: njn
Date: 2009-04-30 06:21:38 +0100 (Thu, 30 Apr 2009)
New Revision: 9699
Log:
Don't use obviously Linux-specific things unless on Linux. (Nb: This change
was committed to the DARWIN branch prematurely as part of 9698.)
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 05:15:36 UTC (rev 9698)
+++ trunk/coregrind/m_signals.c 2009-04-30 05:21:38 UTC (rev 9699)
@@ -1809,6 +1809,7 @@
that is, merely queue it for later delivery. */
if (from_outside) {
+ ThreadId qtid;
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
it as an async signal. This is tricky because we could get
@@ -1833,6 +1834,7 @@
VG_(core_panic)("async_signalhandler returned!?\n");
}
+# if defined(VGO_linux)
if (info->VKI_SIGINFO_si_pid == 0) {
/* There's a per-user limit of pending siginfo signals. If
you exceed this, by having more than that number of
@@ -1865,6 +1867,7 @@
resume_scheduler(tid);
VG_(exit)(99); /* If we can't resume, then just exit */
}
+# endif
if (VG_(clo_trace_signals))
VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
@@ -1872,10 +1875,12 @@
/* Since every thread has these signals unblocked, we can't rely
on the kernel to route them properly, so we need to queue
them manually. */
+ qtid = 0; /* shared pending by default */
+# if defined(VGO_linux)
if (info->si_code == VKI_SI_TKILL)
- queue_signal(tid, info); /* directed to us specifically */
- else
- queue_signal(0, info); /* shared pending */
+ qtid = tid; /* directed to us specifically */
+# endif
+ queue_signal(qtid, info);
return;
} /* if (!is_signal_from_kernel(info->si_code)) */
|
|
From: <sv...@va...> - 2009-04-30 05:15:39
|
Author: njn
Date: 2009-04-30 06:15:36 +0100 (Thu, 30 Apr 2009)
New Revision: 9698
Log:
Merged r9697 (test fixes) from the trunk.
Modified:
branches/DARWIN/coregrind/m_signals.c
branches/DARWIN/memcheck/tests/addressable.stderr.exp
branches/DARWIN/memcheck/tests/badjump.stderr.exp
branches/DARWIN/memcheck/tests/supp_unknown.stderr.exp
branches/DARWIN/none/tests/linux/blockfault.stderr.exp
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 05:09:09 UTC (rev 9697)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 05:15:36 UTC (rev 9698)
@@ -1437,10 +1437,10 @@
if (sigNo == VKI_SIGSEGV
&& info && is_signal_from_kernel(info->si_code)
&& info->si_code == VKI_SEGV_MAPERR) {
- VG_UMSG("If you believe this happened as a result of a stack" );
- VG_UMSG("overflow in your program's main thread (unlikely but");
- VG_UMSG("possible), you can try to increase the size of the" );
- VG_UMSG("main thread stack using the --main-stacksize= flag." );
+ VG_UMSG(" If you believe this happened as a result of a stack" );
+ VG_UMSG(" overflow in your program's main thread (unlikely but");
+ VG_UMSG(" possible), you can try to increase the size of the" );
+ VG_UMSG(" main thread stack using the --main-stacksize= flag." );
// FIXME: assumes main ThreadId == 1
if (VG_(is_valid_tid)(1)) {
VG_UMSG(" The main thread stack size used in this run was %d.",
@@ -1996,6 +1996,7 @@
that is, merely queue it for later delivery. */
if (from_outside) {
+ ThreadId qtid;
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
it as an async signal. This is tricky because we could get
@@ -2020,6 +2021,7 @@
VG_(core_panic)("async_signalhandler returned!?\n");
}
+# if defined(VGO_linux)
if (info->VKI_SIGINFO_si_pid == 0) {
/* There's a per-user limit of pending siginfo signals. If
you exceed this, by having more than that number of
@@ -2052,6 +2054,7 @@
resume_scheduler(tid);
VG_(exit)(99); /* If we can't resume, then just exit */
}
+# endif
if (VG_(clo_trace_signals))
VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
@@ -2059,10 +2062,12 @@
/* Since every thread has these signals unblocked, we can't rely
on the kernel to route them properly, so we need to queue
them manually. */
+ qtid = 0; /* shared pending by default */
+# if defined(VGO_linux)
if (info->si_code == VKI_SI_TKILL)
- queue_signal(tid, info); /* directed to us specifically */
- else
- queue_signal(0, info); /* shared pending */
+ qtid = tid; /* directed to us specifically */
+# endif
+ queue_signal(qtid, info);
return;
} /* if (!is_signal_from_kernel(info->si_code)) */
Modified: branches/DARWIN/memcheck/tests/addressable.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/addressable.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
+++ branches/DARWIN/memcheck/tests/addressable.stderr.exp 2009-04-30 05:15:36 UTC (rev 9698)
@@ -19,9 +19,10 @@
Bad memory (SIGSEGV or SIGBUS) at address 0x........
at 0x........: test2 (addressable.c:51)
by 0x........: main (addressable.c:125)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Modified: branches/DARWIN/memcheck/tests/badjump.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/badjump.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
+++ branches/DARWIN/memcheck/tests/badjump.stderr.exp 2009-04-30 05:15:36 UTC (rev 9698)
@@ -8,9 +8,10 @@
Access not within mapped region at address 0x........
at 0x........: ???
by 0x........: (below main)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Modified: branches/DARWIN/memcheck/tests/supp_unknown.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/supp_unknown.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
+++ branches/DARWIN/memcheck/tests/supp_unknown.stderr.exp 2009-04-30 05:15:36 UTC (rev 9698)
@@ -3,7 +3,8 @@
Access not within mapped region at address 0x........
at 0x........: ???
by 0x........: (below main)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
Modified: branches/DARWIN/none/tests/linux/blockfault.stderr.exp
===================================================================
--- branches/DARWIN/none/tests/linux/blockfault.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
+++ branches/DARWIN/none/tests/linux/blockfault.stderr.exp 2009-04-30 05:15:36 UTC (rev 9698)
@@ -3,8 +3,9 @@
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0x........
at 0x........: main (blockfault.c:30)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
|
|
From: <sv...@va...> - 2009-04-30 05:09:12
|
Author: njn
Date: 2009-04-30 06:09:09 +0100 (Thu, 30 Apr 2009)
New Revision: 9697
Log:
Fix test breakage caused by r9694.
Modified:
trunk/coregrind/m_signals.c
trunk/memcheck/tests/addressable.stderr.exp
trunk/memcheck/tests/badjump.stderr.exp
trunk/memcheck/tests/supp_unknown.stderr.exp
trunk/none/tests/linux/blockfault.stderr.exp
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 04:38:31 UTC (rev 9696)
+++ trunk/coregrind/m_signals.c 2009-04-30 05:09:09 UTC (rev 9697)
@@ -1330,10 +1330,10 @@
if (sigNo == VKI_SIGSEGV
&& info && is_signal_from_kernel(info->si_code)
&& info->si_code == VKI_SEGV_MAPERR) {
- VG_UMSG("If you believe this happened as a result of a stack" );
- VG_UMSG("overflow in your program's main thread (unlikely but");
- VG_UMSG("possible), you can try to increase the size of the" );
- VG_UMSG("main thread stack using the --main-stacksize= flag." );
+ VG_UMSG(" If you believe this happened as a result of a stack" );
+ VG_UMSG(" overflow in your program's main thread (unlikely but");
+ VG_UMSG(" possible), you can try to increase the size of the" );
+ VG_UMSG(" main thread stack using the --main-stacksize= flag." );
// FIXME: assumes main ThreadId == 1
if (VG_(is_valid_tid)(1)) {
VG_UMSG(" The main thread stack size used in this run was %d.",
Modified: trunk/memcheck/tests/addressable.stderr.exp
===================================================================
--- trunk/memcheck/tests/addressable.stderr.exp 2009-04-30 04:38:31 UTC (rev 9696)
+++ trunk/memcheck/tests/addressable.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
@@ -19,9 +19,10 @@
Bad memory (SIGSEGV or SIGBUS) at address 0x........
at 0x........: test2 (addressable.c:51)
by 0x........: main (addressable.c:125)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Modified: trunk/memcheck/tests/badjump.stderr.exp
===================================================================
--- trunk/memcheck/tests/badjump.stderr.exp 2009-04-30 04:38:31 UTC (rev 9696)
+++ trunk/memcheck/tests/badjump.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
@@ -8,9 +8,10 @@
Access not within mapped region at address 0x........
at 0x........: ???
by 0x........: (below main)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Modified: trunk/memcheck/tests/supp_unknown.stderr.exp
===================================================================
--- trunk/memcheck/tests/supp_unknown.stderr.exp 2009-04-30 04:38:31 UTC (rev 9696)
+++ trunk/memcheck/tests/supp_unknown.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
@@ -3,7 +3,8 @@
Access not within mapped region at address 0x........
at 0x........: ???
by 0x........: (below main)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
Modified: trunk/none/tests/linux/blockfault.stderr.exp
===================================================================
--- trunk/none/tests/linux/blockfault.stderr.exp 2009-04-30 04:38:31 UTC (rev 9696)
+++ trunk/none/tests/linux/blockfault.stderr.exp 2009-04-30 05:09:09 UTC (rev 9697)
@@ -3,8 +3,9 @@
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0x........
at 0x........: main (blockfault.c:30)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
+ If you believe this happened as a result of a stack
+ overflow in your program's main thread (unlikely but
+ possible), you can try to increase the size of the
+ main thread stack using the --main-stacksize= flag.
The main thread stack size used in this run was ....
|
|
From: <sv...@va...> - 2009-04-30 04:38:40
|
Author: njn
Date: 2009-04-30 05:38:31 +0100 (Thu, 30 Apr 2009)
New Revision: 9696
Log:
Merged r9693..r9694 (convert VG_(message) to VG_*MSG in m_signals.c) from
the trunk.
Modified:
branches/DARWIN/coregrind/m_signals.c
branches/DARWIN/include/pub_tool_libcprint.h
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 04:33:59 UTC (rev 9695)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 04:38:31 UTC (rev 9696)
@@ -753,14 +753,12 @@
VG_(sigdelset)( &ksa.sa_mask, VKI_SIGSTOP );
if (VG_(clo_trace_signals) && VG_(clo_verbosity) > 2)
- VG_(message)(Vg_DebugMsg,
- "setting ksig %d to: hdlr %p, flags 0x%lx, "
- "mask(msb..lsb) 0x%llx 0x%llx",
- sig, ksa.ksa_handler,
- (UWord)ksa.sa_flags,
- _VKI_NSIG_WORDS > 1 ? (ULong)ksa.sa_mask.sig[1] : 0,
- (ULong)ksa.sa_mask.sig[0]
- );
+ VG_DMSG("setting ksig %d to: hdlr %p, flags 0x%lx, "
+ "mask(msb..lsb) 0x%llx 0x%llx",
+ sig, ksa.ksa_handler,
+ (UWord)ksa.sa_flags,
+ _VKI_NSIG_WORDS > 1 ? (ULong)ksa.sa_mask.sig[1] : 0,
+ (ULong)ksa.sa_mask.sig[0]);
res = VG_(sigaction)( sig, &ksa, &ksa_old );
vg_assert(res == 0);
@@ -819,14 +817,13 @@
m_SP = VG_(get_SP)(tid);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "sys_sigaltstack: tid %d, "
- "ss %p{%p,sz=%llu,flags=0x%llx}, oss %p (current SP %p)",
- tid, (void*)ss,
- ss ? ss->ss_sp : 0,
- (ULong)(ss ? ss->ss_size : 0),
- (ULong)(ss ? ss->ss_flags : 0),
- (void*)oss, (void*)m_SP );
+ VG_EMSG("sys_sigaltstack: tid %d, "
+ "ss %p{%p,sz=%llu,flags=0x%llx}, oss %p (current SP %p)",
+ tid, (void*)ss,
+ ss ? ss->ss_sp : 0,
+ (ULong)(ss ? ss->ss_size : 0),
+ (ULong)(ss ? ss->ss_flags : 0),
+ (void*)oss, (void*)m_SP);
if (oss != NULL) {
oss->ss_sp = VG_(threads)[tid].altstack.ss_sp;
@@ -865,11 +862,10 @@
vki_sigaction_fromK_t* old_act )
{
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "sys_sigaction: sigNo %d, "
- "new %#lx, old %#lx, new flags 0x%llx",
- signo, (UWord)new_act, (UWord)old_act,
- (ULong)(new_act ? new_act->sa_flags : 0) );
+ VG_EMSG("sys_sigaction: sigNo %d, "
+ "new %#lx, old %#lx, new flags 0x%llx",
+ signo, (UWord)new_act, (UWord)old_act,
+ (ULong)(new_act ? new_act->sa_flags : 0));
/* Rule out various error conditions. The aim is to ensure that if
when the call is passed to the kernel it will definitely
@@ -932,31 +928,25 @@
bad_signo:
if (VG_(showing_core_errors)() && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
- "Warning: bad signal number %d in sigaction()",
- signo);
+ VG_UMSG("Warning: bad signal number %d in sigaction()", signo);
}
return VG_(mk_SysRes_Error)( VKI_EINVAL );
bad_signo_reserved:
if (VG_(showing_core_errors)() && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
- "Warning: ignored attempt to set %s handler in sigaction();",
- signame(signo));
- VG_(message)(Vg_UserMsg,
- " the %s signal is used internally by Valgrind",
- signame(signo));
+ VG_UMSG("Warning: ignored attempt to set %s handler in sigaction();",
+ signame(signo));
+ VG_UMSG(" the %s signal is used internally by Valgrind",
+ signame(signo));
}
return VG_(mk_SysRes_Error)( VKI_EINVAL );
bad_sigkill_or_sigstop:
if (VG_(showing_core_errors)() && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
- "Warning: ignored attempt to set %s handler in sigaction();",
- signame(signo));
- VG_(message)(Vg_UserMsg,
- " the %s signal is uncatchable",
- signame(signo));
+ VG_UMSG("Warning: ignored attempt to set %s handler in sigaction();",
+ signame(signo));
+ VG_UMSG(" the %s signal is uncatchable",
+ signame(signo));
}
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
@@ -1021,22 +1011,19 @@
vki_sigset_t* oldset )
{
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "do_setmask: tid = %d how = %d (%s), newset = %p (%s)",
- tid, how,
- how==VKI_SIG_BLOCK ? "SIG_BLOCK" : (
- how==VKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
- how==VKI_SIG_SETMASK ? "SIG_SETMASK" : "???")),
- newset, newset ? format_sigset(newset) : "NULL" );
+ VG_EMSG("do_setmask: tid = %d how = %d (%s), newset = %p (%s)",
+ tid, how,
+ how==VKI_SIG_BLOCK ? "SIG_BLOCK" : (
+ how==VKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
+ how==VKI_SIG_SETMASK ? "SIG_SETMASK" : "???")),
+ newset, newset ? format_sigset(newset) : "NULL" );
/* Just do this thread. */
vg_assert(VG_(is_valid_tid)(tid));
if (oldset) {
*oldset = VG_(threads)[tid].sig_mask;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "\toldset=%p %s",
- oldset, format_sigset(oldset));
+ VG_EMSG("\toldset=%p %s", oldset, format_sigset(oldset));
}
if (newset) {
do_sigprocmask_bitops (how, &VG_(threads)[tid].sig_mask, newset );
@@ -1061,8 +1048,7 @@
return VG_(mk_SysRes_Success)( 0 );
default:
- VG_(message)(Vg_DebugMsg,
- "sigprocmask: unknown 'how' field %d", how);
+ VG_DMSG("sigprocmask: unknown 'how' field %d", how);
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
}
@@ -1125,8 +1111,7 @@
tst = & VG_(threads)[tid];
if (VG_(clo_trace_signals)) {
- VG_(message)(Vg_DebugMsg,
- "push_signal_frame (thread %d): signal %d", tid, sigNo);
+ VG_DMSG("push_signal_frame (thread %d): signal %d", tid, sigNo);
VG_(get_and_pp_StackTrace)(tid, 10);
}
@@ -1140,13 +1125,11 @@
esp_top_of_frame
= (Addr)(tst->altstack.ss_sp) + tst->altstack.ss_size;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "delivering signal %d (%s) to thread %d: "
- "on ALT STACK (%p-%p; %ld bytes)",
- sigNo, signame(sigNo), tid,
- tst->altstack.ss_sp,
- (UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
- (unsigned long)tst->altstack.ss_size );
+ VG_DMSG("delivering signal %d (%s) to thread %d: "
+ "on ALT STACK (%p-%p; %ld bytes)",
+ sigNo, signame(sigNo), tid, tst->altstack.ss_sp,
+ (UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
+ (unsigned long)tst->altstack.ss_size );
/* Signal delivery to tools */
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/True );
@@ -1342,10 +1325,9 @@
vg_assert(!core || (core && terminate));
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "delivering %d (code %d) to default handler; action: %s%s",
- sigNo, info->si_code, terminate ? "terminate" : "ignore",
- core ? "+core" : "");
+ VG_DMSG("delivering %d (code %d) to default handler; action: %s%s",
+ sigNo, info->si_code, terminate ? "terminate" : "ignore",
+ core ? "+core" : "");
if (!terminate)
return; /* nothing to do */
@@ -1366,10 +1348,9 @@
(could_core && is_signal_from_kernel(info->si_code))
) &&
!VG_(clo_xml) ) {
- VG_(message)(Vg_UserMsg, "");
- VG_(message)(Vg_UserMsg,
- "Process terminating with default action of signal %d (%s)%s",
- sigNo, signame(sigNo), core ? ": dumping core" : "");
+ VG_UMSG("");
+ VG_UMSG("Process terminating with default action of signal %d (%s)%s",
+ sigNo, signame(sigNo), core ? ": dumping core" : "");
/* Be helpful - decode some more details about this fault */
if (is_signal_from_kernel(info->si_code)) {
@@ -1437,10 +1418,9 @@
if (event != NULL) {
if (haveaddr)
- VG_(message)(Vg_UserMsg, " %s at address %p",
- event, info->VKI_SIGINFO_si_addr);
+ VG_UMSG(" %s at address %p", event, info->VKI_SIGINFO_si_addr);
else
- VG_(message)(Vg_UserMsg, " %s", event);
+ VG_UMSG(" %s", event);
}
}
/* Print a stack trace. Be cautious if the thread's SP is in an
@@ -1457,17 +1437,14 @@
if (sigNo == VKI_SIGSEGV
&& info && is_signal_from_kernel(info->si_code)
&& info->si_code == VKI_SEGV_MAPERR) {
- VG_(message)(Vg_UserMsg, " If you believe this happened as a "
- "result of a stack overflow in your");
- VG_(message)(Vg_UserMsg, " program's main thread (unlikely but"
- " possible), you can try to increase");
- VG_(message)(Vg_UserMsg, " the size of the main thread stack"
- " using the --main-stacksize= flag.");
+ VG_UMSG("If you believe this happened as a result of a stack" );
+ VG_UMSG("overflow in your program's main thread (unlikely but");
+ VG_UMSG("possible), you can try to increase the size of the" );
+ VG_UMSG("main thread stack using the --main-stacksize= flag." );
// FIXME: assumes main ThreadId == 1
if (VG_(is_valid_tid)(1)) {
- VG_(message)(Vg_UserMsg,
- " The main thread stack size used in this run was %d.",
- (Int)VG_(threads)[1].client_stack_szB);
+ VG_UMSG(" The main thread stack size used in this run was %d.",
+ (Int)VG_(threads)[1].client_stack_szB);
}
}
}
@@ -1513,8 +1490,8 @@
ThreadState *tst = VG_(get_ThreadState)(tid);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,"delivering signal %d (%s):%d to thread %d",
- sigNo, signame(sigNo), info->si_code, tid );
+ VG_DMSG("delivering signal %d (%s):%d to thread %d",
+ sigNo, signame(sigNo), info->si_code, tid );
if (sigNo == VG_SIGVGKILL) {
/* If this is a SIGVGKILL, we're expecting it to interrupt any
@@ -1707,8 +1684,8 @@
sq = tst->sig_queue;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Queueing signal %d (idx %d) to thread %d",
- si->si_signo, sq->next, tid);
+ VG_DMSG("Queueing signal %d (idx %d) to thread %d",
+ si->si_signo, sq->next, tid);
/* Add signal to the queue. If the queue gets overrun, then old
queued signals may get lost.
@@ -1717,8 +1694,8 @@
least a non-siginfo signal gets deliviered.
*/
if (sq->sigs[sq->next].si_signo != 0)
- VG_(message)(Vg_UserMsg, "Signal %d being dropped from thread %d's queue",
- sq->sigs[sq->next].si_signo, tid);
+ VG_UMSG("Signal %d being dropped from thread %d's queue",
+ sq->sigs[sq->next].si_signo, tid);
sq->sigs[sq->next] = *si;
sq->next = (sq->next+1) % N_QUEUED_SIGNALS;
@@ -1753,8 +1730,8 @@
if (sq->sigs[idx].si_signo != 0 && VG_(sigismember)(set, sq->sigs[idx].si_signo)) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Returning queued signal %d (idx %d) for thread %d",
- sq->sigs[idx].si_signo, idx, tid);
+ VG_DMSG("Returning queued signal %d (idx %d) for thread %d",
+ sq->sigs[idx].si_signo, idx, tid);
ret = &sq->sigs[idx];
goto out;
}
@@ -1805,9 +1782,8 @@
info->si_code = sanitize_si_code(info->si_code);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "async signal handler: signal=%d, tid=%d, si_code=%d",
- sigNo, tid, info->si_code);
+ VG_DMSG("async signal handler: signal=%d, tid=%d, si_code=%d",
+ sigNo, tid, info->si_code);
/* Update thread state properly. The signal can only have been
delivered whilst we were in
@@ -2056,12 +2032,11 @@
Since we depend on siginfo to work out why we were sent a
signal and what we should do about it, we really can't
continue unless we get it. */
- VG_(message)(Vg_UserMsg, "Signal %d (%s) appears to have lost its siginfo; I can't go on.",
- sigNo, signame(sigNo));
- VG_(message)(Vg_UserMsg, " This may be because one of your programs has consumed your");
- VG_(message)(Vg_UserMsg, " ration of siginfo structures.");
+ VG_UMSG("Signal %d (%s) appears to have lost its siginfo; "
+ "I can't go on.", sigNo, signame(sigNo));
VG_(printf)(
-" For more information, see:\n"
+" This may be because one of your programs has consumed your ration of\n"
+" siginfo structures. For more information, see:\n"
" http://kerneltrap.org/mailarchive/1/message/25599/thread\n"
" Basically, some program on your system is building up a large queue of\n"
" pending signals, and this causes the siginfo data for other signals to\n"
@@ -2079,8 +2054,7 @@
}
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Routing user-sent sync signal %d via queue",
- sigNo);
+ VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
/* Since every thread has these signals unblocked, we can't rely
on the kernel to route them properly, so we need to queue
@@ -2120,15 +2094,13 @@
if (VG_(clo_trace_signals)) {
if (seg == NULL)
- VG_(message)(Vg_DebugMsg,
- "SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=NULL",
- info->si_code, fault, tid, esp);
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=NULL",
+ info->si_code, fault, tid, esp);
else
- VG_(message)(Vg_DebugMsg,
- "SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=%#lx-%#lx",
- info->si_code, fault, tid, esp, seg->start, seg->end);
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=%#lx-%#lx",
+ info->si_code, fault, tid, esp, seg->start, seg->end);
}
if (info->si_code == VKI_SEGV_MAPERR
&& seg
@@ -2146,15 +2118,13 @@
Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- " -> extended stack base to %#lx",
- VG_PGROUNDDN(fault));
+ VG_DMSG(" -> extended stack base to %#lx",
+ VG_PGROUNDDN(fault));
return; // extension succeeded, restart host (hence guest)
// instruction
} else
- VG_(message)(Vg_UserMsg,
- "Stack overflow in thread %d: can't grow stack to %#lx",
- tid, fault);
+ VG_UMSG("Stack overflow in thread %d: can't grow stack to %#lx",
+ tid, fault);
}
/* Fall into normal signal handling for all other cases */
}
@@ -2183,15 +2153,13 @@
client code, and therefore it was actually generated by
Valgrind internally.
*/
- VG_(message)(Vg_DebugMsg,
- "VALGRIND INTERNAL ERROR: Valgrind received "
- "a signal %d (%s) - exiting",
- sigNo, signame(sigNo));
+ VG_DMSG("VALGRIND INTERNAL ERROR: Valgrind received "
+ "a signal %d (%s) - exiting",
+ sigNo, signame(sigNo));
- VG_(message)(Vg_DebugMsg,
- "si_code=%x; Faulting address: %p; sp: %#lx",
- info->si_code, info->VKI_SIGINFO_si_addr,
- VG_UCONTEXT_STACK_PTR(uc));
+ VG_DMSG("si_code=%x; Faulting address: %p; sp: %#lx",
+ info->si_code, info->VKI_SIGINFO_si_addr,
+ VG_UCONTEXT_STACK_PTR(uc));
if (0)
VG_(kill_self)(sigNo); /* generate a core dump */
@@ -2221,8 +2189,7 @@
ThreadStatus at_signal = VG_(threads)[tid].status;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "sigvgkill for lwp %d tid %d", VG_(gettid)(), tid);
+ VG_DMSG("sigvgkill for lwp %d tid %d", VG_(gettid)(), tid);
VG_(acquire_BigLock)(tid, "sigvgkill_handler");
@@ -2312,20 +2279,19 @@
/* If there was nothing queued, ask the kernel for a pending signal */
if (sip == NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "poll_signals: got signal %d "
- "for thread %d", si.si_signo, tid);
+ VG_DMSG("poll_signals: got signal %d for thread %d",
+ si.si_signo, tid);
sip = &si;
}
if (sip != NULL) {
/* OK, something to do; deliver it */
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Polling found signal %d for tid %d",
- sip->si_signo, tid);
+ VG_DMSG("Polling found signal %d for tid %d", sip->si_signo, tid);
if (!is_sig_ign(sip->si_signo))
deliver_signal(tid, sip, NULL);
else if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, " signal %d ignored", sip->si_signo);
+ VG_DMSG(" signal %d ignored", sip->si_signo);
sip->si_signo = 0; /* remove from signal queue, if that's
where it came from */
@@ -2425,8 +2391,7 @@
}
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d",
- VG_(max_signal));
+ VG_DMSG("Max kernel-supported signal is %d", VG_(max_signal));
/* Our private internal signals are treated as ignored */
scss.scss_per_sig[VG_SIGVGKILL].scss_handler = VKI_SIG_IGN;
Modified: branches/DARWIN/include/pub_tool_libcprint.h
===================================================================
--- branches/DARWIN/include/pub_tool_libcprint.h 2009-04-30 04:33:59 UTC (rev 9695)
+++ branches/DARWIN/include/pub_tool_libcprint.h 2009-04-30 04:38:31 UTC (rev 9696)
@@ -101,6 +101,8 @@
// Short-cuts for VG_(message)().
#define VG_UMSG( format, args... ) VG_(message)(Vg_UserMsg, format, ##args)
#define VG_DMSG( format, args... ) VG_(message)(Vg_DebugMsg, format, ##args)
+#define VG_EMSG( format, args... ) VG_(message)(Vg_DebugExtraMsg, \
+ format, ##args)
#endif // __PUB_TOOL_LIBCPRINT_H
|
|
From: <sv...@va...> - 2009-04-30 04:34:09
|
Author: njn
Date: 2009-04-30 05:33:59 +0100 (Thu, 30 Apr 2009)
New Revision: 9695
Log:
Merge r9690 (improve --trace-signals=yes) from the trunk.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 04:33:32 UTC (rev 9694)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 04:33:59 UTC (rev 9695)
@@ -1805,7 +1805,8 @@
info->si_code = sanitize_si_code(info->si_code);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Async handler got signal %d for tid %d info %d",
+ VG_(message)(Vg_DebugMsg,
+ "async signal handler: signal=%d, tid=%d, si_code=%d",
sigNo, tid, info->si_code);
/* Update thread state properly. The signal can only have been
@@ -1975,6 +1976,7 @@
vki_siginfo_t *info, struct vki_ucontext *uc )
{
ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
+ Bool from_outside;
if (0)
VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
@@ -1989,6 +1991,17 @@
info->si_code = sanitize_si_code(info->si_code);
+ from_outside = !is_signal_from_kernel(info->si_code);
+
+ if (VG_(clo_trace_signals)) {
+ VG_DMSG("sync signal handler: "
+ "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s",
+ sigNo, info->si_code, VG_(get_IP)(tid),
+ VG_UCONTEXT_INSTR_PTR(uc),
+ ( from_outside ? "outside" : "inside" ));
+ }
+ vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
+
/* // debug code:
if (0) {
VG_(printf)("info->si_signo %d\n", info->si_signo);
@@ -2006,7 +2019,7 @@
kernel,, then treat it more like an async signal than a sync signal --
that is, merely queue it for later delivery. */
- if (!is_signal_from_kernel(info->si_code)) {
+ if (from_outside) {
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
it as an async signal. This is tricky because we could get
@@ -2023,6 +2036,10 @@
client's signal mask was applied, so we can't get here
unless the client wants this signal right now. This means
we can simply use the async_signalhandler. */
+ if (VG_(clo_trace_signals))
+ VG_DMSG("Delivering user-sent sync signal %d as async signal",
+ sigNo);
+
async_signalhandler(sigNo, info, uc);
VG_(core_panic)("async_signalhandler returned!?\n");
}
@@ -2076,14 +2093,6 @@
return;
} /* if (!is_signal_from_kernel(info->si_code)) */
- if (VG_(clo_trace_signals)) {
- VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=%d, "
- "EIP=%#lx, eip=%#lx",
- sigNo, info->si_code, VG_(get_IP)(tid),
- VG_UCONTEXT_INSTR_PTR(uc) );
- }
- vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
-
/* Check to see if someone is interested in faults. The fault
catcher should never be set whilst we're in generated code, so
check for that. AFAIK the only use of the catcher right now is
|
|
From: <sv...@va...> - 2009-04-30 04:33:38
|
Author: njn
Date: 2009-04-30 05:33:32 +0100 (Thu, 30 Apr 2009)
New Revision: 9694
Log:
Convert more VG_(message) calls to VG_*MSG.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 04:17:45 UTC (rev 9693)
+++ trunk/coregrind/m_signals.c 2009-04-30 04:33:32 UTC (rev 9694)
@@ -1241,7 +1241,7 @@
(could_core && is_signal_from_kernel(info->si_code))
) &&
!VG_(clo_xml) ) {
- VG_(message)(Vg_UserMsg, "");
+ VG_UMSG("");
VG_UMSG("Process terminating with default action of signal %d (%s)%s",
sigNo, signame(sigNo), core ? ": dumping core" : "");
@@ -1311,10 +1311,9 @@
if (event != NULL) {
if (haveaddr)
- VG_(message)(Vg_UserMsg, " %s at address %p",
- event, info->VKI_SIGINFO_si_addr);
+ VG_UMSG(" %s at address %p", event, info->VKI_SIGINFO_si_addr);
else
- VG_(message)(Vg_UserMsg, " %s", event);
+ VG_UMSG(" %s", event);
}
}
/* Print a stack trace. Be cautious if the thread's SP is in an
@@ -1331,12 +1330,10 @@
if (sigNo == VKI_SIGSEGV
&& info && is_signal_from_kernel(info->si_code)
&& info->si_code == VKI_SEGV_MAPERR) {
- VG_(message)(Vg_UserMsg, " If you believe this happened as a "
- "result of a stack overflow in your");
- VG_(message)(Vg_UserMsg, " program's main thread (unlikely but"
- " possible), you can try to increase");
- VG_(message)(Vg_UserMsg, " the size of the main thread stack"
- " using the --main-stacksize= flag.");
+ VG_UMSG("If you believe this happened as a result of a stack" );
+ VG_UMSG("overflow in your program's main thread (unlikely but");
+ VG_UMSG("possible), you can try to increase the size of the" );
+ VG_UMSG("main thread stack using the --main-stacksize= flag." );
// FIXME: assumes main ThreadId == 1
if (VG_(is_valid_tid)(1)) {
VG_UMSG(" The main thread stack size used in this run was %d.",
@@ -1579,8 +1576,8 @@
least a non-siginfo signal gets deliviered.
*/
if (sq->sigs[sq->next].si_signo != 0)
- VG_(message)(Vg_UserMsg, "Signal %d being dropped from thread %d's queue",
- sq->sigs[sq->next].si_signo, tid);
+ VG_UMSG("Signal %d being dropped from thread %d's queue",
+ sq->sigs[sq->next].si_signo, tid);
sq->sigs[sq->next] = *si;
sq->next = (sq->next+1) % N_QUEUED_SIGNALS;
@@ -1848,12 +1845,11 @@
Since we depend on siginfo to work out why we were sent a
signal and what we should do about it, we really can't
continue unless we get it. */
- VG_(message)(Vg_UserMsg, "Signal %d (%s) appears to have lost its siginfo; I can't go on.",
- sigNo, signame(sigNo));
- VG_(message)(Vg_UserMsg, " This may be because one of your programs has consumed your");
- VG_(message)(Vg_UserMsg, " ration of siginfo structures.");
+ VG_UMSG("Signal %d (%s) appears to have lost its siginfo; "
+ "I can't go on.", sigNo, signame(sigNo));
VG_(printf)(
-" For more information, see:\n"
+" This may be because one of your programs has consumed your ration of\n"
+" siginfo structures. For more information, see:\n"
" http://kerneltrap.org/mailarchive/1/message/25599/thread\n"
" Basically, some program on your system is building up a large queue of\n"
" pending signals, and this causes the siginfo data for other signals to\n"
|
|
From: <sv...@va...> - 2009-04-30 04:17:49
|
Author: njn
Date: 2009-04-30 05:17:45 +0100 (Thu, 30 Apr 2009)
New Revision: 9693
Log:
Converted VG_(message) calls in m_signals.c to VG_*MSG macros, for brevity.
Converted lots of tabs on modified lines to spaces as well.
Modified:
trunk/coregrind/m_signals.c
trunk/include/pub_tool_libcprint.h
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 04:01:57 UTC (rev 9692)
+++ trunk/coregrind/m_signals.c 2009-04-30 04:17:45 UTC (rev 9693)
@@ -672,14 +672,12 @@
VG_(sigdelset)( &ksa.sa_mask, VKI_SIGSTOP );
if (VG_(clo_trace_signals) && VG_(clo_verbosity) > 2)
- VG_(message)(Vg_DebugMsg,
- "setting ksig %d to: hdlr %p, flags 0x%lx, "
- "mask(63..0) 0x%lx 0x%lx",
- sig, ksa.ksa_handler,
- (UWord)ksa.sa_flags,
- (UWord)ksa.sa_mask.sig[1],
- (UWord)ksa.sa_mask.sig[0]
- );
+ VG_DMSG("setting ksig %d to: hdlr %p, flags 0x%lx, "
+ "mask(63..0) 0x%lx 0x%lx",
+ sig, ksa.ksa_handler,
+ (UWord)ksa.sa_flags,
+ (UWord)ksa.sa_mask.sig[1],
+ (UWord)ksa.sa_mask.sig[0]);
res = VG_(sigaction)( sig, &ksa, &ksa_old );
vg_assert(res == 0);
@@ -737,14 +735,13 @@
m_SP = VG_(get_SP)(tid);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "sys_sigaltstack: tid %d, "
- "ss %p{%p,sz=%llu,flags=0x%llx}, oss %p (current SP %p)",
- tid, (void*)ss,
- ss ? ss->ss_sp : 0,
- (ULong)(ss ? ss->ss_size : 0),
- (ULong)(ss ? ss->ss_flags : 0),
- (void*)oss, (void*)m_SP );
+ VG_EMSG("sys_sigaltstack: tid %d, "
+ "ss %p{%p,sz=%llu,flags=0x%llx}, oss %p (current SP %p)",
+ tid, (void*)ss,
+ ss ? ss->ss_sp : 0,
+ (ULong)(ss ? ss->ss_size : 0),
+ (ULong)(ss ? ss->ss_flags : 0),
+ (void*)oss, (void*)m_SP);
if (oss != NULL) {
oss->ss_sp = VG_(threads)[tid].altstack.ss_sp;
@@ -783,11 +780,10 @@
struct vki_sigaction *old_act )
{
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "sys_sigaction: sigNo %d, "
- "new %#lx, old %#lx, new flags 0x%llx",
- signo, (UWord)new_act, (UWord)old_act,
- (ULong)(new_act ? new_act->sa_flags : 0) );
+ VG_EMSG("sys_sigaction: sigNo %d, "
+ "new %#lx, old %#lx, new flags 0x%llx",
+ signo, (UWord)new_act, (UWord)old_act,
+ (ULong)(new_act ? new_act->sa_flags : 0));
/* Rule out various error conditions. The aim is to ensure that if
when the call is passed to the kernel it will definitely
@@ -843,31 +839,25 @@
bad_signo:
if (VG_(showing_core_errors)() && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
- "Warning: bad signal number %d in sigaction()",
- signo);
+ VG_UMSG("Warning: bad signal number %d in sigaction()", signo);
}
return VG_(mk_SysRes_Error)( VKI_EINVAL );
bad_signo_reserved:
if (VG_(showing_core_errors)() && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
- "Warning: ignored attempt to set %s handler in sigaction();",
- signame(signo));
- VG_(message)(Vg_UserMsg,
- " the %s signal is used internally by Valgrind",
- signame(signo));
+ VG_UMSG("Warning: ignored attempt to set %s handler in sigaction();",
+ signame(signo));
+ VG_UMSG(" the %s signal is used internally by Valgrind",
+ signame(signo));
}
return VG_(mk_SysRes_Error)( VKI_EINVAL );
bad_sigkill_or_sigstop:
if (VG_(showing_core_errors)() && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
- "Warning: ignored attempt to set %s handler in sigaction();",
- signame(signo));
- VG_(message)(Vg_UserMsg,
- " the %s signal is uncatchable",
- signame(signo));
+ VG_UMSG("Warning: ignored attempt to set %s handler in sigaction();",
+ signame(signo));
+ VG_UMSG(" the %s signal is uncatchable",
+ signame(signo));
}
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
@@ -932,22 +922,19 @@
vki_sigset_t* oldset )
{
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "do_setmask: tid = %d how = %d (%s), newset = %p (%s)",
- tid, how,
- how==VKI_SIG_BLOCK ? "SIG_BLOCK" : (
- how==VKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
- how==VKI_SIG_SETMASK ? "SIG_SETMASK" : "???")),
- newset, newset ? format_sigset(newset) : "NULL" );
+ VG_EMSG("do_setmask: tid = %d how = %d (%s), newset = %p (%s)",
+ tid, how,
+ how==VKI_SIG_BLOCK ? "SIG_BLOCK" : (
+ how==VKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
+ how==VKI_SIG_SETMASK ? "SIG_SETMASK" : "???")),
+ newset, newset ? format_sigset(newset) : "NULL" );
/* Just do this thread. */
vg_assert(VG_(is_valid_tid)(tid));
if (oldset) {
*oldset = VG_(threads)[tid].sig_mask;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugExtraMsg,
- "\toldset=%p %s",
- oldset, format_sigset(oldset));
+ VG_EMSG("\toldset=%p %s", oldset, format_sigset(oldset));
}
if (newset) {
do_sigprocmask_bitops (how, &VG_(threads)[tid].sig_mask, newset );
@@ -972,8 +959,7 @@
return VG_(mk_SysRes_Success)( 0 );
default:
- VG_(message)(Vg_DebugMsg,
- "sigprocmask: unknown 'how' field %d", how);
+ VG_DMSG("sigprocmask: unknown 'how' field %d", how);
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
}
@@ -1036,8 +1022,7 @@
tst = & VG_(threads)[tid];
if (VG_(clo_trace_signals)) {
- VG_(message)(Vg_DebugMsg,
- "push_signal_frame (thread %d): signal %d", tid, sigNo);
+ VG_DMSG("push_signal_frame (thread %d): signal %d", tid, sigNo);
VG_(get_and_pp_StackTrace)(tid, 10);
}
@@ -1051,13 +1036,11 @@
esp_top_of_frame
= (Addr)(tst->altstack.ss_sp) + tst->altstack.ss_size;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "delivering signal %d (%s) to thread %d: "
- "on ALT STACK (%p-%p; %ld bytes)",
- sigNo, signame(sigNo), tid,
- tst->altstack.ss_sp,
- (UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
- (unsigned long)tst->altstack.ss_size );
+ VG_DMSG("delivering signal %d (%s) to thread %d: "
+ "on ALT STACK (%p-%p; %ld bytes)",
+ sigNo, signame(sigNo), tid, tst->altstack.ss_sp,
+ (UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
+ (unsigned long)tst->altstack.ss_size );
/* Signal delivery to tools */
VG_TRACK( pre_deliver_signal, tid, sigNo, /*alt_stack*/True );
@@ -1235,10 +1218,9 @@
vg_assert(!core || (core && terminate));
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "delivering %d (code %d) to default handler; action: %s%s",
- sigNo, info->si_code, terminate ? "terminate" : "ignore",
- core ? "+core" : "");
+ VG_DMSG("delivering %d (code %d) to default handler; action: %s%s",
+ sigNo, info->si_code, terminate ? "terminate" : "ignore",
+ core ? "+core" : "");
if (!terminate)
return; /* nothing to do */
@@ -1260,9 +1242,8 @@
) &&
!VG_(clo_xml) ) {
VG_(message)(Vg_UserMsg, "");
- VG_(message)(Vg_UserMsg,
- "Process terminating with default action of signal %d (%s)%s",
- sigNo, signame(sigNo), core ? ": dumping core" : "");
+ VG_UMSG("Process terminating with default action of signal %d (%s)%s",
+ sigNo, signame(sigNo), core ? ": dumping core" : "");
/* Be helpful - decode some more details about this fault */
if (is_signal_from_kernel(info->si_code)) {
@@ -1358,9 +1339,8 @@
" using the --main-stacksize= flag.");
// FIXME: assumes main ThreadId == 1
if (VG_(is_valid_tid)(1)) {
- VG_(message)(Vg_UserMsg,
- " The main thread stack size used in this run was %d.",
- (Int)VG_(threads)[1].client_stack_szB);
+ VG_UMSG(" The main thread stack size used in this run was %d.",
+ (Int)VG_(threads)[1].client_stack_szB);
}
}
}
@@ -1406,8 +1386,8 @@
ThreadState *tst = VG_(get_ThreadState)(tid);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,"delivering signal %d (%s):%d to thread %d",
- sigNo, signame(sigNo), info->si_code, tid );
+ VG_DMSG("delivering signal %d (%s):%d to thread %d",
+ sigNo, signame(sigNo), info->si_code, tid );
if (sigNo == VG_SIGVGKILL) {
/* If this is a SIGVGKILL, we're expecting it to interrupt any
@@ -1589,8 +1569,8 @@
sq = tst->sig_queue;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Queueing signal %d (idx %d) to thread %d",
- si->si_signo, sq->next, tid);
+ VG_DMSG("Queueing signal %d (idx %d) to thread %d",
+ si->si_signo, sq->next, tid);
/* Add signal to the queue. If the queue gets overrun, then old
queued signals may get lost.
@@ -1635,8 +1615,8 @@
if (sq->sigs[idx].si_signo != 0 && VG_(sigismember)(set, sq->sigs[idx].si_signo)) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Returning queued signal %d (idx %d) for thread %d",
- sq->sigs[idx].si_signo, idx, tid);
+ VG_DMSG("Returning queued signal %d (idx %d) for thread %d",
+ sq->sigs[idx].si_signo, idx, tid);
ret = &sq->sigs[idx];
goto out;
}
@@ -1686,9 +1666,8 @@
info->si_code = sanitize_si_code(info->si_code);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "async signal handler: signal=%d, tid=%d, si_code=%d",
- sigNo, tid, info->si_code);
+ VG_DMSG("async signal handler: signal=%d, tid=%d, si_code=%d",
+ sigNo, tid, info->si_code);
/* Update thread state properly */
VG_(fixup_guest_state_after_syscall_interrupted)(
@@ -1892,8 +1871,7 @@
}
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Routing user-sent sync signal %d via queue",
- sigNo);
+ VG_DMSG("Routing user-sent sync signal %d via queue", sigNo);
/* Since every thread has these signals unblocked, we can't rely
on the kernel to route them properly, so we need to queue
@@ -1933,15 +1911,13 @@
if (VG_(clo_trace_signals)) {
if (seg == NULL)
- VG_(message)(Vg_DebugMsg,
- "SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=NULL",
- info->si_code, fault, tid, esp);
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=NULL",
+ info->si_code, fault, tid, esp);
else
- VG_(message)(Vg_DebugMsg,
- "SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
- "seg=%#lx-%#lx",
- info->si_code, fault, tid, esp, seg->start, seg->end);
+ VG_DMSG("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+ "seg=%#lx-%#lx",
+ info->si_code, fault, tid, esp, seg->start, seg->end);
}
if (info->si_code == VKI_SEGV_MAPERR
&& seg
@@ -1959,15 +1935,13 @@
Addr base = VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB);
if (VG_(extend_stack)(base, VG_(threads)[tid].client_stack_szB)) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- " -> extended stack base to %#lx",
- VG_PGROUNDDN(fault));
+ VG_DMSG(" -> extended stack base to %#lx",
+ VG_PGROUNDDN(fault));
return; // extension succeeded, restart host (hence guest)
// instruction
} else
- VG_(message)(Vg_UserMsg,
- "Stack overflow in thread %d: can't grow stack to %#lx",
- tid, fault);
+ VG_UMSG("Stack overflow in thread %d: can't grow stack to %#lx",
+ tid, fault);
}
/* Fall into normal signal handling for all other cases */
}
@@ -1996,15 +1970,13 @@
client code, and therefore it was actually generated by
Valgrind internally.
*/
- VG_(message)(Vg_DebugMsg,
- "VALGRIND INTERNAL ERROR: Valgrind received "
- "a signal %d (%s) - exiting",
- sigNo, signame(sigNo));
+ VG_DMSG("VALGRIND INTERNAL ERROR: Valgrind received "
+ "a signal %d (%s) - exiting",
+ sigNo, signame(sigNo));
- VG_(message)(Vg_DebugMsg,
- "si_code=%x; Faulting address: %p; sp: %#lx",
- info->si_code, info->VKI_SIGINFO_si_addr,
- VG_UCONTEXT_STACK_PTR(uc));
+ VG_DMSG("si_code=%x; Faulting address: %p; sp: %#lx",
+ info->si_code, info->VKI_SIGINFO_si_addr,
+ VG_UCONTEXT_STACK_PTR(uc));
if (0)
VG_(kill_self)(sigNo); /* generate a core dump */
@@ -2034,8 +2006,7 @@
ThreadStatus at_signal = VG_(threads)[tid].status;
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg,
- "sigvgkill for lwp %d tid %d", VG_(gettid)(), tid);
+ VG_DMSG("sigvgkill for lwp %d tid %d", VG_(gettid)(), tid);
VG_(acquire_BigLock)(tid, "sigvgkill_handler");
@@ -2126,20 +2097,19 @@
/* If there was nothing queued, ask the kernel for a pending signal */
if (sip == NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "poll_signals: got signal %d "
- "for thread %d", si.si_signo, tid);
+ VG_DMSG("poll_signals: got signal %d for thread %d",
+ si.si_signo, tid);
sip = &si;
}
if (sip != NULL) {
/* OK, something to do; deliver it */
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Polling found signal %d for tid %d",
- sip->si_signo, tid);
+ VG_DMSG("Polling found signal %d for tid %d", sip->si_signo, tid);
if (!is_sig_ign(sip->si_signo))
deliver_signal(tid, sip, NULL);
else if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, " signal %d ignored", sip->si_signo);
+ VG_DMSG(" signal %d ignored", sip->si_signo);
sip->si_signo = 0; /* remove from signal queue, if that's
where it came from */
@@ -2210,8 +2180,7 @@
}
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d",
- VG_(max_signal));
+ VG_DMSG("Max kernel-supported signal is %d", VG_(max_signal));
/* Our private internal signals are treated as ignored */
scss.scss_per_sig[VG_SIGVGKILL].scss_handler = VKI_SIG_IGN;
Modified: trunk/include/pub_tool_libcprint.h
===================================================================
--- trunk/include/pub_tool_libcprint.h 2009-04-30 04:01:57 UTC (rev 9692)
+++ trunk/include/pub_tool_libcprint.h 2009-04-30 04:17:45 UTC (rev 9693)
@@ -101,6 +101,8 @@
// Short-cuts for VG_(message)().
#define VG_UMSG( format, args... ) VG_(message)(Vg_UserMsg, format, ##args)
#define VG_DMSG( format, args... ) VG_(message)(Vg_DebugMsg, format, ##args)
+#define VG_EMSG( format, args... ) VG_(message)(Vg_DebugExtraMsg, \
+ format, ##args)
#endif // __PUB_TOOL_LIBCPRINT_H
|
|
From: <sv...@va...> - 2009-04-30 04:02:00
|
Author: njn
Date: 2009-04-30 05:01:57 +0100 (Thu, 30 Apr 2009)
New Revision: 9692
Log:
Merge r9691 (make sanitize_si_code safer) from the trunk. Also add the
missing Darwin case that should have been added in r9689.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 04:00:13 UTC (rev 9691)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 04:01:57 UTC (rev 9692)
@@ -1777,8 +1777,10 @@
mask them off) sign extends them when exporting to user space so
we do the same thing here. */
return (Short)si_code;
-#elif defined(VGO_aix5)
+#elif defined(VGO_aix5) || defined(VGO_darwin)
return si_code;
+#else
+# error Unknown OS
#endif
}
|
|
From: <sv...@va...> - 2009-04-30 04:00:23
|
Author: njn
Date: 2009-04-30 05:00:13 +0100 (Thu, 30 Apr 2009)
New Revision: 9691
Log:
Be safer in sanitize_si_code.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 03:49:06 UTC (rev 9690)
+++ trunk/coregrind/m_signals.c 2009-04-30 04:00:13 UTC (rev 9691)
@@ -1661,6 +1661,8 @@
return (Short)si_code;
#elif defined(VGO_aix5)
return si_code;
+#else
+# error Unknown OS
#endif
}
|
|
From: <sv...@va...> - 2009-04-30 03:49:14
|
Author: njn
Date: 2009-04-30 04:49:06 +0100 (Thu, 30 Apr 2009)
New Revision: 9690
Log:
Make --trace-signals=yes output better.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 03:42:46 UTC (rev 9689)
+++ trunk/coregrind/m_signals.c 2009-04-30 03:49:06 UTC (rev 9690)
@@ -1684,7 +1684,8 @@
info->si_code = sanitize_si_code(info->si_code);
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Async handler got signal %d for tid %d info %d",
+ VG_(message)(Vg_DebugMsg,
+ "async signal handler: signal=%d, tid=%d, si_code=%d",
sigNo, tid, info->si_code);
/* Update thread state properly */
@@ -1786,6 +1787,7 @@
vki_siginfo_t *info, struct vki_ucontext *uc )
{
ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
+ Bool from_outside;
if (0)
VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
@@ -1800,6 +1802,17 @@
info->si_code = sanitize_si_code(info->si_code);
+ from_outside = !is_signal_from_kernel(info->si_code);
+
+ if (VG_(clo_trace_signals)) {
+ VG_DMSG("sync signal handler: "
+ "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s",
+ sigNo, info->si_code, VG_(get_IP)(tid),
+ VG_UCONTEXT_INSTR_PTR(uc),
+ ( from_outside ? "outside" : "inside" ));
+ }
+ vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
+
/* // debug code:
if (0) {
VG_(printf)("info->si_signo %d\n", info->si_signo);
@@ -1817,7 +1830,7 @@
kernel,, then treat it more like an async signal than a sync signal --
that is, merely queue it for later delivery. */
- if (!is_signal_from_kernel(info->si_code)) {
+ if (from_outside) {
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
it as an async signal. This is tricky because we could get
@@ -1834,6 +1847,10 @@
client's signal mask was applied, so we can't get here
unless the client wants this signal right now. This means
we can simply use the async_signalhandler. */
+ if (VG_(clo_trace_signals))
+ VG_DMSG("Delivering user-sent sync signal %d as async signal",
+ sigNo);
+
async_signalhandler(sigNo, info, uc);
VG_(core_panic)("async_signalhandler returned!?\n");
}
@@ -1887,14 +1904,6 @@
return;
} /* if (!is_signal_from_kernel(info->si_code)) */
- if (VG_(clo_trace_signals)) {
- VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=%d, "
- "EIP=%#lx, eip=%#lx",
- sigNo, info->si_code, VG_(get_IP)(tid),
- VG_UCONTEXT_INSTR_PTR(uc) );
- }
- vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal));
-
/* Check to see if someone is interested in faults. The fault
catcher should never be set whilst we're in generated code, so
check for that. AFAIK the only use of the catcher right now is
|
|
From: <sv...@va...> - 2009-04-30 03:42:50
|
Author: njn
Date: 2009-04-30 04:42:46 +0100 (Thu, 30 Apr 2009)
New Revision: 9689
Log:
Merge r9688 (factor out a function) from the trunk.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 03:30:09 UTC (rev 9688)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 03:42:46 UTC (rev 9689)
@@ -1765,6 +1765,23 @@
return ret;
}
+static int sanitize_si_code(int si_code)
+{
+#if defined(VGO_linux)
+ /* The linux kernel uses the top 16 bits of si_code for it's own
+ use and only exports the bottom 16 bits to user space - at least
+ that is the theory, but it turns out that there are some kernels
+ around that forget to mask out the top 16 bits so we do it here.
+
+ The kernel treats the bottom 16 bits as signed and (when it does
+ mask them off) sign extends them when exporting to user space so
+ we do the same thing here. */
+ return (Short)si_code;
+#elif defined(VGO_aix5)
+ return si_code;
+#endif
+}
+
/*
Receive an async signal from the kernel.
@@ -1783,18 +1800,8 @@
vg_assert(tst->status == VgTs_WaitSys);
VG_(acquire_BigLock)(tid, "async_signalhandler");
-# if defined(VGO_linux)
- /* The linux kernel uses the top 16 bits of si_code for it's own
- use and only exports the bottom 16 bits to user space - at least
- that is the theory, but it turns out that there are some kernels
- around that forget to mask out the top 16 bits so we do it here.
+ info->si_code = sanitize_si_code(info->si_code);
- The kernel treats the bottom 16 bits as signed and (when it does
- mask them off) sign extends them when exporting to user space so
- we do the same thing here. */
- info->si_code = (Short)info->si_code;
-# endif
-
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "Async handler got signal %d for tid %d info %d",
sigNo, tid, info->si_code);
@@ -1978,18 +1985,8 @@
sigNo == VKI_SIGILL ||
sigNo == VKI_SIGTRAP);
-# if defined(VGO_linux)
- /* The linux kernel uses the top 16 bits of si_code for it's own
- use and only exports the bottom 16 bits to user space - at least
- that is the theory, but it turns out that there are some kernels
- around that forget to mask out the top 16 bits so we do it here.
+ info->si_code = sanitize_si_code(info->si_code);
- The kernel treats the bottom 16 bits as signed and (when it does
- mask them off) sign extends them when exporting to user space so
- we do the same thing here. */
- info->si_code = (Short)info->si_code;
-# endif
-
/* // debug code:
if (0) {
VG_(printf)("info->si_signo %d\n", info->si_signo);
|
|
From: <sv...@va...> - 2009-04-30 03:30:16
|
Author: njn
Date: 2009-04-30 04:30:09 +0100 (Thu, 30 Apr 2009)
New Revision: 9688
Log:
Factor out some repeated code.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-30 03:21:28 UTC (rev 9687)
+++ trunk/coregrind/m_signals.c 2009-04-30 03:30:09 UTC (rev 9688)
@@ -1647,6 +1647,23 @@
return ret;
}
+static int sanitize_si_code(int si_code)
+{
+#if defined(VGO_linux)
+ /* The linux kernel uses the top 16 bits of si_code for it's own
+ use and only exports the bottom 16 bits to user space - at least
+ that is the theory, but it turns out that there are some kernels
+ around that forget to mask out the top 16 bits so we do it here.
+
+ The kernel treats the bottom 16 bits as signed and (when it does
+ mask them off) sign extends them when exporting to user space so
+ we do the same thing here. */
+ return (Short)si_code;
+#elif defined(VGO_aix5)
+ return si_code;
+#endif
+}
+
/*
Receive an async signal from the kernel.
@@ -1664,18 +1681,8 @@
vg_assert(tst->status == VgTs_WaitSys);
VG_(acquire_BigLock)(tid, "async_signalhandler");
-# if defined(VGO_linux)
- /* The linux kernel uses the top 16 bits of si_code for it's own
- use and only exports the bottom 16 bits to user space - at least
- that is the theory, but it turns out that there are some kernels
- around that forget to mask out the top 16 bits so we do it here.
+ info->si_code = sanitize_si_code(info->si_code);
- The kernel treats the bottom 16 bits as signed and (when it does
- mask them off) sign extends them when exporting to user space so
- we do the same thing here. */
- info->si_code = (Short)info->si_code;
-# endif
-
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "Async handler got signal %d for tid %d info %d",
sigNo, tid, info->si_code);
@@ -1791,18 +1798,8 @@
sigNo == VKI_SIGILL ||
sigNo == VKI_SIGTRAP);
-# if defined(VGO_linux)
- /* The linux kernel uses the top 16 bits of si_code for it's own
- use and only exports the bottom 16 bits to user space - at least
- that is the theory, but it turns out that there are some kernels
- around that forget to mask out the top 16 bits so we do it here.
+ info->si_code = sanitize_si_code(info->si_code);
- The kernel treats the bottom 16 bits as signed and (when it does
- mask them off) sign extends them when exporting to user space so
- we do the same thing here. */
- info->si_code = (Short)info->si_code;
-# endif
-
/* // debug code:
if (0) {
VG_(printf)("info->si_signo %d\n", info->si_signo);
|
|
From: <sv...@va...> - 2009-04-30 03:21:46
|
Author: njn
Date: 2009-04-30 04:21:28 +0100 (Thu, 30 Apr 2009)
New Revision: 9687
Log:
Some minor code layout changes to sync with r9685 on the trunk.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-30 03:15:43 UTC (rev 9686)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-30 03:21:28 UTC (rev 9687)
@@ -1053,17 +1053,17 @@
vki_sigset_t* oldset )
{
switch(how) {
- case VKI_SIG_BLOCK:
- case VKI_SIG_UNBLOCK:
- case VKI_SIG_SETMASK:
- vg_assert(VG_(is_valid_tid)(tid));
- do_setmask ( tid, how, set, oldset );
- return VG_(mk_SysRes_Success)( 0 );
+ case VKI_SIG_BLOCK:
+ case VKI_SIG_UNBLOCK:
+ case VKI_SIG_SETMASK:
+ vg_assert(VG_(is_valid_tid)(tid));
+ do_setmask ( tid, how, set, oldset );
+ return VG_(mk_SysRes_Success)( 0 );
- default:
- VG_(message)(Vg_DebugMsg,
- "sigprocmask: unknown 'how' field %d", how);
- return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ default:
+ VG_(message)(Vg_DebugMsg,
+ "sigprocmask: unknown 'how' field %d", how);
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
}
@@ -1304,39 +1304,39 @@
vg_assert(VG_(is_running_thread)(tid));
switch(sigNo) {
- case VKI_SIGQUIT: /* core */
- case VKI_SIGILL: /* core */
- case VKI_SIGABRT: /* core */
- case VKI_SIGFPE: /* core */
- case VKI_SIGSEGV: /* core */
- case VKI_SIGBUS: /* core */
- case VKI_SIGTRAP: /* core */
- case VKI_SIGXCPU: /* core */
- case VKI_SIGXFSZ: /* core */
- terminate = True;
- core = True;
- break;
+ case VKI_SIGQUIT: /* core */
+ case VKI_SIGILL: /* core */
+ case VKI_SIGABRT: /* core */
+ case VKI_SIGFPE: /* core */
+ case VKI_SIGSEGV: /* core */
+ case VKI_SIGBUS: /* core */
+ case VKI_SIGTRAP: /* core */
+ case VKI_SIGXCPU: /* core */
+ case VKI_SIGXFSZ: /* core */
+ terminate = True;
+ core = True;
+ break;
- case VKI_SIGHUP: /* term */
- case VKI_SIGINT: /* term */
- case VKI_SIGKILL: /* term - we won't see this */
- case VKI_SIGPIPE: /* term */
- case VKI_SIGALRM: /* term */
- case VKI_SIGTERM: /* term */
- case VKI_SIGUSR1: /* term */
- case VKI_SIGUSR2: /* term */
- case VKI_SIGIO: /* term */
-# if defined(VKI_SIGPWR)
- case VKI_SIGPWR: /* term */
-# endif
- case VKI_SIGSYS: /* term */
- case VKI_SIGPROF: /* term */
- case VKI_SIGVTALRM: /* term */
-# if defined(VKI_SIGRTMIN) && defined(VKI_SIGRTMAX)
- case VKI_SIGRTMIN ... VKI_SIGRTMAX: /* term */
-# endif
- terminate = True;
- break;
+ case VKI_SIGHUP: /* term */
+ case VKI_SIGINT: /* term */
+ case VKI_SIGKILL: /* term - we won't see this */
+ case VKI_SIGPIPE: /* term */
+ case VKI_SIGALRM: /* term */
+ case VKI_SIGTERM: /* term */
+ case VKI_SIGUSR1: /* term */
+ case VKI_SIGUSR2: /* term */
+ case VKI_SIGIO: /* term */
+# if defined(VKI_SIGPWR)
+ case VKI_SIGPWR: /* term */
+# endif
+ case VKI_SIGSYS: /* term */
+ case VKI_SIGPROF: /* term */
+ case VKI_SIGVTALRM: /* term */
+# if defined(VKI_SIGRTMIN) && defined(VKI_SIGRTMAX)
+ case VKI_SIGRTMIN ... VKI_SIGRTMAX: /* term */
+# endif
+ terminate = True;
+ break;
}
vg_assert(!core || (core && terminate));
@@ -1344,7 +1344,8 @@
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg,
"delivering %d (code %d) to default handler; action: %s%s",
- sigNo, info->si_code, terminate ? "terminate" : "ignore", core ? "+core" : "");
+ sigNo, info->si_code, terminate ? "terminate" : "ignore",
+ core ? "+core" : "");
if (!terminate)
return; /* nothing to do */
|
|
From: <sv...@va...> - 2009-04-30 03:15:52
|
Author: njn Date: 2009-04-30 04:15:43 +0100 (Thu, 30 Apr 2009) New Revision: 9686 Log: This should have gone in with r9682, I don't know how it didn't. Added: branches/DARWIN/memcheck/tests/varinfo6.stderr.exp Added: branches/DARWIN/memcheck/tests/varinfo6.stderr.exp =================================================================== --- branches/DARWIN/memcheck/tests/varinfo6.stderr.exp (rev 0) +++ branches/DARWIN/memcheck/tests/varinfo6.stderr.exp 2009-04-30 03:15:43 UTC (rev 9686) @@ -0,0 +1,20 @@ +Uninitialised byte(s) found during client check request + at 0x........: croak (varinfo6.c:34) + by 0x........: mainSort (varinfo6.c:2999) + by 0x........: BZ2_blockSort (varinfo6.c:3143) + by 0x........: BZ2_compressBlock (varinfo6.c:4072) + by 0x........: handle_compress (varinfo6.c:4790) + by 0x........: BZ2_bzCompress (varinfo6.c:4860) + by 0x........: BZ2_bzBuffToBuffCompress (varinfo6.c:5667) + by 0x........: main (varinfo6.c:6517) + Location 0x........ is 2 bytes inside local var "budget" + declared at varinfo6.c:3115, in frame #2 of thread 1 + +Uninitialised byte(s) found during client check request + at 0x........: croak (varinfo6.c:34) + by 0x........: BZ2_decompress (varinfo6.c:1699) + by 0x........: BZ2_bzDecompress (varinfo6.c:5230) + by 0x........: BZ2_bzBuffToBuffDecompress (varinfo6.c:5715) + by 0x........: main (varinfo6.c:6532) + Location 0x........ is 2 bytes inside local var "i" + declared at varinfo6.c:1517, in frame #1 of thread 1 |
|
From: <sv...@va...> - 2009-04-30 03:05:25
|
Author: njn
Date: 2009-04-30 04:05:05 +0100 (Thu, 30 Apr 2009)
New Revision: 9685
Log:
Merge parts of r9397 from the DARWIN branch, mostly layout cleanups, a
couple of improved debugging messages, some extra comments, some renamings,
etc. No significant functional change.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
===================================================================
--- trunk/coregrind/m_signals.c 2009-04-29 23:57:43 UTC (rev 9684)
+++ trunk/coregrind/m_signals.c 2009-04-30 03:05:05 UTC (rev 9685)
@@ -112,9 +112,12 @@
Forwards decls.
------------------------------------------------------------------ */
-static void sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext * );
-static void async_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext * );
-static void sigvgkill_handler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext * );
+static void sync_signalhandler ( Int sigNo, vki_siginfo_t *info,
+ struct vki_ucontext * );
+static void async_signalhandler ( Int sigNo, vki_siginfo_t *info,
+ struct vki_ucontext * );
+static void sigvgkill_handler ( Int sigNo, vki_siginfo_t *info,
+ struct vki_ucontext * );
static const Char *signame(Int sigNo);
@@ -130,6 +133,18 @@
/* ------ Macros for pulling stuff out of ucontexts ------ */
+/* Q: what does UCONTEXT_SYSCALL_SYSRES do? A: let's suppose the
+ machine context (uc) reflects the situation that a syscall had just
+ completed, quite literally -- that is, that the program counter was
+ now at the instruction following the syscall. (or we're slightly
+ downstream, but we're sure no relevant register has yet changed
+ value.) Then UCONTEXT_SYSCALL_SYSRES returns a SysRes reflecting
+ the result of the syscall; it does this by fishing relevant bits of
+ the machine state out of the uc. Of course if the program counter
+ was somewhere else entirely then the result is likely to be
+ meaningless, so the caller of UCONTEXT_SYSCALL_SYSRES has to be
+ very careful to pay attention to the results only when it is sure
+ that the said constraint on the program counter is indeed valid. */
#if defined(VGP_x86_linux)
# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
@@ -474,13 +489,13 @@
case VKI_SIGCONT:
/* Let the kernel handle SIGCONT unless the client is actually
catching it. */
- case VKI_SIGCHLD:
- case VKI_SIGWINCH:
- case VKI_SIGURG:
- /* For signals which are have a default action of Ignore,
- only set a handler if the client has set a signal handler.
- Otherwise the kernel will interrupt a syscall which
- wouldn't have otherwise been interrupted. */
+ case VKI_SIGCHLD:
+ case VKI_SIGWINCH:
+ case VKI_SIGURG:
+ /* For signals which are have a default action of Ignore,
+ only set a handler if the client has set a signal handler.
+ Otherwise the kernel will interrupt a syscall which
+ wouldn't have otherwise been interrupted. */
if (scss.scss_per_sig[sig].scss_handler == VKI_SIG_DFL)
skss_handler = VKI_SIG_DFL;
else if (scss.scss_per_sig[sig].scss_handler == VKI_SIG_IGN)
@@ -557,28 +572,28 @@
extern void my_sigreturn(void);
#if defined(VGP_x86_linux)
-# define _MYSIG(name) \
+# define _MY_SIGRETURN(name) \
".text\n" \
"my_sigreturn:\n" \
" movl $" #name ", %eax\n" \
" int $0x80\n" \
".previous\n"
#elif defined(VGP_amd64_linux)
-# define _MYSIG(name) \
+# define _MY_SIGRETURN(name) \
".text\n" \
"my_sigreturn:\n" \
" movq $" #name ", %rax\n" \
" syscall\n" \
".previous\n"
#elif defined(VGP_ppc32_linux)
-# define _MYSIG(name) \
+# define _MY_SIGRETURN(name) \
".text\n" \
"my_sigreturn:\n" \
" li 0, " #name "\n" \
" sc\n" \
".previous\n"
#elif defined(VGP_ppc64_linux)
-# define _MYSIG(name) \
+# define _MY_SIGRETURN(name) \
".align 2\n" \
".globl my_sigreturn\n" \
".section \".opd\",\"aw\"\n" \
@@ -592,12 +607,12 @@
" li 0, " #name "\n" \
" sc\n"
#elif defined(VGP_ppc32_aix5)
-# define _MYSIG(name) \
+# define _MY_SIGRETURN(name) \
".globl my_sigreturn\n" \
"my_sigreturn:\n" \
".long 0\n"
#elif defined(VGP_ppc64_aix5)
-# define _MYSIG(name) \
+# define _MY_SIGRETURN(name) \
".globl my_sigreturn\n" \
"my_sigreturn:\n" \
".long 0\n"
@@ -605,9 +620,9 @@
# error Unknown platform
#endif
-#define MYSIG(name) _MYSIG(name)
+#define MY_SIGRETURN(name) _MY_SIGRETURN(name)
asm(
- MYSIG(__NR_rt_sigreturn)
+ MY_SIGRETURN(__NR_rt_sigreturn)
);
@@ -701,7 +716,7 @@
{
ThreadState *tst = VG_(get_ThreadState)(tid);
- return (m_SP - (Addr)tst->altstack.ss_sp < tst->altstack.ss_size);
+ return (m_SP - (Addr)tst->altstack.ss_sp < (Addr)tst->altstack.ss_size);
}
static Int sas_ss_flags ( ThreadId tid, Addr m_SP )
@@ -724,13 +739,18 @@
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugExtraMsg,
"sys_sigaltstack: tid %d, "
- "ss %p, oss %p (current SP %p)",
- tid, (void*)ss, (void*)oss, (void*)m_SP );
+ "ss %p{%p,sz=%llu,flags=0x%llx}, oss %p (current SP %p)",
+ tid, (void*)ss,
+ ss ? ss->ss_sp : 0,
+ (ULong)(ss ? ss->ss_size : 0),
+ (ULong)(ss ? ss->ss_flags : 0),
+ (void*)oss, (void*)m_SP );
if (oss != NULL) {
oss->ss_sp = VG_(threads)[tid].altstack.ss_sp;
oss->ss_size = VG_(threads)[tid].altstack.ss_size;
- oss->ss_flags = VG_(threads)[tid].altstack.ss_flags | sas_ss_flags(tid, m_SP);
+ oss->ss_flags = VG_(threads)[tid].altstack.ss_flags
+ | sas_ss_flags(tid, m_SP);
}
if (ss != NULL) {
@@ -875,9 +895,9 @@
}
static
-const Char *format_sigset ( const vki_sigset_t* set )
+HChar* format_sigset ( const vki_sigset_t* set )
{
- static Char buf[128];
+ static HChar buf[128];
int w;
VG_(strcpy)(buf, "");
@@ -913,12 +933,12 @@
{
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugExtraMsg,
- "do_setmask: tid = %d how = %d (%s), set = %p %s",
+ "do_setmask: tid = %d how = %d (%s), newset = %p (%s)",
tid, how,
how==VKI_SIG_BLOCK ? "SIG_BLOCK" : (
how==VKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
how==VKI_SIG_SETMASK ? "SIG_SETMASK" : "???")),
- newset, format_sigset(newset));
+ newset, newset ? format_sigset(newset) : "NULL" );
/* Just do this thread. */
vg_assert(VG_(is_valid_tid)(tid));
@@ -1004,7 +1024,8 @@
/* Set up a stack frame (VgSigContext) for the client's signal
handler. */
static
-void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo, const struct vki_ucontext *uc )
+void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo,
+ const struct vki_ucontext *uc )
{
Addr esp_top_of_frame;
ThreadState* tst;
@@ -1031,7 +1052,8 @@
= (Addr)(tst->altstack.ss_sp) + tst->altstack.ss_size;
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg,
- "delivering signal %d (%s) to thread %d: on ALT STACK (%p-%p; %ld bytes)",
+ "delivering signal %d (%s) to thread %d: "
+ "on ALT STACK (%p-%p; %ld bytes)",
sigNo, signame(sigNo), tid,
tst->altstack.ss_sp,
(UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
@@ -1063,7 +1085,7 @@
static const Char *signame(Int sigNo)
{
- static Char buf[10];
+ static Char buf[20];
switch(sigNo) {
case VKI_SIGHUP: return "SIGHUP";
@@ -1213,8 +1235,10 @@
vg_assert(!core || (core && terminate));
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "delivering %d (code %d) to default handler; action: %s%s",
- sigNo, info->si_code, terminate ? "terminate" : "ignore", core ? "+core" : "");
+ VG_(message)(Vg_DebugMsg,
+ "delivering %d (code %d) to default handler; action: %s%s",
+ sigNo, info->si_code, terminate ? "terminate" : "ignore",
+ core ? "+core" : "");
if (!terminate)
return; /* nothing to do */
@@ -1373,7 +1397,8 @@
This updates the thread state, but it does not set it to be
Runnable.
*/
-static void deliver_signal ( ThreadId tid, const vki_siginfo_t *info, const struct vki_ucontext *uc )
+static void deliver_signal ( ThreadId tid, const vki_siginfo_t *info,
+ const struct vki_ucontext *uc )
{
Int sigNo = info->si_signo;
SCSS_Per_Signal *handler = &scss.scss_per_sig[sigNo];
@@ -1467,6 +1492,7 @@
vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
+ VG_(memset)(&info, 0, sizeof(info));
info.si_signo = VKI_SIGSEGV;
info.si_code = si_code;
info.VKI_SIGINFO_si_addr = (void*)addr;
@@ -1504,6 +1530,7 @@
vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
+ VG_(memset)(&info, 0, sizeof(info));
info.si_signo = VKI_SIGILL;
info.si_code = VKI_ILL_ILLOPC; /* jrs: no idea what this should be */
info.VKI_SIGINFO_si_addr = (void*)addr;
@@ -1520,6 +1547,8 @@
vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
+ VG_(memset)(&info, 0, sizeof(info));
+ VG_(memset)(&uc, 0, sizeof(uc));
info.si_signo = VKI_SIGTRAP;
info.si_code = VKI_TRAP_BRKPT; /* tjh: only ever called for a brkpt ins */
#if defined(VGA_x86) || defined(VGA_amd64)
@@ -1625,12 +1654,17 @@
since that's the only time this set of signals is unblocked.
*/
static
-void async_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc )
+void async_signalhandler ( Int sigNo,
+ vki_siginfo_t *info, struct vki_ucontext *uc )
{
- ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
- ThreadState *tst = VG_(get_ThreadState)(tid);
+ ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
+ ThreadState* tst = VG_(get_ThreadState)(tid);
-#ifdef VGO_linux
+ /* The thread isn't currently running, make it so before going on */
+ vg_assert(tst->status == VgTs_WaitSys);
+ VG_(acquire_BigLock)(tid, "async_signalhandler");
+
+# if defined(VGO_linux)
/* The linux kernel uses the top 16 bits of si_code for it's own
use and only exports the bottom 16 bits to user space - at least
that is the theory, but it turns out that there are some kernels
@@ -1640,17 +1674,12 @@
mask them off) sign extends them when exporting to user space so
we do the same thing here. */
info->si_code = (Short)info->si_code;
-#endif
+# endif
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "Async handler got signal %d for tid %d info %d",
sigNo, tid, info->si_code);
- vg_assert(tst->status == VgTs_WaitSys);
-
- /* The thread isn't currently running, make it so before going on */
- VG_(acquire_BigLock)(tid, "async_signalhandler");
-
/* Update thread state properly */
VG_(fixup_guest_state_after_syscall_interrupted)(
tid,
@@ -1668,7 +1697,8 @@
handler. */
resume_scheduler(tid);
- VG_(core_panic)("async_signalhandler: got unexpected signal while outside of scheduler");
+ VG_(core_panic)("async_signalhandler: got unexpected signal "
+ "while outside of scheduler");
}
/* Extend the stack to cover addr. maxsize is the limit the stack can grow to.
@@ -1745,10 +1775,14 @@
Receive a sync signal from the host.
*/
static
-void sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc )
+void sync_signalhandler ( Int sigNo,
+ vki_siginfo_t *info, struct vki_ucontext *uc )
{
ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
+ if (0)
+ VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc);
+
vg_assert(info != NULL);
vg_assert(info->si_signo == sigNo);
vg_assert(sigNo == VKI_SIGSEGV ||
@@ -1757,7 +1791,7 @@
sigNo == VKI_SIGILL ||
sigNo == VKI_SIGTRAP);
-#ifdef VGO_linux
+# if defined(VGO_linux)
/* The linux kernel uses the top 16 bits of si_code for it's own
use and only exports the bottom 16 bits to user space - at least
that is the theory, but it turns out that there are some kernels
@@ -1767,7 +1801,7 @@
mask them off) sign extends them when exporting to user space so
we do the same thing here. */
info->si_code = (Short)info->si_code;
-#endif
+# endif
/* // debug code:
if (0) {
@@ -1955,7 +1989,8 @@
Valgrind internally.
*/
VG_(message)(Vg_DebugMsg,
- "VALGRIND INTERNAL ERROR: Valgrind received a signal %d (%s) - exiting",
+ "VALGRIND INTERNAL ERROR: Valgrind received "
+ "a signal %d (%s) - exiting",
sigNo, signame(sigNo));
VG_(message)(Vg_DebugMsg,
@@ -1984,7 +2019,8 @@
blocked in, and return to the scheduler. This doesn't mark the thread
as exiting; that's the caller's job.
*/
-static void sigvgkill_handler(int signo, vki_siginfo_t *si, struct vki_ucontext *uc)
+static void sigvgkill_handler(int signo, vki_siginfo_t *si,
+ struct vki_ucontext *uc)
{
ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)());
ThreadStatus at_signal = VG_(threads)[tid].status;
@@ -2166,7 +2202,8 @@
}
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d", VG_(max_signal));
+ VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d",
+ VG_(max_signal));
/* Our private internal signals are treated as ignored */
scss.scss_per_sig[VG_SIGVGKILL].scss_handler = VKI_SIG_IGN;
|