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
(5) |
2
(3) |
|
3
(2) |
4
(3) |
5
(16) |
6
(8) |
7
(6) |
8
(2) |
9
(4) |
|
10
(10) |
11
(22) |
12
(7) |
13
(10) |
14
(11) |
15
(8) |
16
(6) |
|
17
(11) |
18
|
19
(6) |
20
(8) |
21
(5) |
22
(11) |
23
(6) |
|
24
(1) |
25
(6) |
26
(4) |
27
(2) |
28
(1) |
29
|
30
(2) |
|
31
(5) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2015-05-20 11:31:43
|
Author: rhyskidd
Date: Wed May 20 12:31:35 2015
New Revision: 15259
Log:
Improve documentation of syscall: unix: 44 profil() which was deprecated around OS X 10.6 and removed from the xnu kernel shipped with OS X 10.7. See unresolved bz#264253.
Modified:
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Wed May 20 12:31:35 2015
@@ -9414,7 +9414,11 @@
GENXY(__NR_dup, sys_dup),
MACXY(__NR_pipe, pipe),
GENX_(__NR_getegid, sys_getegid),
-// _____(__NR_profil),
+#if DARWIN_VERS >= DARWIN_10_7
+ _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(44)), // old profil
+#else
+// _____(__NR_profil),
+#endif
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(45)), // old ktrace
MACXY(__NR_sigaction, sigaction),
GENX_(__NR_getgid, sys_getgid),
|
|
From: Philippe W. <phi...@sk...> - 2015-05-19 21:22:56
|
On Tue, 2015-05-19 at 17:33 +0200, Julian Seward wrote:
> I find -v useful in various situations, in particular for diagnosing
> debuginfo reading problems. But it has the effect also of re-printing
> all the errors at the end of the run, so as to show the errors along
> with their counts.
>
> But this is almost never what I want, and I find it kind of annoying to
> have to wade through tons of unwanted output.
>
> I was thinking about moving error-count printing to its own flag
>
> --show-error-counts=no|yes [no]
>
> so as to make it possible to use -v without the undesired output. But
> this would be a user-visible change, that is sure to inconvenience
> some subset of users.
>
> So, am canvassing for opinions. Is there some other way to do this
> that wouldn't change the existing -v behaviour?
The logic used to show things depending on various levels of -v or -d is
not always clear to me. E.g. -v activates things that looks not *that*
interesting for a user (such as redirection details).
Giving a lot of -v or a lot of -d traces a lot of things, while often
you are interested only in a subset.
It would be/have been :) nice to have a fine grain control of what
we show for users and/or debug.
For example, something like
--debuglog=redir,debuginfo,hashtable,gdbsrv
--userinfo=redir,errorsattheend,reportwhenineedacoffee
to indicate the list of things to trace and/or show to the user.
Now, we have a mixture of things that appear due to -v or -d
or specific trace flags.
I have no time (synonym for : I am not that enthusiastic/not
volunteer :) to change the complete logging in Valgrind.
So, at this stage, we have to cope with the -v/-d/various trace flags.
As you indicate, not showing anymore error lists with -v is a quite
significant user change (for a reason 'only' for V developers :).
So, IMO, best not to change this aspect.
At short term, you might filter the output using e.g.
./vg-in-place --tool=helgrind -v ./helgrind/tests/tc12_rwl_trivial|& grep -v '^=='
to only keep the 'non user output' (whatever that means)
If you still want to have for reference the full output in a file, something like
./vg-in-place --tool=helgrind -v ./helgrind/tests/tc12_rwl_trivial|& tee full.out | grep -v '^=='
should make it
What I often use for such things is however either redirect the output
to a file and then use emacs, or directly run the command in an emacs
shell buffer
But I agree that all of the above implies to type
e.g. --show-errors-at-end=no
or
| grep -v '^=='
to skip the errors at the end (or skip more, with the grep -v)
All that being said, I will survive if the behaviour changes :)
Philippe
|
|
From: <sv...@va...> - 2015-05-19 16:17:03
|
Author: carll
Date: Tue May 19 17:16:52 2015
New Revision: 15258
Log:
Set tests/check_ppc64le_cap to executable.
Modified:
trunk/tests/check_ppc64le_cap (props changed)
|
|
From: <sv...@va...> - 2015-05-19 16:08:16
|
Author: carll
Date: Tue May 19 17:08:05 2015
New Revision: 15257
Log:
Fix for the HWCAP2 aux vector.
The support assumed that if HWCAP2 is present that the system also supports
ISA2.07. That assumption is not correct as we have found a few systems (OS)
where the HWCAP2 entry is present but the ISA2.07 bit is not set. This patch
fixes the assertion test to specifically check the ISA2.07 support bit setting
in the HWCAP2 and vex_archinfo->hwcaps variable. The setting for the
ISA2.07 support must be the same in both variables if the HWCAP2 entry exists.
This patch updates Vagrind bugzilla 345695.
Modified:
trunk/coregrind/m_initimg/initimg-linux.c
Modified: trunk/coregrind/m_initimg/initimg-linux.c
==============================================================================
--- trunk/coregrind/m_initimg/initimg-linux.c (original)
+++ trunk/coregrind/m_initimg/initimg-linux.c Tue May 19 17:08:05 2015
@@ -704,10 +704,12 @@
# endif
break;
# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
- case AT_HWCAP2:
- /* The HWCAP2 value has the entry arch_2_07 which indicates the
- * processor is a Power 8 or beyond. The Valgrind vai.hwcaps
- * value (coregrind/m_machine.c) has the VEX_HWCAPS_PPC64_ISA2_07
+ case AT_HWCAP2: {
+ Bool auxv_2_07, hw_caps_2_07;
+ /* The HWCAP2 field may contain an arch_2_07 entry that indicates
+ * if the processor is compliant with the 2.07 ISA. (i.e. Power 8
+ * or beyond). The Valgrind vai.hwcaps value
+ * (coregrind/m_machine.c) has the VEX_HWCAPS_PPC64_ISA2_07
* flag set so Valgrind knows about Power8. Need to pass the
* HWCAP2 value along so the user level programs can detect that
* the processor supports ISA 2.07 and beyond.
@@ -728,13 +730,15 @@
PPC_FEATURE2_HAS_TAR 0x04000000
PPC_FEATURE2_HAS_VCRYPTO 0x02000000
*/
-
- if ((auxv->u.a_val & ~(0x80000000ULL)) != 0) {
- /* Verify if PPC_FEATURE2_ARCH_2_07 is set in HWCAP2
- * that arch_2_07 is also set in VEX HWCAPS
- */
- vg_assert((vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA2_07) == VEX_HWCAPS_PPC64_ISA2_07);
- }
+ auxv_2_07 = (auxv->u.a_val & 0x80000000ULL) == 0x80000000ULL;
+ hw_caps_2_07 = (vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA2_07)
+ == VEX_HWCAPS_PPC64_ISA2_07;
+
+ /* Verify the PPC_FEATURE2_ARCH_2_07 setting in HWCAP2
+ * matches the setting in VEX HWCAPS.
+ */
+ vg_assert(auxv_2_07 == hw_caps_2_07);
+ }
break;
# endif
|
|
From: <sv...@va...> - 2015-05-19 16:01:48
|
Author: sewardj
Date: Tue May 19 17:01:40 2015
New Revision: 15256
Log:
Update.
Modified:
trunk/docs/internals/3_10_BUGSTATUS.txt
Modified: trunk/docs/internals/3_10_BUGSTATUS.txt
==============================================================================
--- trunk/docs/internals/3_10_BUGSTATUS.txt (original)
+++ trunk/docs/internals/3_10_BUGSTATUS.txt Tue May 19 17:01:40 2015
@@ -432,3 +432,11 @@
347322 Power PC regression test cleanup
Fri 8 May 11:52:14 CEST 2015
+
+347686 Patch set to cleanup PPC64 regtests
+
+347698 3.10.1 doesn't recognize cmpsd generated by DynASM
+
+347885 unhandled instruction bytes: 0xD6 0xF 0x84 0x1B (SALC amd64)
+
+Tue 19 May 11:22:52 CEST 2015
|
|
From: Julian S. <js...@ac...> - 2015-05-19 15:33:13
|
I find -v useful in various situations, in particular for diagnosing debuginfo reading problems. But it has the effect also of re-printing all the errors at the end of the run, so as to show the errors along with their counts. But this is almost never what I want, and I find it kind of annoying to have to wade through tons of unwanted output. I was thinking about moving error-count printing to its own flag --show-error-counts=no|yes [no] so as to make it possible to use -v without the undesired output. But this would be a user-visible change, that is sure to inconvenience some subset of users. So, am canvassing for opinions. Is there some other way to do this that wouldn't change the existing -v behaviour? J |
|
From: <sv...@va...> - 2015-05-19 13:53:38
|
Author: rhyskidd
Date: Tue May 19 14:53:27 2015
New Revision: 15255
Log:
Silence some reachable system library reports on OS X 10.10 for simple Hello World console application. No regressions. n-i-bz.
Modified:
trunk/darwin14.supp
Modified: trunk/darwin14.supp
==============================================================================
--- trunk/darwin14.supp (original)
+++ trunk/darwin14.supp Tue May 19 14:53:27 2015
@@ -134,6 +134,27 @@
...
}
+{
+ OSX1010:14-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:?alloc
+ ...
+ fun:libSystem_atfork_child
+ ...
+}
+
+{
+ OSX1010:15-Leak
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
+ fun:__smakebuf
+ ...
+ fun:printf
+ ...
+}
+
############################################
## Non-leak errors
|
|
From: <sv...@va...> - 2015-05-17 21:36:12
|
Author: philippe
Date: Sun May 17 22:36:05 2015
New Revision: 15254
Log:
Follow up to r15253:
Having a one elt free lineF cache avoids many PA calls.
This seems to slightly improve (a few %) a firefox startup.
Modified:
trunk/helgrind/libhb_core.c
Modified: trunk/helgrind/libhb_core.c
==============================================================================
--- trunk/helgrind/libhb_core.c (original)
+++ trunk/helgrind/libhb_core.c Sun May 17 22:36:05 2015
@@ -1007,6 +1007,11 @@
return (arr[bix] >> shft) & 3;
}
+/* We cache one free lineF, to avoid pool allocator calls.
+ Measurement on firefox has shown that this avoids more than 90%
+ of the PA calls. */
+static LineF *free_lineF = NULL;
+
/* Allocates a lineF for LineZ. Sets lineZ in a state indicating
lineF has to be used. */
static inline LineF *alloc_LineF_for_Z (LineZ *lineZ)
@@ -1015,7 +1020,12 @@
tl_assert(lineZ->dict[0] == SVal_INVALID);
- lineF = VG_(allocEltPA) ( LineF_pool_allocator );
+ if (LIKELY(free_lineF)) {
+ lineF = free_lineF;
+ free_lineF = NULL;
+ } else {
+ lineF = VG_(allocEltPA) ( LineF_pool_allocator );
+ }
lineZ->dict[0] = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID;
lineZ->dict[1] = Ptr2SVal (lineF);
@@ -1030,7 +1040,11 @@
LineF *lineF = LineF_Ptr(lineZ);
rcdec_LineF(lineF);
- VG_(freeEltPA)( LineF_pool_allocator, lineF );
+ if (UNLIKELY(free_lineF)) {
+ VG_(freeEltPA)( LineF_pool_allocator, lineF );
+ } else {
+ free_lineF = lineF;
+ }
lineZ->dict[0] = SVal_NOACCESS;
lineZ->dict[1] = SVal_INVALID;
}
|
|
From: <sv...@va...> - 2015-05-17 19:32:50
|
Author: philippe
Date: Sun May 17 20:32:42 2015
New Revision: 15253
Log:
This patch reduces the memory needed for the linesF.
Currently, each SecMap has an array of linesF, referenced by the linesZ
of the secmap that needs a lineF, via an index stored in dict[1].
When the array is full, its size is doubled.
The linesF array of a secmap is freed when the SecMap is GC-ed.
The above strategy has the following consequences:
A. in average, 25% of the LinesF are unused.
B. if a SecMap has 'temporarily' a need for linesF, but afterwards,
these linesF are converted to normal lineZ representation, the linesF
will not be recuperated unless the SecMap is GC-ed (i.e. fully marked
no access).
The patch replaces the linesF array private per SecMap
by a pool allocator of LinesF shared between all SecMap.
A lineZ that needs a lineF will directly point to its lineF (using a pointer
stored in dict[1]), instead of having in dict[1] the index in the SecMap
linesF array.
When a lineZ needs a lineF, it is allocated from the pool allocator.
When a lineZ does not need anymore a lineF, it is returned back to the
pool allocator.
On a firefox startup, the above strategy reduces the memory for linesF
by about 42Mb. It seems that the more firefox is used (e.g. to visit
a few websites), the bigger the memory gain.
After opening the home page of valgrind, wikipedia and google, the memory
gain is about 94Mb:
trunk:
linesF: 392,181 allocd ( 203,934,120 bytes occupied) ( 173,279 used)
patch:
linesF: 212,966 allocd ( 109,038,592 bytes occupied) ( 170,252 used)
There is also less alloc/free operations in core arena with the patch:
trunk:
core : 810,680,320/ 802,291,712 max/curr mmap'd, 17/19 unsplit/split sb unmmap'd, 759,441,224/ 703,191,896 max/curr, 40631760/16376828248 totalloc-blocks/bytes, 188015696 searches 8 rzB
patch:
core : 701,628,416/ 690,753,536 max/curr mmap'd, 12/29 unsplit/split sb unmmap'd, 643,041,944/ 577,793,712 max/curr, 32050040/14056017712 totalloc-blocks/bytes, 174097728 searches 8 rzB
In terms of performance, no CPU impact detected on Firefox startup.
Note we have no representative reproducible (and preferrably small)
perf test that uses extensively linesF. Firefox is a good heavy lineF
user but is far to be reproducible, and is very far to be small.
Theoretically, in terms of CPU performance, the patch might have some
small benefits here and there for read operations, as the lineF pointer
is directly retrieved from the lineZ, rather than retrieved via an indirection
in the linesF array.
For write operations, the patch might need a little bit more CPU,
as we replace an
assignment to lineF inUse boolean to False (and then probably back to True
when the cacheline is written back)
by
a call to pool allocator VG_(freeEltPA) (and then probably a call to
VG_(allocEltPA) when the cacheline is written back).
These PA functions are small, so cost should be ok.
We might however still maintain in clear_LineF_of_Z the last cleared lineF
and re-use it in alloc_LineF_for_Z. Not sure how many calls to the PA functions
would be avoided by this '1 elt cache' (and the needed 'if elt == NULL'
check in both clear_LineF_of_Z and alloc_LineF_for_Z.
This possible optimisationwill be looked at later.
Modified:
trunk/coregrind/m_poolalloc.c
trunk/helgrind/libhb_core.c
trunk/include/pub_tool_poolalloc.h
Modified: trunk/coregrind/m_poolalloc.c
==============================================================================
--- trunk/coregrind/m_poolalloc.c (original)
+++ trunk/coregrind/m_poolalloc.c Sun May 17 20:32:42 2015
@@ -110,6 +110,12 @@
VG_(addToXA)( pa->pools, &pool );
}
+UWord VG_(sizePA) ( PoolAlloc* pa)
+{
+ vg_assert(pa);
+ return pa->nPerPool * VG_(sizeXA) (pa->pools);
+}
+
void* VG_(allocEltPA) ( PoolAlloc* pa)
{
UWord* elem;
Modified: trunk/helgrind/libhb_core.c
==============================================================================
--- trunk/helgrind/libhb_core.c (original)
+++ trunk/helgrind/libhb_core.c Sun May 17 20:32:42 2015
@@ -367,6 +367,9 @@
static inline SVal SVal__mkC ( VtsID rmini, VtsID wmini );
static inline void SVal__rcinc ( SVal s );
static inline void SVal__rcdec ( SVal s );
+/* SVal in LineZ are used to store various pointers. */
+static inline void *SVal2Ptr (SVal s);
+static inline SVal Ptr2SVal (void* ptr);
/* A double linked list of all the SO's. */
SO* admin_SO;
@@ -464,18 +467,34 @@
SVal dict[4]; /* can represent up to 4 diff values in the line */
UChar ix2s[N_LINE_ARANGE/4]; /* array of N_LINE_ARANGE 2-bit
dict indexes */
- /* if dict[0] == SVal_INVALID then dict[1] is the index of the
+ /* if dict[0] == SVal_INVALID then dict[1] is a pointer to the
LineF to use, and dict[2..] are also SVal_INVALID. */
}
LineZ; /* compressed rep for a cache line */
+/* LineZ.dict[1] is used to store various pointers:
+ * In the first lineZ of a free SecMap, it points to the next free SecMap.
+ * In a lineZ for which we need to use a lineF, it points to the lineF. */
+
+
typedef
struct {
- Bool inUse;
SVal w64s[N_LINE_ARANGE];
}
LineF; /* full rep for a cache line */
+/* We use a pool allocator for LineF, as LineF is relatively small,
+ and we will often alloc/release such lines. */
+static PoolAlloc* LineF_pool_allocator;
+
+/* SVal in a lineZ are used to store various pointers.
+ Below are conversion functions to support that. */
+static inline LineF *LineF_Ptr (LineZ *lineZ)
+{
+ tl_assert(lineZ->dict[0] == SVal_INVALID);
+ return SVal2Ptr (lineZ->dict[1]);
+}
+
/* Shadow memory.
Primary map is a WordFM Addr SecMap*.
SecMaps cover some page-size-ish section of address space and hold
@@ -496,32 +515,30 @@
/* The data in the SecMap is held in the array of LineZs. Each LineZ
either carries the required data directly, in a compressed
- representation, or it holds (in .dict[0]) an index to the LineF in
- .linesF that holds the full representation.
+ representation, or it holds (in .dict[1]) a pointer to a LineF
+ that holds the full representation.
- Currently-unused LineF's have their .inUse bit set to zero.
- Since each in-use LineF is referred to be exactly one LineZ,
- the number of .linesZ[] that refer to .linesF should equal
- the number of .linesF[] that have .inUse == True.
+ As each in-use LineF is referred to by exactly one LineZ,
+ the number of .linesZ[] that refer to a lineF should equal
+ the number of used lineF.
RC obligations: the RCs presented to the user include exactly
the values in:
* direct Z reps, that is, ones for which .dict[0] != SVal_INVALID
- * F reps that are in use (.inUse == True)
+ * F reps that are in use
Hence the following actions at the following transitions are required:
- F rep: .inUse==True -> .inUse==False -- rcdec_LineF
- F rep: .inUse==False -> .inUse==True -- rcinc_LineF
+ F rep: alloc'd -> freed -- rcdec_LineF
+ F rep: -> alloc'd -- rcinc_LineF
Z rep: .dict[0] from other to SVal_INVALID -- rcdec_LineZ
Z rep: .dict[0] from SVal_INVALID to other -- rcinc_LineZ
*/
+
typedef
struct {
UInt magic;
LineZ linesZ[N_SECMAP_ZLINES];
- LineF* linesF;
- UInt linesF_size;
}
SecMap;
@@ -578,8 +595,6 @@
static UWord stats__secmap_ga_space_covered = 0; // # ga bytes covered
static UWord stats__secmap_linesZ_allocd = 0; // # LineZ's issued
static UWord stats__secmap_linesZ_bytes = 0; // .. using this much storage
-static UWord stats__secmap_linesF_allocd = 0; // # LineF's issued
-static UWord stats__secmap_linesF_bytes = 0; // .. using this much storage
static UWord stats__cache_Z_fetches = 0; // # Z lines fetched
static UWord stats__cache_Z_wbacks = 0; // # Z lines written back
static UWord stats__cache_F_fetches = 0; // # F lines fetched
@@ -677,8 +692,24 @@
/* SecMap changed to be fully SVal_NOACCESS are inserted in a list of
recycled SecMap. When a new SecMap is needed, a recycled SecMap
will be used in preference to allocating a new SecMap. */
-/* We make a linked list of SecMap. LinesF pointer is re-used to
- implement the link list. */
+/* We make a linked list of SecMap. The first LineZ is re-used to
+ implement the linked list. */
+/* Returns the SecMap following sm in the free list.
+ NULL if sm is the last SecMap. sm must be on the free list. */
+static inline SecMap *SecMap_freelist_next ( SecMap* sm )
+{
+ tl_assert (sm);
+ tl_assert (sm->magic == SecMap_free_MAGIC);
+ return SVal2Ptr (sm->linesZ[0].dict[1]);
+}
+static inline void set_SecMap_freelist_next ( SecMap* sm, SecMap* next )
+{
+ tl_assert (sm);
+ tl_assert (sm->magic == SecMap_free_MAGIC);
+ tl_assert (next == NULL || next->magic == SecMap_free_MAGIC);
+ sm->linesZ[0].dict[1] = Ptr2SVal (next);
+}
+
static SecMap *SecMap_freelist = NULL;
static UWord SecMap_freelist_length(void)
{
@@ -688,7 +719,7 @@
sm = SecMap_freelist;
while (sm) {
n++;
- sm = (SecMap*)sm->linesF;
+ sm = SecMap_freelist_next (sm);
}
return n;
}
@@ -697,7 +728,7 @@
{
if (0) VG_(message)(Vg_DebugMsg, "%p push\n", sm);
sm->magic = SecMap_free_MAGIC;
- sm->linesF = (LineF*)SecMap_freelist;
+ set_SecMap_freelist_next(sm, SecMap_freelist);
SecMap_freelist = sm;
}
/* Returns a free SecMap if there is one.
@@ -709,7 +740,7 @@
sm = SecMap_freelist;
if (sm) {
tl_assert (sm->magic == SecMap_free_MAGIC);
- SecMap_freelist = (SecMap*)sm->linesF;
+ SecMap_freelist = SecMap_freelist_next (sm);
if (0) VG_(message)(Vg_DebugMsg, "%p pop\n", sm);
}
return sm;
@@ -738,8 +769,6 @@
for (j = 0; j < N_LINE_ARANGE/4; j++)
sm->linesZ[i].ix2s[j] = 0; /* all reference dict[0] */
}
- sm->linesF = NULL;
- sm->linesF_size = 0;
return sm;
}
@@ -803,28 +832,27 @@
while (VG_(nextIterFM)( map_shmem, &gaKey, &secmapW )) {
UWord i;
UWord j;
+ UWord n_linesF = 0;
SecMap* sm = (SecMap*)secmapW;
tl_assert(sm->magic == SecMap_MAGIC);
Bool ok_to_GC = True;
examined++;
- /* Deal with the LineZs */
+ /* Deal with the LineZs and the possible LineF of a LineZ. */
for (i = 0; i < N_SECMAP_ZLINES && ok_to_GC; i++) {
LineZ* lineZ = &sm->linesZ[i];
- ok_to_GC = lineZ->dict[0] == SVal_INVALID
- || (lineZ->dict[0] == SVal_NOACCESS
+ if (lineZ->dict[0] != SVal_INVALID) {
+ ok_to_GC = lineZ->dict[0] == SVal_NOACCESS
&& !SVal__isC (lineZ->dict[1])
&& !SVal__isC (lineZ->dict[2])
- && !SVal__isC (lineZ->dict[3]));
- }
- /* Deal with the LineFs */
- for (i = 0; i < sm->linesF_size && ok_to_GC; i++) {
- LineF* lineF = &sm->linesF[i];
- if (!lineF->inUse)
- continue;
- for (j = 0; j < N_LINE_ARANGE && ok_to_GC; j++)
- ok_to_GC = lineF->w64s[j] == SVal_NOACCESS;
+ && !SVal__isC (lineZ->dict[3]);
+ } else {
+ LineF *lineF = LineF_Ptr(lineZ);
+ n_linesF++;
+ for (j = 0; j < N_LINE_ARANGE && ok_to_GC; j++)
+ ok_to_GC = lineF->w64s[j] == SVal_NOACCESS;
+ }
}
if (ok_to_GC)
ok_GCed++;
@@ -835,12 +863,16 @@
So, stop iteration, remove from map_shmem, recreate the iteration
on the next SecMap. */
VG_(doneIterFM) ( map_shmem );
- /* No need to rcdec linesZ or linesF, these are all SVal_NOACCESS or
- not in use. We just need to free the linesF. */
- if (sm->linesF_size > 0) {
- HG_(free)(sm->linesF);
- stats__secmap_linesF_allocd -= sm->linesF_size;
- stats__secmap_linesF_bytes -= sm->linesF_size * sizeof(LineF);
+ /* No need to rcdec linesZ or linesF, these are all SVal_NOACCESS.
+ We just need to free the lineF referenced by the linesZ. */
+ if (n_linesF > 0) {
+ for (i = 0; i < N_SECMAP_ZLINES && n_linesF > 0; i++) {
+ LineZ* lineZ = &sm->linesZ[i];
+ if (lineZ->dict[0] == SVal_INVALID) {
+ VG_(freeEltPA)( LineF_pool_allocator, LineF_Ptr(lineZ) );
+ n_linesF--;
+ }
+ }
}
if (!VG_(delFromFM)(map_shmem, &fm_gaKey, (UWord*)&fm_sm, gaKey))
tl_assert (0);
@@ -907,7 +939,6 @@
UWord secmapW = 0;
Addr gaKey;
UWord inUse = 0;
- UWord total = 0;
VG_(initIterFM)( map_shmem );
while (VG_(nextIterFM)( map_shmem, &gaKey, &secmapW )) {
@@ -915,15 +946,13 @@
SecMap* sm = (SecMap*)secmapW;
tl_assert(sm->magic == SecMap_MAGIC);
- for (i = 0; i < sm->linesF_size; i++) {
- LineF* lineF = &sm->linesF[i];
- if (lineF->inUse)
+ for (i = 0; i < N_SECMAP_ZLINES; i++) {
+ LineZ* lineZ = &sm->linesZ[i];
+ if (lineZ->dict[0] == SVal_INVALID)
inUse++;
- total++;
}
}
VG_(doneIterFM)( map_shmem );
- tl_assert (stats__secmap_linesF_allocd == total);
return inUse;
}
@@ -932,14 +961,12 @@
static void rcinc_LineF ( LineF* lineF ) {
UWord i;
- tl_assert(lineF->inUse);
for (i = 0; i < N_LINE_ARANGE; i++)
SVal__rcinc(lineF->w64s[i]);
}
static void rcdec_LineF ( LineF* lineF ) {
UWord i;
- tl_assert(lineF->inUse);
for (i = 0; i < N_LINE_ARANGE; i++)
SVal__rcdec(lineF->w64s[i]);
}
@@ -980,6 +1007,34 @@
return (arr[bix] >> shft) & 3;
}
+/* Allocates a lineF for LineZ. Sets lineZ in a state indicating
+ lineF has to be used. */
+static inline LineF *alloc_LineF_for_Z (LineZ *lineZ)
+{
+ LineF *lineF;
+
+ tl_assert(lineZ->dict[0] == SVal_INVALID);
+
+ lineF = VG_(allocEltPA) ( LineF_pool_allocator );
+ lineZ->dict[0] = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID;
+ lineZ->dict[1] = Ptr2SVal (lineF);
+
+ return lineF;
+}
+
+/* rcdec the LineF of lineZ, frees the lineF, and sets lineZ
+ back to its initial state SVal_NOACCESS (i.e. ready to be
+ read or written just after SecMap allocation). */
+static inline void clear_LineF_of_Z (LineZ *lineZ)
+{
+ LineF *lineF = LineF_Ptr(lineZ);
+
+ rcdec_LineF(lineF);
+ VG_(freeEltPA)( LineF_pool_allocator, lineF );
+ lineZ->dict[0] = SVal_NOACCESS;
+ lineZ->dict[1] = SVal_INVALID;
+}
+
/* Given address 'tag', find either the Z or F line containing relevant
data, so it can be read into the cache.
*/
@@ -998,12 +1053,7 @@
lineZ = &sm->linesZ[zix];
lineF = NULL;
if (lineZ->dict[0] == SVal_INVALID) {
- UInt fix = (UInt)lineZ->dict[1];
- tl_assert(sm->linesF);
- tl_assert(sm->linesF_size > 0);
- tl_assert(fix >= 0 && fix < sm->linesF_size);
- lineF = &sm->linesF[fix];
- tl_assert(lineF->inUse);
+ lineF = LineF_Ptr (lineZ);
lineZ = NULL;
}
*zp = lineZ;
@@ -1021,7 +1071,6 @@
/*OUT*/Word* zixp,
Addr tag ) {
LineZ* lineZ;
- LineF* lineF;
UWord zix;
SecMap* sm = shmem__find_or_alloc_SecMap(tag);
UWord smoff = shmem__get_SecMap_offset(tag);
@@ -1031,86 +1080,17 @@
zix = smoff >> N_LINE_BITS;
tl_assert(zix < N_SECMAP_ZLINES);
lineZ = &sm->linesZ[zix];
- lineF = NULL;
- /* re RCs, we are freeing up this LineZ/LineF so that new data can
- be parked in it. Hence have to rcdec it accordingly. */
+ /* re RCs, we are rcdec_LineZ/clear_LineF_of_Z this LineZ so that new data
+ can be parked in it. Hence have to rcdec it accordingly. */
/* If lineZ has an associated lineF, free it up. */
- if (lineZ->dict[0] == SVal_INVALID) {
- UInt fix = (UInt)lineZ->dict[1];
- tl_assert(sm->linesF);
- tl_assert(sm->linesF_size > 0);
- tl_assert(fix >= 0 && fix < sm->linesF_size);
- lineF = &sm->linesF[fix];
- tl_assert(lineF->inUse);
- rcdec_LineF(lineF);
- lineF->inUse = False;
- } else {
+ if (lineZ->dict[0] == SVal_INVALID)
+ clear_LineF_of_Z(lineZ);
+ else
rcdec_LineZ(lineZ);
- }
*smp = sm;
*zixp = zix;
}
-static __attribute__((noinline))
-void alloc_F_for_writing ( /*MOD*/SecMap* sm, /*OUT*/Word* fixp ) {
- UInt i, new_size;
- LineF* nyu;
-
- if (sm->linesF) {
- tl_assert(sm->linesF_size > 0);
- } else {
- tl_assert(sm->linesF_size == 0);
- }
-
- if (sm->linesF) {
- for (i = 0; i < sm->linesF_size; i++) {
- if (!sm->linesF[i].inUse) {
- *fixp = (Word)i;
- return;
- }
- }
- }
-
- /* No free F line found. Expand existing array and try again. */
- new_size = sm->linesF_size==0 ? 1 : 2 * sm->linesF_size;
- nyu = HG_(zalloc)( "libhb.aFfw.1 (LineF storage)",
- new_size * sizeof(LineF) );
-
- stats__secmap_linesF_allocd += (new_size - sm->linesF_size);
- stats__secmap_linesF_bytes += (new_size - sm->linesF_size)
- * sizeof(LineF);
-
- if (0)
- VG_(printf)("SM %p: expand F array from %d to %d\n",
- sm, (Int)sm->linesF_size, new_size);
-
- for (i = 0; i < new_size; i++)
- nyu[i].inUse = False;
-
- if (sm->linesF) {
- for (i = 0; i < sm->linesF_size; i++) {
- tl_assert(sm->linesF[i].inUse);
- nyu[i] = sm->linesF[i];
- }
- VG_(memset)(sm->linesF, 0, sm->linesF_size * sizeof(LineF) );
- HG_(free)(sm->linesF);
- }
-
- sm->linesF = nyu;
- sm->linesF_size = new_size;
-
- for (i = 0; i < sm->linesF_size; i++) {
- if (!sm->linesF[i].inUse) {
- *fixp = (Word)i;
- return;
- }
- }
-
- /*NOTREACHED*/
- tl_assert(0);
-}
-
-
/* ------------ CacheLine and implicit-tree related ------------ */
__attribute__((unused))
@@ -1578,15 +1558,8 @@
/* Cannot use the compressed(z) representation. Use the full(f)
rep instead. */
tl_assert(i >= 0 && i < N_LINE_ARANGE);
- alloc_F_for_writing( sm, &fix );
- tl_assert(sm->linesF);
- tl_assert(sm->linesF_size > 0);
- tl_assert(fix >= 0 && fix < (Word)sm->linesF_size);
- lineF = &sm->linesF[fix];
- tl_assert(!lineF->inUse);
lineZ->dict[0] = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID;
- lineZ->dict[1] = (SVal)fix;
- lineF->inUse = True;
+ lineF = alloc_LineF_for_Z (lineZ);
i = 0;
for (k = 0; k < csvalsUsed; k++) {
if (CHECK_ZSM)
@@ -1636,7 +1609,6 @@
/* expand the data into the bottom layer of the tree, then get
cacheline_normalise to build the descriptor array. */
if (lineF) {
- tl_assert(lineF->inUse);
for (i = 0; i < N_LINE_ARANGE; i++) {
cl->svals[i] = lineF->w64s[i];
}
@@ -1970,6 +1942,16 @@
cache_shmem.tags0[wix] = 1/*INVALID*/;
}
+ LineF_pool_allocator = VG_(newPA) (
+ sizeof(LineF),
+ /* Nr elements/pool to fill a core arena block
+ taking some arena overhead into account. */
+ (4 * 1024 * 1024 - 200)/sizeof(LineF),
+ HG_(zalloc),
+ "libhb.LineF_storage.pool",
+ HG_(free)
+ );
+
/* a SecMap must contain an integral number of CacheLines */
tl_assert(0 == (N_SECMAP_ARANGE % N_LINE_ARANGE));
/* also ... a CacheLine holds an integral number of trees */
@@ -3240,18 +3222,14 @@
/* Deal with the LineZs */
for (i = 0; i < N_SECMAP_ZLINES; i++) {
LineZ* lineZ = &sm->linesZ[i];
- if (lineZ->dict[0] == SVal_INVALID)
- continue; /* not in use -- data is in F rep instead */
- for (j = 0; j < 4; j++)
- remap_VtsIDs_in_SVal(vts_tab, new_tab, &lineZ->dict[j]);
- }
- /* Deal with the LineFs */
- for (i = 0; i < sm->linesF_size; i++) {
- LineF* lineF = &sm->linesF[i];
- if (!lineF->inUse)
- continue;
- for (j = 0; j < N_LINE_ARANGE; j++)
- remap_VtsIDs_in_SVal(vts_tab, new_tab, &lineF->w64s[j]);
+ if (lineZ->dict[0] != SVal_INVALID) {
+ for (j = 0; j < 4; j++)
+ remap_VtsIDs_in_SVal(vts_tab, new_tab, &lineZ->dict[j]);
+ } else {
+ LineF* lineF = SVal2Ptr (lineZ->dict[1]);
+ for (j = 0; j < N_LINE_ARANGE; j++)
+ remap_VtsIDs_in_SVal(vts_tab, new_tab, &lineF->w64s[j]);
+ }
}
}
VG_(doneIterFM)( map_shmem );
@@ -4171,6 +4149,17 @@
}
}
+static inline void *SVal2Ptr (SVal s)
+{
+ return (void*)(UWord)s;
+}
+
+static inline SVal Ptr2SVal (void* ptr)
+{
+ return (SVal)(UWord)ptr;
+}
+
+
/////////////////////////////////////////////////////////
// //
@@ -6364,7 +6353,8 @@
stats__secmap_linesZ_bytes);
VG_(printf)(" linesF: %'10lu allocd (%'12lu bytes occupied)"
" (%'10lu used)\n",
- stats__secmap_linesF_allocd, stats__secmap_linesF_bytes,
+ VG_(sizePA) (LineF_pool_allocator),
+ VG_(sizePA) (LineF_pool_allocator) * sizeof(LineF),
shmem__SecMap_used_linesF());
VG_(printf)(" secmaps: %'10lu in map (can be scanGCed %'5lu)"
" #%lu scanGC \n",
@@ -6820,21 +6810,14 @@
{
for (UInt lz = zix_start; lz <= zix_end; lz++) {
LineZ* lineZ;
- LineF* lineF;
lineZ = &sm->linesZ[lz];
if (lineZ->dict[0] != SVal_INVALID) {
rcdec_LineZ(lineZ);
+ lineZ->dict[0] = SVal_NOACCESS;
+ lineZ->dict[1] = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID;
} else {
- UInt fix = (UInt)lineZ->dict[1];
- tl_assert(sm->linesF);
- tl_assert(sm->linesF_size > 0);
- tl_assert(fix >= 0 && fix < sm->linesF_size);
- lineF = &sm->linesF[fix];
- rcdec_LineF(lineF);
- lineF->inUse = False;
+ clear_LineF_of_Z(lineZ);
}
- lineZ->dict[0] = SVal_NOACCESS;
- lineZ->dict[1] = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID;
for (UInt i = 0; i < N_LINE_ARANGE/4; i++)
lineZ->ix2s[i] = 0; /* all refer to dict[0] */
}
@@ -6963,17 +6946,11 @@
if (CHECK_ZSM) tl_assert(is_sane_SecMap(sm));
for (UInt lz = 0; lz < N_SECMAP_ZLINES; lz++) {
- if (LIKELY(sm->linesZ[lz].dict[0] != SVal_INVALID))
- rcdec_LineZ(&sm->linesZ[lz]);
- }
- for (UInt lf = 0; lf < sm->linesF_size; lf++) {
- if (sm->linesF[lf].inUse)
- rcdec_LineF (&sm->linesF[lf]);
- }
- if (sm->linesF_size > 0) {
- HG_(free)(sm->linesF);
- stats__secmap_linesF_allocd -= sm->linesF_size;
- stats__secmap_linesF_bytes -= sm->linesF_size * sizeof(LineF);
+ LineZ *lineZ = &sm->linesZ[lz];
+ if (LIKELY(lineZ->dict[0] != SVal_INVALID))
+ rcdec_LineZ(lineZ);
+ else
+ clear_LineF_of_Z(lineZ);
}
if (!VG_(delFromFM)(map_shmem, &gaKey, (UWord*)&fm_sm, sm_start))
tl_assert (0);
@@ -7063,8 +7040,8 @@
UWord zix = shmem__get_SecMap_offset(b) >> N_LINE_BITS;
lineZ = &sm->linesZ[zix];
if (lineZ->dict[0] == SVal_INVALID) {
- UInt fix = (UInt)lineZ->dict[1];
- sv = sm->linesF[fix].w64s[cloff];
+ LineF *lineF = SVal2Ptr(lineZ->dict[1]);
+ sv = lineF->w64s[cloff];
} else {
UWord ix = read_twobit_array( lineZ->ix2s, cloff );
sv = lineZ->dict[ix];
Modified: trunk/include/pub_tool_poolalloc.h
==============================================================================
--- trunk/include/pub_tool_poolalloc.h (original)
+++ trunk/include/pub_tool_poolalloc.h Sun May 17 20:32:42 2015
@@ -89,6 +89,11 @@
// count.
extern UWord VG_(releasePA) ( PoolAlloc* pa);
+// How many elements are managed by the pool 'pa'. This includes
+// the elements allocated by VG_(allocEltPA), the elements freed by
+// VG_(freeEltPA) and the elements that are in a block and have not
+// yet been allocated.
+extern UWord VG_(sizePA) ( PoolAlloc* pa);
#endif // __PUB_TOOL_POOLALLOC_
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2015-05-17 18:37:21
|
Author: philippe
Date: Sun May 17 19:37:14 2015
New Revision: 15252
Log:
Avoid warning about %d and long int
Modified:
trunk/coregrind/m_gdbserver/remote-utils.c
Modified: trunk/coregrind/m_gdbserver/remote-utils.c
==============================================================================
--- trunk/coregrind/m_gdbserver/remote-utils.c (original)
+++ trunk/coregrind/m_gdbserver/remote-utils.c Sun May 17 19:37:14 2015
@@ -868,7 +868,7 @@
*tr++ = 0;
dlog(3, "putpkt (\"%s\"); (%slen %d) %s\n", tracebuf,
strlen(tracebuf) == p - buf2 ? "binary " : "",
- p - buf2,
+ (int)(p - buf2),
noack_mode ? "[no ack]" : "[looking for ack]");
free (tracebuf);
}
|
|
From: <sv...@va...> - 2015-05-17 18:32:03
|
Author: philippe
Date: Sun May 17 19:31:55 2015
New Revision: 15251
Log:
When process dies due to a signal, show the signal and the stacktrace
at default verbosity
Modified:
trunk/NEWS
trunk/coregrind/m_signals.c
trunk/drd/tests/tc22_exit_w_lock.stderr.exp-32bit
trunk/drd/tests/tc22_exit_w_lock.stderr.exp-64bit
trunk/drd/tests/tc22_exit_w_lock.vgtest
trunk/gdbserver_tests/nlgone_abrt.stderr.exp
trunk/gdbserver_tests/nlgone_abrt.vgtest
trunk/helgrind/tests/tc22_exit_w_lock.stderr.exp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun May 17 19:31:55 2015
@@ -23,6 +23,9 @@
* ==================== OTHER CHANGES ====================
+* When a process dies due to a signal, Valgrind now shows the signal
+ and the stacktrace at default verbosity (i.e. verbosity 1).
+
* Address description logic (used by memcheck and helgrind)
now describes addresses in anonymous segments, file mmap-ed
segments, shared memory segments and the brk data segment.
Modified: trunk/coregrind/m_signals.c
==============================================================================
--- trunk/coregrind/m_signals.c (original)
+++ trunk/coregrind/m_signals.c Sun May 17 19:31:55 2015
@@ -1639,7 +1639,7 @@
core = False;
}
- if ( (VG_(clo_verbosity) > 1 ||
+ if ( (VG_(clo_verbosity) >= 1 ||
(could_core && is_signal_from_kernel(tid, sigNo, info->si_code))
) &&
!VG_(clo_xml) ) {
Modified: trunk/drd/tests/tc22_exit_w_lock.stderr.exp-32bit
==============================================================================
--- trunk/drd/tests/tc22_exit_w_lock.stderr.exp-32bit (original)
+++ trunk/drd/tests/tc22_exit_w_lock.stderr.exp-32bit Sun May 17 19:31:55 2015
@@ -135,5 +135,3 @@
at 0x........: pthread_join (drd_pthread_intercepts.c:?)
by 0x........: main (tc22_exit_w_lock.c:43)
-
-ERROR SUMMARY: 12 errors from 12 contexts (suppressed: 0 from 0)
Modified: trunk/drd/tests/tc22_exit_w_lock.stderr.exp-64bit
==============================================================================
--- trunk/drd/tests/tc22_exit_w_lock.stderr.exp-64bit (original)
+++ trunk/drd/tests/tc22_exit_w_lock.stderr.exp-64bit Sun May 17 19:31:55 2015
@@ -1,4 +1,3 @@
-
Mutex still locked at thread exit: mutex 0x........, recursion count 1, owner 3.
at 0x........: pthread_join (drd_pthread_intercepts.c:?)
by 0x........: main (tc22_exit_w_lock.c:43)
@@ -7,5 +6,3 @@
by 0x........: child_fn1 (tc22_exit_w_lock.c:18)
by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
-
-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Modified: trunk/drd/tests/tc22_exit_w_lock.vgtest
==============================================================================
--- trunk/drd/tests/tc22_exit_w_lock.vgtest (original)
+++ trunk/drd/tests/tc22_exit_w_lock.vgtest Sun May 17 19:31:55 2015
@@ -1,3 +1,3 @@
prereq: ./supported_libpthread && [ -e ../../helgrind/tests/tc22_exit_w_lock ]
-vgopts: --num-callers=3
+vgopts: --num-callers=3 -q
prog: ../../helgrind/tests/tc22_exit_w_lock
Modified: trunk/gdbserver_tests/nlgone_abrt.stderr.exp
==============================================================================
--- trunk/gdbserver_tests/nlgone_abrt.stderr.exp (original)
+++ trunk/gdbserver_tests/nlgone_abrt.stderr.exp Sun May 17 19:31:55 2015
@@ -1,8 +1,5 @@
-Nulgrind, the minimal Valgrind tool
-
(action at startup) vgdb me ...
starting ...
aborting ...
-
Modified: trunk/gdbserver_tests/nlgone_abrt.vgtest
==============================================================================
--- trunk/gdbserver_tests/nlgone_abrt.vgtest (original)
+++ trunk/gdbserver_tests/nlgone_abrt.vgtest Sun May 17 19:31:55 2015
@@ -2,7 +2,7 @@
prog: gone
args: abort
-vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlgone-abrt
+vgopts: -q --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlgone-abrt
stderr_filter: filter_stderr
prereq: test -e gdb
progB: gdb
Modified: trunk/helgrind/tests/tc22_exit_w_lock.stderr.exp
==============================================================================
--- trunk/helgrind/tests/tc22_exit_w_lock.stderr.exp (original)
+++ trunk/helgrind/tests/tc22_exit_w_lock.stderr.exp Sun May 17 19:31:55 2015
@@ -23,6 +23,10 @@
Thread #x: Exiting thread still holds 1 lock
...
+
+Process terminating with default action of signal 6 (SIGABRT)
+ ...
+ by 0x........: main (tc22_exit_w_lock.c:48)
---Thread-Announcement------------------------------------------
Thread #x is the program's root thread
|
|
From: <sv...@va...> - 2015-05-17 16:34:11
|
Author: philippe
Date: Sun May 17 17:34:04 2015
New Revision: 15250
Log:
Improve trace of pkt send by V gdbsrv:
* show the len
* print binary date using \octal notation (like printf, when given
non printable chars)
Modified:
trunk/coregrind/m_gdbserver/remote-utils.c
Modified: trunk/coregrind/m_gdbserver/remote-utils.c
==============================================================================
--- trunk/coregrind/m_gdbserver/remote-utils.c (original)
+++ trunk/coregrind/m_gdbserver/remote-utils.c Sun May 17 17:34:04 2015
@@ -851,10 +851,27 @@
return -1;
}
- if (noack_mode)
- dlog(3, "putpkt (\"%s\"); [no ack]\n", buf2);
- else
- dlog(3,"putpkt (\"%s\"); [looking for ack]\n", buf2);
+ if (VG_(debugLog_getLevel)() >= 3) {
+ char *tracebuf = malloc(4 * (p - buf2) + 1); // worst case
+ char *tr = tracebuf;
+
+ for (UInt npr = 0; npr < p - buf2; npr++) {
+ UChar uc = (unsigned char)buf2[npr];
+ if (uc > 31 && uc < 127) {
+ *tr++ = uc;
+ } else {
+ *tr++ = '\\';
+ VG_(sprintf)(tr, "%03o", uc);
+ tr += 3;
+ }
+ }
+ *tr++ = 0;
+ dlog(3, "putpkt (\"%s\"); (%slen %d) %s\n", tracebuf,
+ strlen(tracebuf) == p - buf2 ? "binary " : "",
+ p - buf2,
+ noack_mode ? "[no ack]" : "[looking for ack]");
+ free (tracebuf);
+ }
if (noack_mode)
break;
|
Author: rhyskidd
Date: Sun May 17 15:02:34 2015
New Revision: 15249
Log:
Fix unhandled syscall: unix:410 (sigsuspend_nocancel) on OS X. bz#319274.
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/memcheck/tests/darwin/scalar.c
trunk/memcheck/tests/darwin/scalar.stderr.exp
trunk/memcheck/tests/darwin/scalar_nocancel.c
trunk/memcheck/tests/darwin/scalar_nocancel.stderr.exp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun May 17 15:02:34 2015
@@ -91,6 +91,7 @@
254164 OS X task_info: UNKNOWN task message [id 3405, to mach_task_self(),
reply 0x........]
269360 s390x: Fix addressing mode selection for compare-and-swap
+319274 Fix unhandled syscall: unix:410 (sigsuspend_nocancel) on OS X
333051 mmap of huge pages fails due to incorrect alignment
== 339163
334802 valgrind does not always explain why a given option is bad
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sun May 17 15:02:34 2015
@@ -9824,7 +9824,7 @@
GENX_(__NR_select_nocancel, sys_select),
GENX_(__NR_fsync_nocancel, sys_fsync),
MACX_(__NR_connect_nocancel, connect),
-// _____(__NR_sigsuspend_nocancel),
+ MACX_(__NR_sigsuspend_nocancel, sigsuspend),
GENXY(__NR_readv_nocancel, sys_readv),
GENX_(__NR_writev_nocancel, sys_writev),
MACX_(__NR_sendto_nocancel, sendto),
Modified: trunk/memcheck/tests/darwin/scalar.c
==============================================================================
--- trunk/memcheck/tests/darwin/scalar.c (original)
+++ trunk/memcheck/tests/darwin/scalar.c Sun May 17 15:02:34 2015
@@ -222,7 +222,8 @@
GO_UNIMP(110, "old sigsetmask");
- // __NR_sigsuspend 111
+ GO(__NR_sigsuspend, 111, "ignore");
+ // (I don't know how to test this...)
GO_UNIMP(112, "old sigstack");
Modified: trunk/memcheck/tests/darwin/scalar.stderr.exp
==============================================================================
--- trunk/memcheck/tests/darwin/scalar.stderr.exp (original)
+++ trunk/memcheck/tests/darwin/scalar.stderr.exp Sun May 17 15:02:34 2015
@@ -338,6 +338,9 @@
(110): old sigsetmask
-----------------------------------------------------
-----------------------------------------------------
+x200006f(111): __NR_sigsuspend ignore
+-----------------------------------------------------
+-----------------------------------------------------
(112): old sigstack
-----------------------------------------------------
-----------------------------------------------------
Modified: trunk/memcheck/tests/darwin/scalar_nocancel.c
==============================================================================
--- trunk/memcheck/tests/darwin/scalar_nocancel.c (original)
+++ trunk/memcheck/tests/darwin/scalar_nocancel.c Sun May 17 15:02:34 2015
@@ -37,6 +37,10 @@
// __NR_fsync_nocancel 408
// __NR_connect_nocancel 409
// __NR_sigsuspend_nocancel 410
+
+ GO(__NR_sigsuspend_nocancel, 410, "ignore");
+ // (I don't know how to test this...)
+
// __NR_readv_nocancel 411
// __NR_writev_nocancel 412
// __NR_sendto_nocancel 413
Modified: trunk/memcheck/tests/darwin/scalar_nocancel.stderr.exp
==============================================================================
--- trunk/memcheck/tests/darwin/scalar_nocancel.stderr.exp (original)
+++ trunk/memcheck/tests/darwin/scalar_nocancel.stderr.exp Sun May 17 15:02:34 2015
@@ -1,4 +1,7 @@
-----------------------------------------------------
+x200019a(410):__NR_sigsuspend_nocancel ignore
+-----------------------------------------------------
+-----------------------------------------------------
x20001a4(420):__NR_sem_wait_nocancel 1s 0m
-----------------------------------------------------
Syscall param sem_wait(sem) contains uninitialised byte(s)
|
Author: philippe
Date: Sun May 17 14:38:25 2015
New Revision: 15248
Log:
* Let GDB user modify the signal to send to the guest process
* implement qXfer:siginfo:read: packet to allow GDB to show $_siginfo
Modified:
trunk/NEWS
trunk/coregrind/m_gdbserver/m_gdbserver.c
trunk/coregrind/m_gdbserver/server.c
trunk/coregrind/m_gdbserver/server.h
trunk/coregrind/m_gdbserver/target.c
trunk/coregrind/m_signals.c
trunk/coregrind/pub_core_gdbserver.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun May 17 14:38:25 2015
@@ -49,6 +49,13 @@
compiler version is 14.0 or later.
* New and modified GDB server monitor features:
+ - When a signal is reported in GDB, you can now use the GDB convenience
+ variable $_siginfo to examine detailed signal information.
+
+ - Valgrind gdbserver now allows the user to change the signal
+ to deliver to the process. So, use 'signal SIGNAL' to continue execution
+ with SIGNAL instead of the signal reported to GDB. Use 'signal 0' to
+ continue without passing the signal to the process.
- With recent GDB (>= 7.9.50.20150514-cvs), the command 'target remote'
will automatically load the executable file of the process running
Modified: trunk/coregrind/m_gdbserver/m_gdbserver.c
==============================================================================
--- trunk/coregrind/m_gdbserver/m_gdbserver.c (original)
+++ trunk/coregrind/m_gdbserver/m_gdbserver.c Sun May 17 14:38:25 2015
@@ -934,16 +934,24 @@
return ret;
}
-
-void VG_(gdbserver_report_fatal_signal) (Int vki_sigNo, ThreadId tid)
+static void dlog_signal (const HChar *who, const vki_siginfo_t *info,
+ ThreadId tid)
{
- dlog(1, "VG core calling VG_(gdbserver_report_fatal_signal) "
+ dlog(1, "VG core calling %s "
"vki_nr %d %s gdb_nr %d %s tid %d\n",
- vki_sigNo, VG_(signame)(vki_sigNo),
- target_signal_from_host (vki_sigNo),
- target_signal_to_name(target_signal_from_host (vki_sigNo)),
+ who,
+ info->si_signo, VG_(signame)(info->si_signo),
+ target_signal_from_host (info->si_signo),
+ target_signal_to_name(target_signal_from_host (info->si_signo)),
tid);
+}
+
+void VG_(gdbserver_report_fatal_signal) (const vki_siginfo_t *info,
+ ThreadId tid)
+{
+ dlog_signal("VG_(gdbserver_report_fatal_signal)", info, tid);
+
if (remote_connected()) {
dlog(1, "already connected, assuming already reported\n");
return;
@@ -952,21 +960,16 @@
VG_(umsg)("(action on fatal signal) vgdb me ... \n");
/* indicate to gdbserver that there is a signal */
- gdbserver_signal_encountered (vki_sigNo);
+ gdbserver_signal_encountered (info);
/* let gdbserver do some work, e.g. show the signal to the user */
call_gdbserver (tid, signal_reason);
}
-Bool VG_(gdbserver_report_signal) (Int vki_sigNo, ThreadId tid)
+Bool VG_(gdbserver_report_signal) (vki_siginfo_t *info, ThreadId tid)
{
- dlog(1, "VG core calling VG_(gdbserver_report_signal) "
- "vki_nr %d %s gdb_nr %d %s tid %d\n",
- vki_sigNo, VG_(signame)(vki_sigNo),
- target_signal_from_host (vki_sigNo),
- target_signal_to_name(target_signal_from_host (vki_sigNo)),
- tid);
+ dlog_signal("VG_(gdbserver_report_signal)", info, tid);
/* if gdbserver is currently not connected, then signal
is to be given to the process */
@@ -977,19 +980,20 @@
/* if gdb has informed gdbserver that this signal can be
passed directly without informing gdb, then signal is
to be given to the process. */
- if (pass_signals[target_signal_from_host(vki_sigNo)]) {
+ if (pass_signals[target_signal_from_host(info->si_signo)]) {
dlog(1, "pass_signals => pass\n");
return True;
}
/* indicate to gdbserver that there is a signal */
- gdbserver_signal_encountered (vki_sigNo);
+ gdbserver_signal_encountered (info);
- /* let gdbserver do some work, e.g. show the signal to the user */
+ /* let gdbserver do some work, e.g. show the signal to the user.
+ User can also decide to ignore the signal or change the signal. */
call_gdbserver (tid, signal_reason);
/* ask gdbserver what is the final decision */
- if (gdbserver_deliver_signal (vki_sigNo)) {
+ if (gdbserver_deliver_signal (info)) {
dlog(1, "gdbserver deliver signal\n");
return True;
} else {
Modified: trunk/coregrind/m_gdbserver/server.c
==============================================================================
--- trunk/coregrind/m_gdbserver/server.c (original)
+++ trunk/coregrind/m_gdbserver/server.c Sun May 17 14:38:25 2015
@@ -857,8 +857,10 @@
}
VG_(lseek) (fd, ofs, VKI_SEEK_SET);
len_read = VG_(read) (fd, toread, len);
- *new_packet_len_p = write_qxfer_response (arg_own_buf, (unsigned char *)toread,
- len_read, ofs + len_read < doc_len);
+ *new_packet_len_p = write_qxfer_response (arg_own_buf,
+ (unsigned char *)toread,
+ len_read,
+ ofs + len_read < doc_len);
VG_(close) (fd);
return;
}
@@ -878,8 +880,8 @@
return;
}
- if (len > PBUFSIZ - 2)
- len = PBUFSIZ - 2;
+ if (len > PBUFSIZ - POVERHSIZ)
+ len = PBUFSIZ - POVERHSIZ;
data = malloc (len);
{
@@ -925,12 +927,13 @@
unsigned long pid;
const HChar *name;
- /* Reject any annex; grab the offset and length. */
+ /* grab the annex, offset and length. */
if (decode_xfer_read (arg_own_buf + 21, &annex, &ofs, &len) < 0) {
strcpy (arg_own_buf, "E00");
return;
}
+ /* Reject any annex with invalid/unexpected pid */
if (strlen(annex) > 0)
pid = strtoul (annex, NULL, 16);
else
@@ -974,6 +977,44 @@
return;
}
+ if (strncmp ("qXfer:siginfo:read:", arg_own_buf, 19) == 0) {
+ vki_siginfo_t info;
+ int n;
+ CORE_ADDR ofs;
+ unsigned int len;
+ const char *annex;
+
+ /* Reject any annex; grab the offset and length. */
+ if (decode_xfer_read (arg_own_buf + 19, &annex, &ofs, &len) < 0
+ || annex[0] != '\0') {
+ strcpy (arg_own_buf, "E00");
+ return;
+ }
+
+ if (len > PBUFSIZ - POVERHSIZ)
+ len = PBUFSIZ - POVERHSIZ;
+
+ gdbserver_pending_signal_to_report(&info);
+
+ if (ofs >= sizeof(info))
+ n = -1;
+ else
+ n = sizeof(info) - ofs;
+
+ if (n < 0)
+ write_enn (arg_own_buf);
+ else if (n > len)
+ *new_packet_len_p = write_qxfer_response (arg_own_buf,
+ (unsigned char *)&info,
+ len, 1);
+ else
+ *new_packet_len_p = write_qxfer_response (arg_own_buf,
+ (unsigned char *)&info,
+ n, 0);
+
+ return;
+ }
+
/* Protocol features query. */
if (strncmp ("qSupported", arg_own_buf, 10) == 0
&& (arg_own_buf[10] == ':' || arg_own_buf[10] == '\0')) {
@@ -1000,6 +1041,7 @@
initialize_shadow_low(False);
}
strcat (arg_own_buf, ";qXfer:exec-file:read+");
+ strcat (arg_own_buf, ";qXfer:siginfo:read+");
return;
}
@@ -1097,7 +1139,7 @@
putpkt (own_buf);
}
- /* If we our status is terminal (exit or fatal signal) get out
+ /* If our status is terminal (exit or fatal signal) get out
as quickly as we can. We won't be able to handle any request
anymore. */
if (status == 'W' || status == 'X') {
Modified: trunk/coregrind/m_gdbserver/server.h
==============================================================================
--- trunk/coregrind/m_gdbserver/server.h (original)
+++ trunk/coregrind/m_gdbserver/server.h Sun May 17 14:38:25 2015
@@ -206,11 +206,17 @@
A call to call_gdbserver is needed to send the resume reply to GDB.
After this call, gdbserver_deliver_signal indicates if the signal
is effectively to be delivered to the guest process. */
-extern void gdbserver_signal_encountered (Int vki_sigNo);
-/* between these two calls, call call_gdbserver */
+extern void gdbserver_signal_encountered (const vki_siginfo_t *info);
+/* between these two calls, call call_gdbserver.
+ Between these 2 calls the signal to report to GDB can be retrieved using
+ gdbserver_pending_signal_to_report. */
/* If gdbserver_deliver_signal True, then gdb did not ask
to ignore the signal, so signal can be delivered to the guest. */
-extern Bool gdbserver_deliver_signal (Int vki_sigNo);
+extern Bool gdbserver_deliver_signal (vki_siginfo_t *info);
+
+/* Signal info last provided with gdbserver_signal_encountered.
+ It is what is/will be reported to GDB. */
+extern void gdbserver_pending_signal_to_report (vki_siginfo_t /* OUT */ *info);
/* Called when a process is about to go with reason ('W' or 'X') and code.
This sets global variables that will be used to return the process
Modified: trunk/coregrind/m_gdbserver/target.c
==============================================================================
--- trunk/coregrind/m_gdbserver/target.c (original)
+++ trunk/coregrind/m_gdbserver/target.c Sun May 17 14:38:25 2015
@@ -153,17 +153,28 @@
*/
static CORE_ADDR resume_pc;
-static int vki_signal_to_report;
+static vki_siginfo_t vki_signal_to_report;
+static vki_siginfo_t vki_signal_to_deliver;
-void gdbserver_signal_encountered (Int vki_sigNo)
+void gdbserver_signal_encountered (const vki_siginfo_t *info)
{
- vki_signal_to_report = vki_sigNo;
+ vki_signal_to_report = *info;
+ vki_signal_to_deliver = *info;
}
-static int vki_signal_to_deliver;
-Bool gdbserver_deliver_signal (Int vki_sigNo)
+void gdbserver_pending_signal_to_report (vki_siginfo_t *info)
{
- return vki_sigNo == vki_signal_to_deliver;
+ *info = vki_signal_to_report;
+}
+
+Bool gdbserver_deliver_signal (vki_siginfo_t *info)
+{
+ if (info->si_signo != vki_signal_to_deliver.si_signo)
+ dlog(1, "GDB changed signal info %d to_report %d to_deliver %d\n",
+ info->si_signo, vki_signal_to_report.si_signo,
+ vki_signal_to_deliver.si_signo);
+ *info = vki_signal_to_deliver;
+ return vki_signal_to_deliver.si_signo != 0;
}
static unsigned char exit_status_to_report;
@@ -238,7 +249,10 @@
C2v(stopped_data_address));
VG_(set_watchpoint_stop_address) ((Addr) 0);
}
- vki_signal_to_deliver = resume_info->sig;
+ vki_signal_to_deliver.si_signo = resume_info->sig;
+ /* signal was reported to GDB, GDB told us to resume execution.
+ So, reset the signal to report to 0. */
+ VG_(memset) (&vki_signal_to_report, 0, sizeof(vki_signal_to_report));
stepping = resume_info->step;
resume_pc = (*the_low_target.get_pc) ();
@@ -288,12 +302,10 @@
and with a signal TRAP (i.e. a breakpoint), unless there is
a signal to report. */
*ourstatus = 'T';
- if (vki_signal_to_report == 0)
+ if (vki_signal_to_report.si_signo == 0)
sig = TARGET_SIGNAL_TRAP;
- else {
- sig = target_signal_from_host(vki_signal_to_report);
- vki_signal_to_report = 0;
- }
+ else
+ sig = target_signal_from_host(vki_signal_to_report.si_signo);
if (vgdb_interrupted_tid != 0)
tst = VG_(get_ThreadState) (vgdb_interrupted_tid);
Modified: trunk/coregrind/m_signals.c
==============================================================================
--- trunk/coregrind/m_signals.c (original)
+++ trunk/coregrind/m_signals.c Sun May 17 14:38:25 2015
@@ -694,12 +694,15 @@
/* returns True if signal is to be ignored.
To check this, possibly call gdbserver with tid. */
-static Bool is_sig_ign(Int sigNo, ThreadId tid)
+static Bool is_sig_ign(vki_siginfo_t *info, ThreadId tid)
{
- vg_assert(sigNo >= 1 && sigNo <= _VKI_NSIG);
+ vg_assert(info->si_signo >= 1 && info->si_signo <= _VKI_NSIG);
- return scss.scss_per_sig[sigNo].scss_handler == VKI_SIG_IGN
- || !VG_(gdbserver_report_signal) (sigNo, tid);
+ /* If VG_(gdbserver_report_signal) tells to report the signal,
+ then verify if this signal is not to be ignored. GDB might have
+ modified si_signo, so we check after the call to gdbserver. */
+ return !VG_(gdbserver_report_signal) (info, tid)
+ || scss.scss_per_sig[info->si_signo].scss_handler == VKI_SIG_IGN;
}
/* ---------------------------------------------------------------------
@@ -1786,7 +1789,7 @@
&& VG_(dyn_vgdb_error) <= VG_(get_n_errs_shown)() + 1) {
/* Note: we add + 1 to n_errs_shown as the fatal signal was not
reported through error msg, and so was not counted. */
- VG_(gdbserver_report_fatal_signal) (sigNo, tid);
+ VG_(gdbserver_report_fatal_signal) (info, tid);
}
if (VG_(is_action_requested)( "Attach to debugger", & VG_(clo_db_attach) )) {
@@ -1922,7 +1925,7 @@
/* Even if gdbserver indicates to ignore the signal, we must deliver it.
So ignore the return value of VG_(gdbserver_report_signal). */
- (void) VG_(gdbserver_report_signal) (VKI_SIGSEGV, tid);
+ (void) VG_(gdbserver_report_signal) (&info, tid);
/* If they're trying to block the signal, force it to be delivered */
if (VG_(sigismember)(&VG_(threads)[tid].sig_mask, VKI_SIGSEGV))
@@ -1962,7 +1965,7 @@
info.si_code = VKI_ILL_ILLOPC; /* jrs: no idea what this should be */
info.VKI_SIGINFO_si_addr = (void*)addr;
- if (VG_(gdbserver_report_signal) (VKI_SIGILL, tid)) {
+ if (VG_(gdbserver_report_signal) (&info, tid)) {
resume_scheduler(tid);
deliver_signal(tid, &info, NULL);
}
@@ -1987,7 +1990,7 @@
in .si_addr. Oh well. */
/* info.VKI_SIGINFO_si_addr = (void*)addr; */
- if (VG_(gdbserver_report_signal) (VKI_SIGBUS, tid)) {
+ if (VG_(gdbserver_report_signal) (&info, tid)) {
resume_scheduler(tid);
deliver_signal(tid, &info, NULL);
}
@@ -2027,7 +2030,7 @@
# endif
/* fixs390: do we need to do anything here for s390 ? */
- if (VG_(gdbserver_report_signal) (VKI_SIGTRAP, tid)) {
+ if (VG_(gdbserver_report_signal) (&info, tid)) {
resume_scheduler(tid);
deliver_signal(tid, &info, &uc);
}
@@ -2236,7 +2239,7 @@
/* (2) */
/* Set up the thread's state to deliver a signal */
- if (!is_sig_ign(info->si_signo, tid))
+ if (!is_sig_ign(info, tid))
deliver_signal(tid, info, uc);
/* It's crucial that (1) and (2) happen in the order (1) then (2)
@@ -2508,7 +2511,7 @@
}
if (VG_(in_generated_code)) {
- if (VG_(gdbserver_report_signal) (sigNo, tid)
+ if (VG_(gdbserver_report_signal) (info, tid)
|| VG_(sigismember)(&tst->sig_mask, sigNo)) {
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
@@ -2714,7 +2717,7 @@
/* OK, something to do; deliver it */
if (VG_(clo_trace_signals))
VG_(dmsg)("Polling found signal %d for tid %d\n", sip->si_signo, tid);
- if (!is_sig_ign(sip->si_signo, tid))
+ if (!is_sig_ign(sip, tid))
deliver_signal(tid, sip, NULL);
else if (VG_(clo_trace_signals))
VG_(dmsg)(" signal %d ignored\n", sip->si_signo);
Modified: trunk/coregrind/pub_core_gdbserver.h
==============================================================================
--- trunk/coregrind/pub_core_gdbserver.h (original)
+++ trunk/coregrind/pub_core_gdbserver.h Sun May 17 14:38:25 2015
@@ -105,14 +105,19 @@
// no gdb is connected, or gdb instructs to pass the signal.
// Note that if the below returns True, the signal might
// still be ignored if this is the action desired by the
-// guest program.
-extern Bool VG_(gdbserver_report_signal) (Int vki_signo, ThreadId tid);
+// guest program. Using GDB, the user can also modify the signal to be
+// reported (e.g. changing the signo to pass to the guest).
+// If this function returns True, m_signals.c should deliver the signal
+// info as modified by VG_(gdbserver_report_signal).
+// If this function returns False, no signal should be reported.
+extern Bool VG_(gdbserver_report_signal) (vki_siginfo_t *info, ThreadId tid);
// If no gdb is connected yet, wait for a gdb to connect and report
// this (supposedly) fatal signal.
// If a gdb is already connected, this does nothing (as normally
// the signal was already reported to the already connected gdb).
-extern void VG_(gdbserver_report_fatal_signal) (Int vki_signo, ThreadId tid);
+extern void VG_(gdbserver_report_fatal_signal) (const vki_siginfo_t *info,
+ ThreadId tid);
/* Entry point invoked by scheduler.c to execute the request
VALGRIND_CLIENT_MONITOR_COMMAND.
|
|
From: Philippe W. <phi...@sk...> - 2015-05-17 08:25:42
|
On Fri, 2015-05-15 at 21:37 +0200, Matthias Schwarzott wrote: > The updated patch is attached. > > Regards > Matthias Thanks, committed revision 15247. |
|
From: <sv...@va...> - 2015-05-17 08:24:47
|
Author: philippe
Date: Sun May 17 09:24:40 2015
New Revision: 15247
Log:
Add some more cfi directives
With some gcc versions, without these directives, unwind does
not work or gives strange entries in stack traces.
Patch from Matthias Schwarzott
Modified:
trunk/coregrind/m_syscall.c
trunk/coregrind/m_syswrap/syscall-amd64-linux.S
trunk/coregrind/m_syswrap/syscall-x86-linux.S
Modified: trunk/coregrind/m_syscall.c
==============================================================================
--- trunk/coregrind/m_syscall.c (original)
+++ trunk/coregrind/m_syscall.c Sun May 17 09:24:40 2015
@@ -308,12 +308,16 @@
" .cfi_startproc\n"
" push %esi\n"
" .cfi_adjust_cfa_offset 4\n"
+" .cfi_offset %esi, -8\n"
" push %edi\n"
" .cfi_adjust_cfa_offset 4\n"
+" .cfi_offset %edi, -12\n"
" push %ebx\n"
" .cfi_adjust_cfa_offset 4\n"
+" .cfi_offset %ebx, -16\n"
" push %ebp\n"
" .cfi_adjust_cfa_offset 4\n"
+" .cfi_offset %ebp, -20\n"
" movl 16+ 4(%esp),%eax\n"
" movl 16+ 8(%esp),%ebx\n"
" movl 16+12(%esp),%ecx\n"
@@ -324,12 +328,16 @@
" int $0x80\n"
" popl %ebp\n"
" .cfi_adjust_cfa_offset -4\n"
+" .cfi_restore %ebp\n"
" popl %ebx\n"
" .cfi_adjust_cfa_offset -4\n"
+" .cfi_restore %ebx\n"
" popl %edi\n"
" .cfi_adjust_cfa_offset -4\n"
+" .cfi_restore %edi\n"
" popl %esi\n"
" .cfi_adjust_cfa_offset -4\n"
+" .cfi_restore %esi\n"
" ret\n"
" .cfi_endproc\n"
".previous\n"
Modified: trunk/coregrind/m_syswrap/syscall-amd64-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-amd64-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-amd64-linux.S Sun May 17 09:24:40 2015
@@ -77,29 +77,52 @@
.globl ML_(do_syscall_for_client_WRK)
ML_(do_syscall_for_client_WRK):
+ .cfi_startproc
/* save callee-saved regs */
pushq %rbx
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rbx, -16
pushq %rbp
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rbp, -24
pushq %r12
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r12, -32
pushq %r13
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r13, -40
pushq %r14
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r14, -48
pushq %r15
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r15, -56
#define FSZ ((4+1)*4) /* 4 args + ret addr */
-#define PUSH_di_si_dx_cx_8 \
- pushq %rdi ; \
- pushq %rsi ; \
- pushq %rdx ; \
- pushq %rcx ; \
- pushq %r8
-
-#define POP_di_si_dx_cx_8 \
- popq %r8 ; \
- popq %rcx ; \
- popq %rdx ; \
- popq %rsi ; \
- popq %rdi
+#define PUSH_di_si_dx_cx_8 \
+ pushq %rdi ; \
+ .cfi_adjust_cfa_offset 8 ; \
+ pushq %rsi ; \
+ .cfi_adjust_cfa_offset 8 ; \
+ pushq %rdx ; \
+ .cfi_adjust_cfa_offset 8 ; \
+ pushq %rcx ; \
+ .cfi_adjust_cfa_offset 8 ; \
+ pushq %r8 ; \
+ .cfi_adjust_cfa_offset 8
+
+#define POP_di_si_dx_cx_8 \
+ popq %r8 ; \
+ .cfi_adjust_cfa_offset -8 ; \
+ popq %rcx ; \
+ .cfi_adjust_cfa_offset -8 ; \
+ popq %rdx ; \
+ .cfi_adjust_cfa_offset -8 ; \
+ popq %rsi ; \
+ .cfi_adjust_cfa_offset -8 ; \
+ popq %rdi ; \
+ .cfi_adjust_cfa_offset -8
1: /* Even though we can't take a signal until the sigprocmask completes,
start the range early.
@@ -129,6 +152,7 @@
movq %rsi, %rax /* rax --> VexGuestAMD64State * */
pushq %rdi /* syscallno -> stack */
+ .cfi_adjust_cfa_offset 8
movq OFFSET_amd64_RDI(%rax), %rdi
movq OFFSET_amd64_RSI(%rax), %rsi
movq OFFSET_amd64_RDX(%rax), %rdx
@@ -136,6 +160,7 @@
movq OFFSET_amd64_R8(%rax), %r8
movq OFFSET_amd64_R9(%rax), %r9
popq %rax /* syscallno -> %rax */
+ .cfi_adjust_cfa_offset -8
/* If rip==2, then the syscall was either just about
to start, or was interrupted and the kernel was
@@ -168,24 +193,38 @@
5: /* now safe from signals */
movq $0, %rax /* SUCCESS */
popq %r15
+ .cfi_adjust_cfa_offset -8
popq %r14
+ .cfi_adjust_cfa_offset -8
popq %r13
+ .cfi_adjust_cfa_offset -8
popq %r12
+ .cfi_adjust_cfa_offset -8
popq %rbp
+ .cfi_adjust_cfa_offset -8
popq %rbx
+ .cfi_adjust_cfa_offset -8
ret
+ .cfi_adjust_cfa_offset 6*8
7: /* failure: return 0x8000 | error code */
negq %rax
andq $0x7FFF, %rax
orq $0x8000, %rax
popq %r15
+ .cfi_adjust_cfa_offset -8
popq %r14
+ .cfi_adjust_cfa_offset -8
popq %r13
+ .cfi_adjust_cfa_offset -8
popq %r12
+ .cfi_adjust_cfa_offset -8
popq %rbp
+ .cfi_adjust_cfa_offset -8
popq %rbx
+ .cfi_adjust_cfa_offset -8
ret
+ .cfi_endproc
#undef FSZ
.section .rodata
Modified: trunk/coregrind/m_syswrap/syscall-x86-linux.S
==============================================================================
--- trunk/coregrind/m_syswrap/syscall-x86-linux.S (original)
+++ trunk/coregrind/m_syswrap/syscall-x86-linux.S Sun May 17 09:24:40 2015
@@ -78,11 +78,20 @@
.globl ML_(do_syscall_for_client_WRK)
ML_(do_syscall_for_client_WRK):
+ .cfi_startproc
/* save callee-saved regs */
push %esi
+ .cfi_adjust_cfa_offset 4
+ .cfi_offset %esi, -8
push %edi
+ .cfi_adjust_cfa_offset 4
+ .cfi_offset %esi, -12
push %ebx
+ .cfi_adjust_cfa_offset 4
+ .cfi_offset %esi, -16
push %ebp
+ .cfi_adjust_cfa_offset 4
+ .cfi_offset %esi, -20
#define FSZ ((4+1)*4) /* 4 args + ret addr */
1: /* Even though we can't take a signal until the sigprocmask completes,
@@ -131,20 +140,30 @@
5: /* now safe from signals */
movl $0, %eax /* SUCCESS */
popl %ebp
+ .cfi_adjust_cfa_offset -4
popl %ebx
+ .cfi_adjust_cfa_offset -4
popl %edi
+ .cfi_adjust_cfa_offset -4
popl %esi
+ .cfi_adjust_cfa_offset -4
ret
+ .cfi_adjust_cfa_offset 4*4
7: /* failure: return 0x8000 | error code */
negl %eax
andl $0x7FFF, %eax
orl $0x8000, %eax
popl %ebp
+ .cfi_adjust_cfa_offset -4
popl %ebx
+ .cfi_adjust_cfa_offset -4
popl %edi
+ .cfi_adjust_cfa_offset -4
popl %esi
+ .cfi_adjust_cfa_offset -4
ret
+ .cfi_endproc
#undef FSZ
|
|
From: <sv...@va...> - 2015-05-17 07:31:28
|
Author: rhyskidd
Date: Sun May 17 08:31:20 2015
New Revision: 15246
Log:
Fix Warning: noted but unhandled ioctl 0x2000747b on Mac OS X. bz#208217.
Added:
trunk/memcheck/tests/darwin/ioctl-tiocsbrk.c
trunk/memcheck/tests/darwin/ioctl-tiocsbrk.stderr.exp
trunk/memcheck/tests/darwin/ioctl-tiocsbrk.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/memcheck/tests/darwin/ (props changed)
trunk/memcheck/tests/darwin/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sun May 17 08:31:20 2015
@@ -74,6 +74,7 @@
197259 Unsupported arch_prtctl PR_SET_GS option
201152 ppc64: Assertion in ppc32g_dirtyhelper_MFSPR_268_269
201435 Fix Darwin: -v does not show kernel version
+208217 "Warning: noted but unhandled ioctl 0x2000747b" on Mac OS X
211256 Fixed an outdated comment regarding the default platform.
211926 Avoid compilation warnings in valgrind.h with -pedantic
212291 Fix unhandled syscall: unix:132 (mkfifo) on OS X
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sun May 17 08:31:20 2015
@@ -1101,6 +1101,8 @@
switch (ARG2 /* request */) {
case VKI_TIOCSCTTY:
case VKI_TIOCEXCL:
+ case VKI_TIOCSBRK:
+ case VKI_TIOCCBRK:
case VKI_TIOCPTYGRANT:
case VKI_TIOCPTYUNLK:
case VKI_DTRACEHIOC_REMOVE:
@@ -1409,6 +1411,8 @@
case VKI_TIOCPTYGNAME:
POST_MEM_WRITE( ARG3, 128);
break;
+ case VKI_TIOCSBRK: /* set break bit */
+ case VKI_TIOCCBRK: /* clear break bit */
case VKI_TIOCPTYGRANT:
case VKI_TIOCPTYUNLK:
break;
Modified: trunk/memcheck/tests/darwin/Makefile.am
==============================================================================
--- trunk/memcheck/tests/darwin/Makefile.am (original)
+++ trunk/memcheck/tests/darwin/Makefile.am Sun May 17 08:31:20 2015
@@ -9,6 +9,7 @@
aio.stderr.exp aio.vgtest \
deep_badparam.stderr.exp deep_badparam.stdout.exp deep_badparam.vgtest \
env.stderr.exp env.vgtest \
+ ioctl-tiocsbrk.stderr.exp ioctl-tiocsbrk.vgtest \
pth-supp.stderr.exp pth-supp.vgtest \
pth-undocumented.stderr.exp pth-undocumented.stdout.exp pth-undocumented.vgtest \
mkfifo.stderr.exp mkfifo.vgtest \
@@ -21,6 +22,7 @@
aio \
deep_badparam \
env \
+ ioctl-tiocsbrk \
pth-supp \
pth-undocumented \
mkfifo \
Added: trunk/memcheck/tests/darwin/ioctl-tiocsbrk.c
==============================================================================
--- trunk/memcheck/tests/darwin/ioctl-tiocsbrk.c (added)
+++ trunk/memcheck/tests/darwin/ioctl-tiocsbrk.c Sun May 17 08:31:20 2015
@@ -0,0 +1,14 @@
+/* Tests for TIOCSBRK per https://bugs.kde.org/show_bug.cgi?id=208217
+ */
+
+#include <sys/ioctl.h>
+
+int main(int argc, const char *argv[])
+{
+#ifdef TIOCSBRK
+ ioctl(1, TIOCSBRK, 0);
+ ioctl(1, TIOCCBRK, 0);
+#endif
+
+ return 0;
+}
Added: trunk/memcheck/tests/darwin/ioctl-tiocsbrk.stderr.exp
==============================================================================
(empty)
Added: trunk/memcheck/tests/darwin/ioctl-tiocsbrk.vgtest
==============================================================================
--- trunk/memcheck/tests/darwin/ioctl-tiocsbrk.vgtest (added)
+++ trunk/memcheck/tests/darwin/ioctl-tiocsbrk.vgtest Sun May 17 08:31:20 2015
@@ -0,0 +1,2 @@
+prog: ioctl-tiocsbrk
+vgopts: -q
|
|
From: <sv...@va...> - 2015-05-17 06:01:12
|
Author: rhyskidd
Date: Sun May 17 07:01:04 2015
New Revision: 15245
Log:
Followup to r15242 - as PRE() and POST() wrappers utilised, define with the *XY variant.
Modified:
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sun May 17 07:01:04 2015
@@ -9498,7 +9498,7 @@
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(129)), // old truncate
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(130)), // old ftruncate
GENX_(__NR_flock, sys_flock),
- MACX_(__NR_mkfifo, mkfifo),
+ MACXY(__NR_mkfifo, mkfifo),
MACX_(__NR_sendto, sendto),
MACX_(__NR_shutdown, shutdown),
MACXY(__NR_socketpair, socketpair),
|
|
From: <sv...@va...> - 2015-05-16 16:24:26
|
Author: florian
Date: Sat May 16 17:24:19 2015
New Revision: 15244
Log:
Add VG_(am_stack_limits) and use it in VG_(stack_limits).
With this change the implementation detail call "reservation
segment" is hidden in the address space manager.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
branches/ASPACEM_TWEAKS/coregrind/m_stacks.c
branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Sat May 16 17:24:19 2015
@@ -1307,6 +1307,48 @@
}
}
+
+/* If ADDR is located in a stack segment return True and set return via
+ START and END the address limits of that segment. Otherwise, return
+ False and set the limts to 0. */
+Bool VG_(am_stack_limits)( Addr addr, /*OUT*/Addr *start, /*OUT*/Addr *end )
+{
+ const NSegment *seg = nsegments + find_nsegment_idx(addr);
+
+ switch (seg->kind) {
+ case SkFree:
+ goto bad;
+
+ case SkAnonC:
+ case SkFileC:
+ case SkShmC:
+ case SkAnonV:
+ case SkFileV:
+ if (!seg->hasR || !seg->hasW) goto bad;
+ *start = seg->start;
+ *end = seg->end;
+ return True;
+
+ case SkResvn:
+ /* If ADDR is an unmapped address in an extensible client stack
+ then this is OK. */
+ if (seg->smode != SmUpper) goto bad;
+ *start = seg->start;
+ seg = VG_(am_next_nsegment)(seg, /*forward*/ True);
+ if (!seg || seg->kind != SkAnonC || !seg->hasR || !seg->hasW) goto bad;
+ *end = seg->end;
+ return True;
+
+ default:
+ aspacem_assert(0);
+ }
+
+ bad:
+ *start = *end = 0;
+ return False;
+}
+
+
/*-----------------------------------------------------------------*/
/*--- ---*/
/*--- Modifying the segment array, and constructing segments. ---*/
Modified: branches/ASPACEM_TWEAKS/coregrind/m_stacks.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_stacks.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_stacks.c Sat May 16 17:24:19 2015
@@ -270,73 +270,43 @@
void VG_(stack_limits)(Addr SP, Addr *start, Addr *end )
{
Stack* stack = find_stack_by_addr(SP);
- NSegment const *stackseg = VG_(am_find_nsegment) (SP);
if (LIKELY(stack)) {
*start = stack->start;
*end = stack->end;
}
- /* SP is assumed to be in a RW segment or in the SkResvn segment of an
- extensible stack (normally, only the main thread has an extensible
- stack segment).
+ /* SP is assumed to be in a stack segment.
If no such segment is found, assume we have no valid
stack for SP, and set *start and *end to 0.
Otherwise, possibly reduce the stack limits using the boundaries of
- the RW segment/SkResvn segments containing SP. */
- if (UNLIKELY(stackseg == NULL)) {
+ the stack segment containing SP. */
+ Addr stackseg_start, stackseg_end;
+ if (UNLIKELY(! VG_(am_stack_limits)(SP, &stackseg_start, &stackseg_end))) {
VG_(debugLog)(2, "stacks",
- "no addressable segment for SP %p\n",
- (void*)SP);
+ "SP %p is not located in a stack segment or stack segment "
+ "has wrong permissions\n", (void*)SP);
*start = 0;
*end = 0;
return;
}
- if (UNLIKELY((!stackseg->hasR || !stackseg->hasW)
- && (stackseg->kind != SkResvn || stackseg->smode != SmUpper))) {
- VG_(debugLog)(2, "stacks",
- "segment for SP %p is not RW or not a SmUpper Resvn\n",
- (void*)SP);
- *start = 0;
- *end = 0;
- return;
- }
-
- /* SP is in a RW segment, or in the SkResvn of an extensible stack.
- We can use the seg start as the stack start limit. */
- if (UNLIKELY(*start < stackseg->start)) {
+ /* SP is located in a stack segment */
+ if (UNLIKELY(*start < stackseg_start)) {
VG_(debugLog)(2, "stacks",
"segment for SP %p changed stack start limit"
" from %p to %p\n",
- (void*)SP, (void*)*start, (void*)stackseg->start);
- *start = stackseg->start;
- }
-
- /* Now, determine the stack end limit. If the stackseg is SkResvn,
- we need to get the neighbour segment (towards higher addresses).
- This segment must be anonymous and RW. */
- if (UNLIKELY(stackseg->kind == SkResvn)) {
- stackseg = VG_(am_next_nsegment)(stackseg, /*forward*/ True);
- if (!stackseg || !stackseg->hasR || !stackseg->hasW
- || stackseg->kind != SkAnonC) {
- VG_(debugLog)(2, "stacks",
- "Next forward segment for SP %p Resvn segment"
- " is not RW or not AnonC\n",
- (void*)SP);
- *start = 0;
- *end = 0;
- return;
- }
+ (void*)SP, (void*)*start, (void*)stackseg_start);
+ *start = stackseg_start;
}
/* Limit the stack end limit, using the found segment. */
- if (UNLIKELY(*end > stackseg->end)) {
+ if (UNLIKELY(*end > stackseg_end)) {
VG_(debugLog)(2, "stacks",
"segment for SP %p changed stack end limit"
" from %p to %p\n",
- (void*)SP, (void*)*end, (void*)stackseg->end);
- *end = stackseg->end;
+ (void*)SP, (void*)*end, (void*)stackseg_end);
+ *end = stackseg_end;
}
/* If reducing start and/or end to the SP segment gives an
Modified: branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h (original)
+++ branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h Sat May 16 17:24:19 2015
@@ -92,6 +92,11 @@
extensible client stack segment. */
extern Bool VG_(am_addr_is_in_extensible_client_stack)( Addr addr, HChar kind );
+/* If ADDR is located in a segment that looks like a stack segment, return
+ the start and end addresses of that segment. */
+extern Bool VG_(am_stack_limits)( Addr addr, /*OUT*/Addr *start,
+ /*OUT*/Addr *end );
+
/* Trivial fn: return the total amount of space in anonymous mappings,
both for V and the client. Is used for printing stats in
out-of-memory messages. */
|
|
From: <sv...@va...> - 2015-05-16 16:18:01
|
Author: florian
Date: Sat May 16 17:17:52 2015
New Revision: 15243
Log:
Enable a few more compiler warnings.
Modified:
trunk/Makefile.all.am
trunk/configure.ac
trunk/coregrind/m_signals.c
trunk/memcheck/tests/vbit-test/vtest.h
Modified: trunk/Makefile.all.am
==============================================================================
--- trunk/Makefile.all.am (original)
+++ trunk/Makefile.all.am Sat May 16 17:17:52 2015
@@ -110,6 +110,9 @@
@FLAG_W_WRITE_STRINGS@ \
@FLAG_W_FORMAT@ \
@FLAG_W_FORMAT_SECURITY@ \
+ @FLAG_W_IGNORED_QUALIFIERS@ \
+ @FLAG_W_MISSING_PARAMETER_TYPE@ \
+ @FLAG_W_OLD_STYLE_DECLARATION@ \
@FLAG_FNO_STACK_PROTECTOR@ \
@FLAG_FSANITIZE@ \
-fno-strict-aliasing \
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat May 16 17:17:52 2015
@@ -1760,7 +1760,9 @@
AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
AC_GCC_WARNING_SUBST([format-security], [FLAG_W_FORMAT_SECURITY])
AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
-
+AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
+AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
+AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
# does this compiler support -Wextra or the older -W ?
Modified: trunk/coregrind/m_signals.c
==============================================================================
--- trunk/coregrind/m_signals.c (original)
+++ trunk/coregrind/m_signals.c Sat May 16 17:17:52 2015
@@ -1794,7 +1794,7 @@
}
if (core) {
- const static struct vki_rlimit zero = { 0, 0 };
+ static const struct vki_rlimit zero = { 0, 0 };
VG_(make_coredump)(tid, info, corelim.rlim_cur);
Modified: trunk/memcheck/tests/vbit-test/vtest.h
==============================================================================
--- trunk/memcheck/tests/vbit-test/vtest.h (original)
+++ trunk/memcheck/tests/vbit-test/vtest.h Sat May 16 17:17:52 2015
@@ -125,7 +125,7 @@
void typeof_primop(IROp, IRType *t_dst, IRType *t_arg1, IRType *t_arg2,
IRType *t_arg3, IRType *t_arg4);
-static unsigned __inline__ bitsof_irtype(IRType type)
+static __inline__ unsigned bitsof_irtype(IRType type)
{
return type == Ity_I1 ? 1 : sizeof_irtype(type) * 8;
}
|
|
From: <sv...@va...> - 2015-05-16 16:16:44
|
Author: florian
Date: Sat May 16 17:16:37 2015
New Revision: 3146
Log:
Cleanups to allow compilation with -Wold-style-declaration.
Modified:
trunk/priv/guest_s390_toIR.c
trunk/priv/ir_inject.c
Modified: trunk/priv/guest_s390_toIR.c
==============================================================================
--- trunk/priv/guest_s390_toIR.c (original)
+++ trunk/priv/guest_s390_toIR.c Sat May 16 17:16:37 2015
@@ -235,7 +235,7 @@
}
/* Add a statement that stores DATA at ADDR. This is a big-endian machine. */
-static void __inline__
+static __inline__ void
store(IRExpr *addr, IRExpr *data)
{
stmt(IRStmt_Store(Iend_BE, addr, data));
Modified: trunk/priv/ir_inject.c
==============================================================================
--- trunk/priv/ir_inject.c (original)
+++ trunk/priv/ir_inject.c Sat May 16 17:16:37 2015
@@ -141,7 +141,7 @@
/* Store a value to memory. If a value requires more than 8 bytes a series
of 8-byte stores will be generated. */
-static void __inline__
+static __inline__ void
store(IRSB *irsb, IREndness endian, HWord haddr, IRExpr *data)
{
IROp high, low;
|
Author: rhyskidd
Date: Sat May 16 15:48:08 2015
New Revision: 15242
Log:
Fix unhandled syscall: unix:132 (mkfifo) on OS X. bz#212291.
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/memcheck/tests/darwin/scalar.c
trunk/memcheck/tests/darwin/scalar.stderr.exp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat May 16 15:48:08 2015
@@ -76,6 +76,8 @@
201435 Fix Darwin: -v does not show kernel version
211256 Fixed an outdated comment regarding the default platform.
211926 Avoid compilation warnings in valgrind.h with -pedantic
+212291 Fix unhandled syscall: unix:132 (mkfifo) on OS X
+ == 263119
226609 Crediting upstream authors in man page
231257 Valgrind omits path when executing script from shebang line
254164 OS X task_info: UNKNOWN task message [id 3405, to mach_task_self(),
Modified: trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
==============================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-darwin.h (original)
+++ trunk/coregrind/m_syswrap/priv_syswrap-darwin.h Sat May 16 15:48:08 2015
@@ -189,7 +189,7 @@
// old truncate
// old ftruncate
// GEN flock 131
-// NYI mkfifo 132
+DECL_TEMPLATE(darwin, mkfifo); // 132
DECL_TEMPLATE(darwin, sendto); // 133
DECL_TEMPLATE(darwin, shutdown); // 134
DECL_TEMPLATE(darwin, socketpair); // 135
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sat May 16 15:48:08 2015
@@ -3590,6 +3590,25 @@
SET_STATUS_from_SysRes(r);
}
+PRE(mkfifo)
+{
+ *flags |= SfMayBlock;
+ PRINT("mkfifo ( %#lx(%s), %ld )",ARG1,(char *)ARG1,(vki_mode_t)ARG2);
+ PRE_REG_READ2(long, "mkfifo", const char *, path, vki_mode_t, mode);
+ PRE_MEM_RASCIIZ( "mkfifo(path)", ARG1 );
+}
+
+POST(mkfifo)
+{
+ vg_assert(SUCCESS);
+ if (!ML_(fd_allowed)(RES, "mkfifo", tid, True)) {
+ VG_(close)(RES);
+ SET_STATUS_Failure( VKI_EMFILE );
+ } else {
+ if (VG_(clo_track_fds))
+ ML_(record_fd_open_with_given_name)(tid, RES, (Char*)ARG1);
+ }
+}
PRE(sendto)
{
@@ -9479,7 +9498,7 @@
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(129)), // old truncate
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(130)), // old ftruncate
GENX_(__NR_flock, sys_flock),
-// _____(__NR_mkfifo),
+ MACX_(__NR_mkfifo, mkfifo),
MACX_(__NR_sendto, sendto),
MACX_(__NR_shutdown, shutdown),
MACXY(__NR_socketpair, socketpair),
Modified: trunk/memcheck/tests/darwin/scalar.c
==============================================================================
--- trunk/memcheck/tests/darwin/scalar.c (original)
+++ trunk/memcheck/tests/darwin/scalar.c Sat May 16 15:48:08 2015
@@ -259,7 +259,10 @@
GO_UNIMP(130, "old ftruncate");
// __NR_flock 131
- // __NR_mkfifo 132
+
+ GO(__NR_mkfifo, 132, "2s 1m");
+ SY(__NR_mkfifo, x0, x0); FAIL;
+
// __NR_sendto 133
// __NR_shutdown 134
// __NR_socketpair 135
Modified: trunk/memcheck/tests/darwin/scalar.stderr.exp
==============================================================================
--- trunk/memcheck/tests/darwin/scalar.stderr.exp (original)
+++ trunk/memcheck/tests/darwin/scalar.stderr.exp Sat May 16 15:48:08 2015
@@ -386,6 +386,19 @@
(130): old ftruncate
-----------------------------------------------------
-----------------------------------------------------
+x2000084(132): __NR_mkfifo 2s 1m
+-----------------------------------------------------
+Syscall param mkfifo(mode) contains uninitialised byte(s)
+ ...
+ by 0x........: main (in ./scalar)
+
+Syscall param mkfifo(path) points to unaddressable byte(s)
+ ...
+ by 0x........: main (in ./scalar)
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+-----------------------------------------------------
+-----------------------------------------------------
(141): old getpeername
-----------------------------------------------------
-----------------------------------------------------
|
|
From: <sv...@va...> - 2015-05-16 14:18:44
|
Author: rhyskidd
Date: Sat May 16 15:18:36 2015
New Revision: 15241
Log:
Add (presently) failing test case for bz#212291.
Added:
trunk/memcheck/tests/darwin/mkfifo.c
trunk/memcheck/tests/darwin/mkfifo.stderr.exp
trunk/memcheck/tests/darwin/mkfifo.vgtest
Modified:
trunk/memcheck/tests/darwin/ (props changed)
trunk/memcheck/tests/darwin/Makefile.am
Modified: trunk/memcheck/tests/darwin/Makefile.am
==============================================================================
--- trunk/memcheck/tests/darwin/Makefile.am (original)
+++ trunk/memcheck/tests/darwin/Makefile.am Sat May 16 15:18:36 2015
@@ -11,6 +11,7 @@
env.stderr.exp env.vgtest \
pth-supp.stderr.exp pth-supp.vgtest \
pth-undocumented.stderr.exp pth-undocumented.stdout.exp pth-undocumented.vgtest \
+ mkfifo.stderr.exp mkfifo.vgtest \
scalar.stderr.exp scalar.vgtest \
scalar_fork.stderr.exp scalar_fork.vgtest \
scalar_nocancel.stderr.exp scalar_nocancel.vgtest \
@@ -22,6 +23,7 @@
env \
pth-supp \
pth-undocumented \
+ mkfifo \
scalar \
scalar_fork \
scalar_nocancel \
Added: trunk/memcheck/tests/darwin/mkfifo.c
==============================================================================
--- trunk/memcheck/tests/darwin/mkfifo.c (added)
+++ trunk/memcheck/tests/darwin/mkfifo.c Sat May 16 15:18:36 2015
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifndef SYS_mkfifo
+# define SYS_mkfifo 132
+#endif
+
+static char f_name[]="mkfifo_data_file";
+
+int mkfifo(const char *path)
+{
+ return syscall(SYS_mkfifo, path);
+}
+
+int main(void)
+{
+ int fd;
+
+ fd = mkfifo(f_name);
+
+ if (fd == -1)
+ perror("mkfifo"), exit(1);
+
+ unlink(f_name);
+
+ return 0;
+}
Added: trunk/memcheck/tests/darwin/mkfifo.stderr.exp
==============================================================================
(empty)
Added: trunk/memcheck/tests/darwin/mkfifo.vgtest
==============================================================================
--- trunk/memcheck/tests/darwin/mkfifo.vgtest (added)
+++ trunk/memcheck/tests/darwin/mkfifo.vgtest Sat May 16 15:18:36 2015
@@ -0,0 +1,2 @@
+prog: mkfifo
+vgopts: -q
|
Author: florian
Date: Sat May 16 13:23:29 2015
New Revision: 15240
Log:
Merge from trunk
Added:
branches/ASPACEM_TWEAKS/helgrind/tests/pth_cond_destroy_busy.stderr.exp-ppc64
- copied unchanged from r15239, trunk/helgrind/tests/pth_cond_destroy_busy.stderr.exp-ppc64
branches/ASPACEM_TWEAKS/massif/tests/big-alloc.post.exp-ppc64
- copied unchanged from r15239, trunk/massif/tests/big-alloc.post.exp-ppc64
branches/ASPACEM_TWEAKS/massif/tests/deep-D.post.exp-ppc64
- copied unchanged from r15239, trunk/massif/tests/deep-D.post.exp-ppc64
Modified:
branches/ASPACEM_TWEAKS/ (props changed)
branches/ASPACEM_TWEAKS/NEWS
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-common.c
branches/ASPACEM_TWEAKS/coregrind/m_gdbserver/server.c
branches/ASPACEM_TWEAKS/coregrind/m_libcassert.c
branches/ASPACEM_TWEAKS/coregrind/m_libcfile.c
branches/ASPACEM_TWEAKS/coregrind/m_stacks.c
branches/ASPACEM_TWEAKS/coregrind/m_xarray.c
branches/ASPACEM_TWEAKS/helgrind/hg_main.c
branches/ASPACEM_TWEAKS/helgrind/libhb_core.c
branches/ASPACEM_TWEAKS/helgrind/tests/Makefile.am
branches/ASPACEM_TWEAKS/include/vki/vki-scnums-tilegx-linux.h
branches/ASPACEM_TWEAKS/massif/tests/Makefile.am
branches/ASPACEM_TWEAKS/memcheck/mc_leakcheck.c
branches/ASPACEM_TWEAKS/memcheck/tests/filter_strchr
branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.supp
branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.vgtest
branches/ASPACEM_TWEAKS/shared/vg_replace_strmem.c
branches/ASPACEM_TWEAKS/tests/filter_libc
Modified: branches/ASPACEM_TWEAKS/NEWS
==============================================================================
--- branches/ASPACEM_TWEAKS/NEWS (original)
+++ branches/ASPACEM_TWEAKS/NEWS Sat May 16 13:23:29 2015
@@ -48,6 +48,14 @@
* Valgrind can be built with Intel's ICC compiler. The required
compiler version is 14.0 or later.
+* New and modified GDB server monitor features:
+
+ - With recent GDB (>= 7.9.50.20150514-cvs), the command 'target remote'
+ will automatically load the executable file of the process running
+ under Valgrind. This means you do not need to specify the executable
+ file yourself, GDB will discover it itself.
+ See GDB documentation about 'qXfer:exec-file:read' packet for more info.
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
@@ -173,6 +181,7 @@
346487 Compiler generates "note" about a future ABI change for PPC64
346801 Fix link error on OS X: _vgModuleLocal_sf_maybe_extend_stack
347151 Fix suppression for pthread_rwlock_init on OS X 10.8
+347233 Fix memcheck/tests/strchr on OS X 10.10 (Haswell)
347379 valgrind --leak-check=full memleak errors from system libraries on OS X 10.8
== 217236
347389 unhandled syscall: 373 (Linux ARM syncfs)
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-common.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-common.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-common.c Sat May 16 13:23:29 2015
@@ -247,7 +247,7 @@
SysRes res = VG_(do_syscall4)(__NR_openat,
VKI_AT_FDCWD, (UWord)pathname, flags, mode);
# elif defined(VGP_tilegx_linux)
- SysRes res = VG_(do_syscall4)(__NR_openat, AT_FDCWD, (UWord)pathname,
+ SysRes res = VG_(do_syscall4)(__NR_openat, VKI_AT_FDCWD, (UWord)pathname,
flags, mode);
# else
SysRes res = VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mode);
@@ -273,8 +273,8 @@
res = VG_(do_syscall4)(__NR_readlinkat, VKI_AT_FDCWD,
(UWord)path, (UWord)buf, bufsiz);
# elif defined(VGP_tilegx_linux)
- res = VG_(do_syscall4)(__NR_readlinkat, AT_FDCWD, (UWord)path, (UWord)buf,
- bufsiz);
+ res = VG_(do_syscall4)(__NR_readlinkat, VKI_AT_FDCWD, (UWord)path,
+ (UWord)buf, bufsiz);
# else
res = VG_(do_syscall3)(__NR_readlink, (UWord)path, (UWord)buf, bufsiz);
# endif
Modified: branches/ASPACEM_TWEAKS/coregrind/m_gdbserver/server.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_gdbserver/server.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_gdbserver/server.c Sat May 16 13:23:29 2015
@@ -916,6 +916,63 @@
return;
}
+ if (strncmp ("qXfer:exec-file:read:", arg_own_buf, 21) == 0) {
+ unsigned char *data;
+ int n;
+ CORE_ADDR ofs;
+ unsigned int len;
+ const char *annex;
+ unsigned long pid;
+ const HChar *name;
+
+ /* Reject any annex; grab the offset and length. */
+ if (decode_xfer_read (arg_own_buf + 21, &annex, &ofs, &len) < 0) {
+ strcpy (arg_own_buf, "E00");
+ return;
+ }
+
+ if (strlen(annex) > 0)
+ pid = strtoul (annex, NULL, 16);
+ else
+ pid = 0;
+ if ((int)pid != VG_(getpid)() && pid != 0) {
+ VG_(sprintf) (arg_own_buf,
+ "E.Valgrind gdbserver pid is %d."
+ " Cannot give info for pid %d",
+ VG_(getpid)(), (int) pid);
+ return;
+ }
+
+ if (len > PBUFSIZ - 2)
+ len = PBUFSIZ - 2;
+ data = malloc (len);
+
+ if (!VG_(resolve_filename)(VG_(cl_exec_fd), &name)) {
+ VG_(sprintf) (arg_own_buf,
+ "E.Valgrind gdbserver could not"
+ " resolve pid %d exec filename.",
+ VG_(getpid)());
+ return;
+ }
+
+ if (ofs >= strlen(name))
+ n = -1;
+ else {
+ n = strlen(name) - ofs;
+ VG_(memcpy) (data, name, n);
+ }
+
+ if (n < 0)
+ write_enn (arg_own_buf);
+ else if (n > len)
+ *new_packet_len_p = write_qxfer_response (arg_own_buf, data, len, 1);
+ else
+ *new_packet_len_p = write_qxfer_response (arg_own_buf, data, n, 0);
+
+ free (data);
+
+ return;
+ }
/* Protocol features query. */
if (strncmp ("qSupported", arg_own_buf, 10) == 0
@@ -923,7 +980,7 @@
VG_(sprintf) (arg_own_buf, "PacketSize=%x", PBUFSIZ - 1);
/* Note: max packet size including frame and checksum, but without
trailing null byte, which is not sent/received. */
-
+
strcat (arg_own_buf, ";QStartNoAckMode+");
strcat (arg_own_buf, ";QPassSignals+");
if (VG_(client_auxv))
@@ -942,6 +999,7 @@
not properly connect. */
initialize_shadow_low(False);
}
+ strcat (arg_own_buf, ";qXfer:exec-file:read+");
return;
}
Modified: branches/ASPACEM_TWEAKS/coregrind/m_libcassert.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_libcassert.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_libcassert.c Sat May 16 13:23:29 2015
@@ -369,8 +369,9 @@
has exited, then valgrind_stack_base points to the stack base. */
if (VG_(threads)[i].status == VgTs_Empty
&& (!exited_threads || stack == 0)) continue;
- VG_(printf)("\nThread %d: status = %s\n", i,
- VG_(name_of_ThreadStatus)(VG_(threads)[i].status) );
+ VG_(printf)("\nThread %d: status = %s (lwpid %d)\n", i,
+ VG_(name_of_ThreadStatus)(VG_(threads)[i].status),
+ VG_(threads)[i].os_state.lwpid);
if (VG_(threads)[i].status != VgTs_Empty)
VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
if (stack_usage && VG_(threads)[i].client_stack_highest_byte != 0 ) {
@@ -388,8 +389,8 @@
if (stack_usage && stack != 0)
VG_(printf)("valgrind stack top usage: %ld of %ld\n",
VG_(clo_valgrind_stacksize)
- - VG_(am_get_VgStack_unused_szB)(stack,
- VG_(clo_valgrind_stacksize)),
+ - VG_(am_get_VgStack_unused_szB)
+ (stack, VG_(clo_valgrind_stacksize)),
(SizeT) VG_(clo_valgrind_stacksize));
}
VG_(printf)("\n");
Modified: branches/ASPACEM_TWEAKS/coregrind/m_libcfile.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_libcfile.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_libcfile.c Sat May 16 13:23:29 2015
@@ -435,7 +435,7 @@
Int VG_(rename) ( const HChar* old_name, const HChar* new_name )
{
# if defined(VGP_tilegx_linux)
- SysRes res = VG_(do_syscall3)(__NR_renameat, AT_FDCWD,
+ SysRes res = VG_(do_syscall3)(__NR_renameat, VKI_AT_FDCWD,
(UWord)old_name, (UWord)new_name);
# else
SysRes res = VG_(do_syscall2)(__NR_rename, (UWord)old_name, (UWord)new_name);
Modified: branches/ASPACEM_TWEAKS/coregrind/m_stacks.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_stacks.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_stacks.c Sat May 16 13:23:29 2015
@@ -272,7 +272,7 @@
Stack* stack = find_stack_by_addr(SP);
NSegment const *stackseg = VG_(am_find_nsegment) (SP);
- if (stack) {
+ if (LIKELY(stack)) {
*start = stack->start;
*end = stack->end;
}
@@ -284,7 +284,7 @@
stack for SP, and set *start and *end to 0.
Otherwise, possibly reduce the stack limits using the boundaries of
the RW segment/SkResvn segments containing SP. */
- if (stackseg == NULL) {
+ if (UNLIKELY(stackseg == NULL)) {
VG_(debugLog)(2, "stacks",
"no addressable segment for SP %p\n",
(void*)SP);
@@ -293,8 +293,8 @@
return;
}
- if ((!stackseg->hasR || !stackseg->hasW)
- && (stackseg->kind != SkResvn || stackseg->smode != SmUpper)) {
+ if (UNLIKELY((!stackseg->hasR || !stackseg->hasW)
+ && (stackseg->kind != SkResvn || stackseg->smode != SmUpper))) {
VG_(debugLog)(2, "stacks",
"segment for SP %p is not RW or not a SmUpper Resvn\n",
(void*)SP);
@@ -303,8 +303,9 @@
return;
}
- // SP is in a RW segment, or in the SkResvn of an extensible stack.
- if (*start < stackseg->start) {
+ /* SP is in a RW segment, or in the SkResvn of an extensible stack.
+ We can use the seg start as the stack start limit. */
+ if (UNLIKELY(*start < stackseg->start)) {
VG_(debugLog)(2, "stacks",
"segment for SP %p changed stack start limit"
" from %p to %p\n",
@@ -312,7 +313,10 @@
*start = stackseg->start;
}
- if (stackseg->kind == SkResvn) {
+ /* Now, determine the stack end limit. If the stackseg is SkResvn,
+ we need to get the neighbour segment (towards higher addresses).
+ This segment must be anonymous and RW. */
+ if (UNLIKELY(stackseg->kind == SkResvn)) {
stackseg = VG_(am_next_nsegment)(stackseg, /*forward*/ True);
if (!stackseg || !stackseg->hasR || !stackseg->hasW
|| stackseg->kind != SkAnonC) {
@@ -326,7 +330,8 @@
}
}
- if (*end > stackseg->end) {
+ /* Limit the stack end limit, using the found segment. */
+ if (UNLIKELY(*end > stackseg->end)) {
VG_(debugLog)(2, "stacks",
"segment for SP %p changed stack end limit"
" from %p to %p\n",
@@ -336,7 +341,7 @@
/* If reducing start and/or end to the SP segment gives an
empty range, return 'empty' limits */
- if (*start > *end) {
+ if (UNLIKELY(*start > *end)) {
VG_(debugLog)(2, "stacks",
"stack for SP %p start %p after end %p\n",
(void*)SP, (void*)*start, (void*)end);
Modified: branches/ASPACEM_TWEAKS/coregrind/m_xarray.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_xarray.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_xarray.c Sat May 16 13:23:29 2015
@@ -128,9 +128,10 @@
inline void* VG_(indexXA) ( const XArray* xa, Word n )
{
vg_assert(xa);
- // vg_assert(n >= 0); If n negative, the UWord conversion will make
- // it bigger than usedsizeE.
- vg_assert((UWord)n < xa->usedsizeE);
+ /* vg_assert(n >= 0); If n negative, the UWord conversion will make
+ it bigger than usedsizeE, which is verified to be non negative when
+ xa is modified. */
+ vg_assert((UWord)n < (UWord)xa->usedsizeE);
return ((char*)xa->arr) + n * xa->elemSzB;
}
Modified: branches/ASPACEM_TWEAKS/helgrind/hg_main.c
==============================================================================
--- branches/ASPACEM_TWEAKS/helgrind/hg_main.c (original)
+++ branches/ASPACEM_TWEAKS/helgrind/hg_main.c Sat May 16 13:23:29 2015
@@ -5568,7 +5568,11 @@
VG_(track_die_mem_stack_signal)( evh__die_mem );
VG_(track_die_mem_brk) ( evh__die_mem_munmap );
VG_(track_die_mem_munmap) ( evh__die_mem_munmap );
- VG_(track_die_mem_stack) ( evh__die_mem );
+
+ /* evh__die_mem calls at the end libhb_srange_noaccess_NoFX
+ which has no effect. We do not use VG_(track_die_mem_stack),
+ as this would be an expensive way to do nothing. */
+ // VG_(track_die_mem_stack) ( evh__die_mem );
// FIXME: what is this for?
VG_(track_ban_mem_stack) (NULL);
Modified: branches/ASPACEM_TWEAKS/helgrind/libhb_core.c
==============================================================================
--- branches/ASPACEM_TWEAKS/helgrind/libhb_core.c (original)
+++ branches/ASPACEM_TWEAKS/helgrind/libhb_core.c Sat May 16 13:23:29 2015
@@ -899,6 +899,34 @@
}
}
+/* Returns the nr of linesF which are in use. Note: this is scanning
+ the secmap wordFM. So, this is to be used for statistics only. */
+__attribute__((noinline))
+static UWord shmem__SecMap_used_linesF(void)
+{
+ UWord secmapW = 0;
+ Addr gaKey;
+ UWord inUse = 0;
+ UWord total = 0;
+
+ VG_(initIterFM)( map_shmem );
+ while (VG_(nextIterFM)( map_shmem, &gaKey, &secmapW )) {
+ UWord i;
+ SecMap* sm = (SecMap*)secmapW;
+ tl_assert(sm->magic == SecMap_MAGIC);
+
+ for (i = 0; i < sm->linesF_size; i++) {
+ LineF* lineF = &sm->linesF[i];
+ if (lineF->inUse)
+ inUse++;
+ total++;
+ }
+ }
+ VG_(doneIterFM)( map_shmem );
+ tl_assert (stats__secmap_linesF_allocd == total);
+
+ return inUse;
+}
/* ------------ LineF and LineZ related ------------ */
@@ -1647,7 +1675,7 @@
if (address_in_range(cache_shmem.tags0[ga_ix], ga, szB))
cache_shmem.tags0[ga_ix] = 1/*INVALID*/;
ga_ix++;
- if (ga_ix == N_WAY_NENT)
+ if (UNLIKELY(ga_ix == N_WAY_NENT))
ga_ix = 0;
}
}
@@ -3568,9 +3596,12 @@
}
}
-static void Filter__clear_range ( Filter* fi, Addr a, UWord len )
+/* Only used to verify the fast Filter__clear_range */
+__attribute__((unused))
+static void Filter__clear_range_SLOW ( Filter* fi, Addr a, UWord len )
{
- //VG_(printf)("%lu ", len);
+ tl_assert (CHECK_ZSM);
+
/* slowly do part preceding 8-alignment */
while (UNLIKELY(!VG_IS_8_ALIGNED(a)) && LIKELY(len > 0)) {
Filter__clear_1byte( fi, a );
@@ -3591,6 +3622,151 @@
}
}
+static void Filter__clear_range ( Filter* fi, Addr a, UWord len )
+{
+# if CHECK_ZSM > 0
+ /* We check the below more complex algorithm with the simple one.
+ This check is very expensive : we do first the slow way on a
+ copy of the data, then do it the fast way. On RETURN, we check
+ the two values are equal. */
+ Filter fi_check = *fi;
+ Filter__clear_range_SLOW(&fi_check, a, len);
+# define RETURN goto check_and_return
+# else
+# define RETURN return
+# endif
+
+ Addr begtag = FI_GET_TAG(a); /* tag of range begin */
+
+ Addr end = a + len - 1;
+ Addr endtag = FI_GET_TAG(end); /* tag of range end. */
+
+ UWord rlen = len; /* remaining length to clear */
+
+ Addr c = a; /* Current position we are clearing. */
+ UWord clineno = FI_GET_LINENO(c); /* Current lineno we are clearing */
+ FiLine* cline; /* Current line we are clearing */
+ UWord cloff; /* Current offset in line we are clearing, when clearing
+ partial lines. */
+
+ UShort u16;
+
+ STATIC_ASSERT (FI_LINE_SZB == 32);
+ // Below assumes filter lines are 32 bytes
+
+ if (LIKELY(fi->tags[clineno] == begtag)) {
+ /* LIKELY for the heavy caller VG_(unknown_SP_update). */
+ /* First filter line matches begtag.
+ If c is not at the filter line begin, the below will clear
+ the filter line bytes starting from c. */
+ cline = &fi->lines[clineno];
+ cloff = (c - begtag) / 8;
+
+ /* First the byte(s) needed to reach 8-alignment */
+ if (UNLIKELY(!VG_IS_8_ALIGNED(c))) {
+ /* hiB is the nr of bytes (higher addresses) from c to reach
+ 8-aligment. */
+ UWord hiB = 8 - (c & 7);
+ /* Compute 2-bit/byte mask representing hiB bytes [c..c+hiB[
+ mask is C000 , F000, FC00, FF00, FFC0, FFF0 or FFFC for the byte
+ range 7..7 6..7 5..7 4..7 3..7 2..7 1..7 */
+ UShort mask = 0xFFFF << (16 - 2*hiB);
+
+ u16 = cline->u16s[cloff];
+ if (LIKELY(rlen >= hiB)) {
+ cline->u16s[cloff] = u16 & ~mask; /* clear all hiB from c */
+ rlen -= hiB;
+ c += hiB;
+ cloff += 1;
+ } else {
+ /* Only have the bits for rlen bytes bytes. */
+ mask = mask & ~(0xFFFF << (16 - 2*(hiB-rlen)));
+ cline->u16s[cloff] = u16 & ~mask; /* clear rlen bytes from c. */
+ RETURN; // We have cleared all what we can.
+ }
+ }
+ /* c is now 8 aligned. Clear by 8 aligned bytes,
+ till c is filter-line aligned */
+ while (!VG_IS_32_ALIGNED(c) && rlen >= 8) {
+ cline->u16s[cloff] = 0;
+ c += 8;
+ rlen -= 8;
+ cloff += 1;
+ }
+ } else {
+ c = begtag + FI_LINE_SZB;
+ if (c > end)
+ RETURN; // We have cleared all what we can.
+ rlen -= c - a;
+ }
+ // We have changed c, so re-establish clineno.
+ clineno = FI_GET_LINENO(c);
+
+ if (rlen >= FI_LINE_SZB) {
+ /* Here, c is filter line-aligned. Clear all full lines that
+ overlap with the range starting at c, made of a full lines */
+ UWord nfull = rlen / FI_LINE_SZB;
+ UWord full_len = nfull * FI_LINE_SZB;
+ rlen -= full_len;
+ if (nfull > FI_NUM_LINES)
+ nfull = FI_NUM_LINES; // no need to check several times the same entry.
+
+ for (UWord n = 0; n < nfull; n++) {
+ if (UNLIKELY(address_in_range(fi->tags[clineno], c, full_len))) {
+ cline = &fi->lines[clineno];
+ cline->u16s[0] = 0;
+ cline->u16s[1] = 0;
+ cline->u16s[2] = 0;
+ cline->u16s[3] = 0;
+ STATIC_ASSERT (4 == sizeof(cline->u16s)/sizeof(cline->u16s[0]));
+ }
+ clineno++;
+ if (UNLIKELY(clineno == FI_NUM_LINES))
+ clineno = 0;
+ }
+
+ c += full_len;
+ clineno = FI_GET_LINENO(c);
+ }
+
+ if (CHECK_ZSM) {
+ tl_assert(VG_IS_8_ALIGNED(c));
+ tl_assert(clineno == FI_GET_LINENO(c));
+ }
+
+ /* Do the last filter line, if it was not cleared as a full filter line */
+ if (UNLIKELY(rlen > 0) && fi->tags[clineno] == endtag) {
+ cline = &fi->lines[clineno];
+ cloff = (c - endtag) / 8;
+ if (CHECK_ZSM) tl_assert(FI_GET_TAG(c) == endtag);
+
+ /* c is 8 aligned. Clear by 8 aligned bytes, till we have less than
+ 8 bytes. */
+ while (rlen >= 8) {
+ cline->u16s[cloff] = 0;
+ c += 8;
+ rlen -= 8;
+ cloff += 1;
+ }
+ /* Then the remaining byte(s) */
+ if (rlen > 0) {
+ /* nr of bytes from c to reach end. */
+ UWord loB = rlen;
+ /* Compute mask representing loB bytes [c..c+loB[ :
+ mask is 0003, 000F, 003F, 00FF, 03FF, 0FFF or 3FFF */
+ UShort mask = 0xFFFF >> (16 - 2*loB);
+
+ u16 = cline->u16s[cloff];
+ cline->u16s[cloff] = u16 & ~mask; /* clear all loB from c */
+ }
+ }
+
+# if CHECK_ZSM > 0
+ check_and_return:
+ tl_assert (VG_(memcmp)(&fi_check, fi, sizeof(fi_check)) == 0);
+# endif
+# undef RETURN
+}
/* ------ Read handlers for the filter. ------ */
@@ -6186,9 +6362,10 @@
VG_(printf)(" linesZ: %'10lu allocd (%'12lu bytes occupied)\n",
stats__secmap_linesZ_allocd,
stats__secmap_linesZ_bytes);
- VG_(printf)(" linesF: %'10lu allocd (%'12lu bytes occupied)\n",
- stats__secmap_linesF_allocd,
- stats__secmap_linesF_bytes);
+ VG_(printf)(" linesF: %'10lu allocd (%'12lu bytes occupied)"
+ " (%'10lu used)\n",
+ stats__secmap_linesF_allocd, stats__secmap_linesF_bytes,
+ shmem__SecMap_used_linesF());
VG_(printf)(" secmaps: %'10lu in map (can be scanGCed %'5lu)"
" #%lu scanGC \n",
stats__secmaps_in_map_shmem,
@@ -6786,7 +6963,7 @@
if (CHECK_ZSM) tl_assert(is_sane_SecMap(sm));
for (UInt lz = 0; lz < N_SECMAP_ZLINES; lz++) {
- if (sm->linesZ[lz].dict[0] != SVal_INVALID)
+ if (LIKELY(sm->linesZ[lz].dict[0] != SVal_INVALID))
rcdec_LineZ(&sm->linesZ[lz]);
}
for (UInt lf = 0; lf < sm->linesF_size; lf++) {
Modified: branches/ASPACEM_TWEAKS/helgrind/tests/Makefile.am
==============================================================================
--- branches/ASPACEM_TWEAKS/helgrind/tests/Makefile.am (original)
+++ branches/ASPACEM_TWEAKS/helgrind/tests/Makefile.am Sat May 16 13:23:29 2015
@@ -46,6 +46,7 @@
pth_destroy_cond.vgtest \
pth_destroy_cond.stdout.exp pth_destroy_cond.stderr.exp \
pth_cond_destroy_busy.vgtest pth_cond_destroy_busy.stderr.exp \
+ pth_cond_destroy_busy.stderr.exp-ppc64 \
pth_spinlock.vgtest pth_spinlock.stdout.exp pth_spinlock.stderr.exp \
rwlock_race.vgtest rwlock_race.stdout.exp rwlock_race.stderr.exp \
rwlock_test.vgtest rwlock_test.stdout.exp rwlock_test.stderr.exp \
Modified: branches/ASPACEM_TWEAKS/include/vki/vki-scnums-tilegx-linux.h
==============================================================================
--- branches/ASPACEM_TWEAKS/include/vki/vki-scnums-tilegx-linux.h (original)
+++ branches/ASPACEM_TWEAKS/include/vki/vki-scnums-tilegx-linux.h Sat May 16 13:23:29 2015
@@ -33,8 +33,6 @@
#ifndef __VKI_SCNUMS_TILEGX_LINUX_H
#define __VKI_SCNUMS_TILEGX_LINUX_H
-#define AT_FDCWD -100
-
/* From tilegx linux/include/asm-generic/unistd.h */
#define __NR_io_setup 0
Modified: branches/ASPACEM_TWEAKS/massif/tests/Makefile.am
==============================================================================
--- branches/ASPACEM_TWEAKS/massif/tests/Makefile.am (original)
+++ branches/ASPACEM_TWEAKS/massif/tests/Makefile.am Sat May 16 13:23:29 2015
@@ -8,12 +8,13 @@
alloc-fns-B.post.exp alloc-fns-B.stderr.exp alloc-fns-B.vgtest \
basic.post.exp basic.stderr.exp basic.vgtest \
basic2.post.exp basic2.stderr.exp basic2.vgtest \
- big-alloc.post.exp big-alloc.post.exp-64bit \
+ big-alloc.post.exp big-alloc.post.exp-64bit big-alloc.post.exp-ppc64 \
big-alloc.stderr.exp big-alloc.vgtest \
deep-A.post.exp deep-A.stderr.exp deep-A.vgtest \
deep-B.post.exp deep-B.stderr.exp deep-B.vgtest \
deep-C.post.exp deep-C.stderr.exp deep-C.vgtest \
deep-D.post.exp deep-D.stderr.exp deep-D.vgtest \
+ deep-D.post.exp-ppc64 \
culling1.stderr.exp culling1.vgtest \
culling2.stderr.exp culling2.vgtest \
custom_alloc.post.exp custom_alloc.stderr.exp custom_alloc.vgtest \
Modified: branches/ASPACEM_TWEAKS/memcheck/mc_leakcheck.c
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/mc_leakcheck.c (original)
+++ branches/ASPACEM_TWEAKS/memcheck/mc_leakcheck.c Sat May 16 13:23:29 2015
@@ -648,9 +648,9 @@
if (pot_fn == 0)
continue; // NULL fn pointer. Seems it can happen in vtable.
seg = VG_(am_find_nsegment) (pot_fn);
-#if defined(VGA_ppc64be) || defined(VGA_ppc64le)
- // ppc64 use a thunk table. So, we have one more level of indirection
- // to follow.
+#if defined(VGA_ppc64be)
+ // ppc64BE uses a thunk table (function descriptors), so we have one
+ // more level of indirection to follow.
if (seg == NULL
|| seg->kind != SkFileC
|| !seg->hasR
Modified: branches/ASPACEM_TWEAKS/memcheck/tests/filter_strchr
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/tests/filter_strchr (original)
+++ branches/ASPACEM_TWEAKS/memcheck/tests/filter_strchr Sat May 16 13:23:29 2015
@@ -5,4 +5,5 @@
sed -e "s/: strchr (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/;
s/: _platform_strchr (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/;
s/: _platform_strchr\$VARIANT\$Generic (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/;
+ s/: _platform_strchr\$VARIANT\$Haswell (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/;
s/: strrchr (vg_replace_strmem.c:/: rindex (vg_replace_strmem.c:/"
Modified: branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.supp
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.supp (original)
+++ branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.supp Sat May 16 13:23:29 2015
@@ -13,3 +13,10 @@
fun:main
}
+{
+ <insert_a_suppression_name_here>
+ Memcheck:Jump
+ obj:*
+ fun:generic_start_main.isra.0
+ fun:(below main)
+}
Modified: branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.vgtest
==============================================================================
--- branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.vgtest (original)
+++ branches/ASPACEM_TWEAKS/memcheck/tests/supp_unknown.vgtest Sat May 16 13:23:29 2015
@@ -1,4 +1,4 @@
vgopts: -q --suppressions=supp_unknown.supp
-prog: badjump
+prog: supp_unknown
cleanup: rm -f vgcore.*
stderr_filter_args: badjump.c
Modified: branches/ASPACEM_TWEAKS/shared/vg_replace_strmem.c
==============================================================================
--- branches/ASPACEM_TWEAKS/shared/vg_replace_strmem.c (original)
+++ branches/ASPACEM_TWEAKS/shared/vg_replace_strmem.c Sat May 16 13:23:29 2015
@@ -248,6 +248,7 @@
# if DARWIN_VERS == DARWIN_10_10
/* _platform_strchr$VARIANT$Generic */
STRCHR(libsystemZuplatformZddylib, _platform_strchr$VARIANT$Generic)
+ STRCHR(libsystemZuplatformZddylib, _platform_strchr$VARIANT$Haswell)
# endif
#endif
Modified: branches/ASPACEM_TWEAKS/tests/filter_libc
==============================================================================
--- branches/ASPACEM_TWEAKS/tests/filter_libc (original)
+++ branches/ASPACEM_TWEAKS/tests/filter_libc Sat May 16 13:23:29 2015
@@ -22,6 +22,9 @@
# libc, on some (eg. Darwin) it will be in the main executable.
s/\(below main\) \(.+\)$/(below main)/;
+ # filter out the exact libc-start.c:### line number. (ppc64*)
+ s/\(libc-start.c:[0-9]*\)$/(in \/...libc...)/;
+
# Merge the different C++ operator variations.
s/(at.*)__builtin_new/$1...operator new.../;
s/(at.*)operator new\(unsigned(| int| long)\)/$1...operator new.../;
|
|
From: <sv...@va...> - 2015-05-15 20:09:12
|
Author: carll
Date: Fri May 15 21:09:05 2015
New Revision: 15239
Log:
Patch 5 in a revised series of cleanup patches from Will Schmidt
Add a .exp for the pth_cond_destroy_busy for PPC64 big endian.
This is specifically to cover the last line of output as
seen on ppc64BE, which is "ERROR SUMMARY: X errors from 3 contexts",
where X is 6, versus 3 as seen on other architectures.
The additional errors show up on BE during the "Thread #1: pthread_cond
_destroy: destruction of condition variable being waited upon."
Signed-off-by: Will Schmidt <wil...@vn...>
This patch fixes Vagrind bugzilla 347686
Added:
trunk/helgrind/tests/pth_cond_destroy_busy.stderr.exp-ppc64
Modified:
trunk/helgrind/tests/Makefile.am
Modified: trunk/helgrind/tests/Makefile.am
==============================================================================
--- trunk/helgrind/tests/Makefile.am (original)
+++ trunk/helgrind/tests/Makefile.am Fri May 15 21:09:05 2015
@@ -46,6 +46,7 @@
pth_destroy_cond.vgtest \
pth_destroy_cond.stdout.exp pth_destroy_cond.stderr.exp \
pth_cond_destroy_busy.vgtest pth_cond_destroy_busy.stderr.exp \
+ pth_cond_destroy_busy.stderr.exp-ppc64 \
pth_spinlock.vgtest pth_spinlock.stdout.exp pth_spinlock.stderr.exp \
rwlock_race.vgtest rwlock_race.stdout.exp rwlock_race.stderr.exp \
rwlock_test.vgtest rwlock_test.stdout.exp rwlock_test.stderr.exp \
Added: trunk/helgrind/tests/pth_cond_destroy_busy.stderr.exp-ppc64
==============================================================================
--- trunk/helgrind/tests/pth_cond_destroy_busy.stderr.exp-ppc64 (added)
+++ trunk/helgrind/tests/pth_cond_destroy_busy.stderr.exp-ppc64 Fri May 15 21:09:05 2015
@@ -0,0 +1,50 @@
+
+---Thread-Announcement------------------------------------------
+
+Thread #x is the program's root thread
+
+---Thread-Announcement------------------------------------------
+
+Thread #x was created
+ ...
+ by 0x........: pthread_create@* (hg_intercepts.c:...)
+ by 0x........: main (pth_cond_destroy_busy.c:45)
+
+----------------------------------------------------------------
+
+Possible data race during read of size 1 at 0x........ by thread #x
+Locks held: none
+ at 0x........: my_memcmp (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...)
+ by 0x........: main (pth_cond_destroy_busy.c:52)
+
+This conflicts with a previous write of size 4 by thread #x
+Locks held: none
+ ...
+ by 0x........: pthread_cond_wait_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
+ by 0x........: thread_func (pth_cond_destroy_busy.c:31)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...)
+ ...
+ Address 0x........ is 4 bytes inside data symbol "s_cond"
+
+----------------------------------------------------------------
+
+Thread #x: pthread_cond_destroy: destruction of condition variable being waited upon
+ at 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...)
+ by 0x........: main (pth_cond_destroy_busy.c:52)
+
+----------------------------------------------------------------
+
+Thread #x's call to pthread_cond_destroy failed
+ with error code 16 (EBUSY: Device or resource busy)
+ at 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...)
+ by 0x........: main (pth_cond_destroy_busy.c:52)
+
+First pthread_cond_destroy() call returned EBUSY.
+Second pthread_cond_destroy() call returned success.
+
+ERROR SUMMARY: 6 errors from 3 contexts (suppressed: 0 from 0)
|