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
(2) |
2
(4) |
3
(1) |
4
(7) |
5
|
|
6
|
7
(4) |
8
|
9
(3) |
10
(6) |
11
(13) |
12
(6) |
|
13
(1) |
14
|
15
(1) |
16
|
17
(4) |
18
(3) |
19
(5) |
|
20
(5) |
21
(5) |
22
(5) |
23
(6) |
24
|
25
(1) |
26
(1) |
|
27
(1) |
28
(4) |
29
(5) |
30
|
|
|
|
|
From: Philippe W. <phi...@sk...> - 2016-11-04 22:24:30
|
On Thu, 2016-11-03 at 23:41 -0400, Rhys Kidd wrote: > #if defined(VGO_linux) > +#define PID_EXEPATH "/proc/%d/exe" > +#define SELF_EXEPATH "/proc/self/exe" > +#define SELF_EXEFD "/proc/self/fd/%d" > +#elif defined(VGO_solaris) > +#define PID_EXEPATH "/proc/%d/path/a.out" > +#define SELF_EXEPATH "/proc/self/path/a.out" > +#define SELF_EXEFD "/proc/self/path/%d" > +#endif > > > This changes the logic of the define guards. > > Previously #if defined(VGO_linux) would continue to guard this next > block until the #elif defined(VGO_solaris) took over. > > > The union of #if defined(VGO_linux) || defined(VGO_solaris) does not > cover all platforms that build this file - namely macOS. > > > I'll send a patch shortly to correct this logic. > Humph, completely forgot about macos. Thanks for the fix. Philippe |
|
From: Ivo R. <iv...@iv...> - 2016-11-04 19:08:37
|
2016-11-04 12:32 GMT+01:00 Julian Seward <js...@ac...>: > This is annoying, also because it doesn't matter that brk will > fail, since the libc malloc then tries mmap instead, and succeeds. > > Are there any objections to that? No objections to that. Also note that glibc has this mmap backend fallback but for example Solaris libc does not. So a failure to raise brk is treated as a hard error here. I. |
|
From: <sv...@va...> - 2016-11-04 18:21:30
|
Author: petarj
Date: Fri Nov 4 18:21:22 2016
New Revision: 16117
Log:
mips: Add redir for index function in ld.so.1
Redirect index function in ld.so.1.
Optimize the existing strlen function implementations.
This removes warnings coming from optimized index and strlen functions
in ld.so.1.
Patch by Aleksandar Rikalo.
Modified:
trunk/coregrind/m_redir.c
trunk/coregrind/m_trampoline.S
trunk/coregrind/pub_core_trampoline.h
Modified: trunk/coregrind/m_redir.c
==============================================================================
--- trunk/coregrind/m_redir.c (original)
+++ trunk/coregrind/m_redir.c Fri Nov 4 18:21:22 2016
@@ -1567,10 +1567,15 @@
/* this is mandatory - can't sanely continue without it */
add_hardwired_spec(
- "ld.so.3", "strlen",
+ "ld.so.1", "strlen",
(Addr)&VG_(mips32_linux_REDIR_FOR_strlen),
complain_about_stripped_glibc_ldso
);
+ add_hardwired_spec(
+ "ld.so.1", "index",
+ (Addr)&VG_(mips32_linux_REDIR_FOR_index),
+ complain_about_stripped_glibc_ldso
+ );
}
# elif defined(VGP_mips64_linux)
@@ -1578,10 +1583,15 @@
/* this is mandatory - can't sanely continue without it */
add_hardwired_spec(
- "ld.so.3", "strlen",
+ "ld.so.1", "strlen",
(Addr)&VG_(mips64_linux_REDIR_FOR_strlen),
complain_about_stripped_glibc_ldso
);
+ add_hardwired_spec(
+ "ld.so.1", "index",
+ (Addr)&VG_(mips64_linux_REDIR_FOR_index),
+ complain_about_stripped_glibc_ldso
+ );
}
# elif defined(VGP_tilegx_linux)
Modified: trunk/coregrind/m_trampoline.S
==============================================================================
--- trunk/coregrind/m_trampoline.S (original)
+++ trunk/coregrind/m_trampoline.S Fri Nov 4 18:21:22 2016
@@ -1269,24 +1269,43 @@
/* There's no particular reason that this needs to be handwritten
assembly, but since that's what this file contains, here's a
- simple strlen implementation (written in C and compiled by gcc.)
+ simple index() and strlen() implementations.
*/
+
+.set push
+.set noreorder
+
+.global VG_(mips32_linux_REDIR_FOR_index)
+.type VG_(mips32_linux_REDIR_FOR_index), @function
+VG_(mips32_linux_REDIR_FOR_index):
+ move $v0, $a0
+ index_loop:
+ lbu $t0, 0($v0)
+ beq $t0, $a1, index_end
+ nop
+ bne $t0, $zero, index_loop
+ addiu $v0, $v0, 1
+ move $v0, $zero
+ index_end:
+ jr $ra
+ nop
+.size VG_(mips32_linux_REDIR_FOR_index), .-VG_(mips32_linux_REDIR_FOR_index)
+
.global VG_(mips32_linux_REDIR_FOR_strlen)
.type VG_(mips32_linux_REDIR_FOR_strlen), @function
VG_(mips32_linux_REDIR_FOR_strlen):
- li $v0, 0
- //la $a0, string
- j strlen_cond
+ move $v0, $a0
strlen_loop:
- addiu $v0, $v0, 1
- addiu $a0, $a0, 1
- strlen_cond:
- lbu $t0, ($a0)
+ lbu $t0, 0($a0)
bne $t0, $zero, strlen_loop
- jr $ra
-
+ addiu $a0, $a0, 1
+ subu $v0, $a0, $v0
+ jr $ra
+ addiu $v0, $v0, -1
.size VG_(mips32_linux_REDIR_FOR_strlen), .-VG_(mips32_linux_REDIR_FOR_strlen)
+.set pop
+
.global VG_(trampoline_stuff_end)
VG_(trampoline_stuff_end):
@@ -1319,30 +1338,43 @@
/* There's no particular reason that this needs to be handwritten
assembly, but since that's what this file contains, here's a
- simple strlen implementation (written in C and compiled by gcc.)
+ simple index() and strlen() implementations.
*/
+
+.set push
+.set noreorder
+
+.global VG_(mips64_linux_REDIR_FOR_index)
+.type VG_(mips64_linux_REDIR_FOR_index), @function
+VG_(mips64_linux_REDIR_FOR_index):
+ move $v0, $a0
+ index_loop:
+ lbu $t0, 0($v0)
+ beq $t0, $a1, index_end
+ nop
+ bne $t0, $zero, index_loop
+ daddiu $v0, $v0, 1
+ move $v0, $zero
+ index_end:
+ jr $ra
+ nop
+.size VG_(mips64_linux_REDIR_FOR_index), .-VG_(mips64_linux_REDIR_FOR_index)
+
.global VG_(mips64_linux_REDIR_FOR_strlen)
.type VG_(mips64_linux_REDIR_FOR_strlen), @function
VG_(mips64_linux_REDIR_FOR_strlen):
- lbu $12, 0($4)
- li $13, 0
- beq $12, $0, M01
- nop
-
-M02:
- addiu $13, $13, 1
- addiu $4, $4, 1
- lbu $12, 0($4)
- bne $12, $0, M02
- nop
-
-M01:
- move $2, $13
- jr $31
- nop
-
+ move $v0, $a0
+ strlen_loop:
+ lbu $t0, 0($a0)
+ bne $t0, $zero, strlen_loop
+ daddiu $a0, $a0, 1
+ dsubu $v0, $a0, $v0
+ jr $ra
+ daddiu $v0, $v0, -1
.size VG_(mips64_linux_REDIR_FOR_strlen), .-VG_(mips64_linux_REDIR_FOR_strlen)
+.set pop
+
.global VG_(trampoline_stuff_end)
VG_(trampoline_stuff_end):
Modified: trunk/coregrind/pub_core_trampoline.h
==============================================================================
--- trunk/coregrind/pub_core_trampoline.h (original)
+++ trunk/coregrind/pub_core_trampoline.h Fri Nov 4 18:21:22 2016
@@ -154,11 +154,13 @@
#if defined(VGP_mips32_linux)
extern Addr VG_(mips32_linux_SUBST_FOR_sigreturn);
extern Addr VG_(mips32_linux_SUBST_FOR_rt_sigreturn);
+extern Char* VG_(mips32_linux_REDIR_FOR_index)( const Char*, Int );
extern UInt VG_(mips32_linux_REDIR_FOR_strlen)( void* );
#endif
#if defined(VGP_mips64_linux)
extern Addr VG_(mips64_linux_SUBST_FOR_rt_sigreturn);
+extern Char* VG_(mips64_linux_REDIR_FOR_index)( const Char*, Int );
extern UInt VG_(mips64_linux_REDIR_FOR_strlen)( void* );
#endif
|
|
From: Mark W. <mj...@re...> - 2016-11-04 11:50:38
|
On Fri, 2016-11-04 at 12:32 +0100, Julian Seward wrote: > Some time in the last year or so, V started to complain if attempts to > extend the brk segment failed. This usually never shows with Memcheck > because that replaces malloc and acquires memory from mmap, not brk. > But for tools that don't replace malloc, the message is printed repeatedly, > often many times. For a run of Firefox in Cachegrind, I get 56 instances > of it. This is annoying, also because it doesn't matter that brk will > fail, since the libc malloc then tries mmap instead, and succeeds. > > I would like to turn this into a one-time message, thusly: > > ==2109== brk segment overflow in thread #1: can't grow to 0x4b37000 > ==2109== (see section Limitations in user manual) > ==2109== NOTE: Further instances of this message will not be shown > > Are there any objections to that? The user would still be informed of > the first brk failure, but not spammed with messages, as it currently > stands. No objections here. Maybe make it so that -v will show them all? And if you detect that brk does succeed at a later time then a next fail should also be reported I think. BTW. This might be related to bug #357833. Linux 4.5 changing the definition of RLIMIT_DATA. Cheers, Mark |
|
From: Julian S. <js...@ac...> - 2016-11-04 11:33:02
|
Hi, Some time in the last year or so, V started to complain if attempts to extend the brk segment failed. This usually never shows with Memcheck because that replaces malloc and acquires memory from mmap, not brk. But for tools that don't replace malloc, the message is printed repeatedly, often many times. For a run of Firefox in Cachegrind, I get 56 instances of it. This is annoying, also because it doesn't matter that brk will fail, since the libc malloc then tries mmap instead, and succeeds. I would like to turn this into a one-time message, thusly: ==2109== brk segment overflow in thread #1: can't grow to 0x4b37000 ==2109== (see section Limitations in user manual) ==2109== NOTE: Further instances of this message will not be shown Are there any objections to that? The user would still be informed of the first brk failure, but not spammed with messages, as it currently stands. J |
|
From: <sv...@va...> - 2016-11-04 03:43:41
|
Author: rhyskidd
Date: Fri Nov 4 03:43:28 2016
New Revision: 16116
Log:
Fix compile error on macOS introduced in r16111. n-i-bz.
m_syswrap/syswrap-generic.c:4148:26: error: use of undeclared identifier 'PID_EXEPATH'
VG_(sprintf)(name, PID_EXEPATH, VG_(getpid)());
^
m_syswrap/syswrap-generic.c:4150:56: error: use of undeclared identifier 'SELF_EXEPATH'
&& (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, SELF_EXEPATH))) {
^
m_syswrap/syswrap-generic.c:4150:56: error: use of undeclared identifier 'SELF_EXEPATH'
m_syswrap/syswrap-generic.c:4151:29: error: use of undeclared identifier 'SELF_EXEFD'
VG_(sprintf)(name, SELF_EXEFD, VG_(cl_exec_fd));
^
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c Fri Nov 4 03:43:28 2016
@@ -4129,6 +4129,8 @@
PRE_MEM_WRITE( "readlink(buf)", ARG2,ARG3 );
+ {
+#if defined(VGO_linux) || defined(VGO_solaris)
#if defined(VGO_linux)
#define PID_EXEPATH "/proc/%d/exe"
#define SELF_EXEPATH "/proc/self/exe"
@@ -4138,7 +4140,6 @@
#define SELF_EXEPATH "/proc/self/path/a.out"
#define SELF_EXEFD "/proc/self/path/%d"
#endif
- {
/*
* Handle the case where readlink is looking at /proc/self/exe or
* /proc/<pid>/exe, or equivalent on Solaris.
@@ -4151,7 +4152,9 @@
VG_(sprintf)(name, SELF_EXEFD, VG_(cl_exec_fd));
SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, (UWord)name,
ARG2, ARG3));
- } else {
+ } else
+#endif
+ {
/* Normal case */
SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, ARG1, ARG2, ARG3));
}
|
|
From: Rhys K. <rhy...@gm...> - 2016-11-04 03:41:28
|
On 2 November 2016 at 16:59, <sv...@va...> wrote:
> Author: philippe
> Date: Wed Nov 2 20:59:51 2016
> New Revision: 16111
>
> Log:
> Some small optimisation+some code reformatting
> * Use stack arrays instead of malloc/free
> * ensure msghdr_foreachfield does one single call to foreach_func
> for consecutive fields
> * some small code reformatting or factorisation
>
> Tested on linux, hoping it also works on solaris
>
>
> Modified:
> trunk/coregrind/m_syswrap/syswrap-generic.c
>
> Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
> ============================================================
> ==================
> --- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
> +++ trunk/coregrind/m_syswrap/syswrap-generic.c Wed Nov 2 20:59:51 2016
> @@ -79,8 +79,8 @@
> assume that sp starts near its highest possible value, and can
> only go down to the start of the mmaped segment. */
> seg = VG_(am_find_nsegment)(sp);
> - if (seg &&
> - VG_(am_is_valid_for_client)(sp, 1, VKI_PROT_READ |
> VKI_PROT_WRITE)) {
> + if (seg
> + && VG_(am_is_valid_for_client)(sp, 1, VKI_PROT_READ |
> VKI_PROT_WRITE)) {
> tst->client_stack_highest_byte = (Addr)VG_PGROUNDUP(sp)-1;
> tst->client_stack_szB = tst->client_stack_highest_byte - seg->start
> + 1;
>
> @@ -328,8 +328,8 @@
> old_seg = VG_(am_find_nsegment)( old_addr );
> if (old_addr < old_seg->start || old_addr+old_len-1 > old_seg->end)
> goto eINVAL;
> - if (old_seg->kind != SkAnonC && old_seg->kind != SkFileC &&
> - old_seg->kind != SkShmC)
> + if (old_seg->kind != SkAnonC && old_seg->kind != SkFileC
> + && old_seg->kind != SkShmC)
> goto eINVAL;
>
> vg_assert(old_len > 0);
> @@ -969,38 +969,25 @@
> #endif
> }
>
> -static
> -HChar *strdupcat ( const HChar* cc, const HChar *s1, const HChar *s2,
> - ArenaId aid )
> -{
> - UInt len = VG_(strlen) ( s1 ) + VG_(strlen) ( s2 ) + 1;
> - HChar *result = VG_(arena_malloc) ( aid, cc, len );
> - VG_(strcpy) ( result, s1 );
> - VG_(strcat) ( result, s2 );
> - return result;
> -}
> -
> static
> void pre_mem_read_sendmsg ( ThreadId tid, Bool read,
> const HChar *msg, Addr base, SizeT size )
> {
> - HChar *outmsg = strdupcat ( "di.syswrap.pmrs.1",
> - "sendmsg", msg, VG_AR_CORE );
> + HChar outmsg[VG_(strlen)(msg) + 10]; // large enough
> + VG_(sprintf)(outmsg, "sendmsg%s", msg);
> PRE_MEM_READ( outmsg, base, size );
> - VG_(free) ( outmsg );
> }
>
> static
> void pre_mem_write_recvmsg ( ThreadId tid, Bool read,
> const HChar *msg, Addr base, SizeT size )
> {
> - HChar *outmsg = strdupcat ( "di.syswrap.pmwr.1",
> - "recvmsg", msg, VG_AR_CORE );
> + HChar outmsg[VG_(strlen)(msg) + 10]; // large enough
> + VG_(sprintf)(outmsg, "recvmsg%s", msg);
> if ( read )
> PRE_MEM_READ( outmsg, base, size );
> else
> PRE_MEM_WRITE( outmsg, base, size );
> - VG_(free) ( outmsg );
> }
>
> static
> @@ -1021,21 +1008,36 @@
> Bool rekv /* "recv" apparently shadows some header decl on OSX108
> */
> )
> {
> - HChar *fieldName;
> + HChar fieldName[VG_(strlen)(name) + 32]; // large enough.
> + Addr a;
> + SizeT s;
>
> if ( !msg )
> return;
>
> - fieldName = VG_(malloc) ( "di.syswrap.mfef", VG_(strlen)(name) + 32 );
> -
> VG_(sprintf) ( fieldName, "(%s)", name );
>
> - foreach_func ( tid, True, fieldName, (Addr)&msg->msg_name, sizeof(
> msg->msg_name ) );
> - foreach_func ( tid, True, fieldName, (Addr)&msg->msg_namelen, sizeof(
> msg->msg_namelen ) );
> - foreach_func ( tid, True, fieldName, (Addr)&msg->msg_iov, sizeof(
> msg->msg_iov ) );
> - foreach_func ( tid, True, fieldName, (Addr)&msg->msg_iovlen, sizeof(
> msg->msg_iovlen ) );
> - foreach_func ( tid, True, fieldName, (Addr)&msg->msg_control, sizeof(
> msg->msg_control ) );
> - foreach_func ( tid, True, fieldName, (Addr)&msg->msg_controllen,
> sizeof( msg->msg_controllen ) );
> + /* FIELDPAIR helps the compiler do one call to foreach_func
> + for consecutive (no holes) fields. */
> +#define FIELDPAIR(f1,f2) \
> + if (offsetof(struct vki_msghdr, f1) + sizeof(msg->f1) \
> + == offsetof(struct vki_msghdr, f2)) \
> + s += sizeof(msg->f2); \
> + else { \
> + foreach_func (tid, True, fieldName, a, s); \
> + a = (Addr)&msg->f2; \
> + s = sizeof(msg->f2); \
> + }
> +
> + a = (Addr)&msg->msg_name;
> + s = sizeof(msg->msg_name);
> + FIELDPAIR(msg_name, msg_namelen);
> + FIELDPAIR(msg_namelen, msg_iov);
> + FIELDPAIR(msg_iov, msg_iovlen);
> + FIELDPAIR(msg_iovlen, msg_control);
> + FIELDPAIR(msg_control, msg_controllen);
> + foreach_func ( tid, True, fieldName, a, s);
> +#undef FIELDPAIR
>
> /* msg_flags is completely ignored for send_mesg, recv_mesg doesn't
> read
> the field, but does write to it. */
> @@ -1054,9 +1056,8 @@
> struct vki_iovec *iov = msg->msg_iov;
> UInt i;
>
> - VG_(sprintf) ( fieldName, "(%s.msg_iov)", name );
> -
> if (ML_(safe_to_deref)(&msg->msg_iovlen, sizeof (UInt))) {
> + VG_(sprintf) ( fieldName, "(%s.msg_iov)", name );
> foreach_func ( tid, True, fieldName, (Addr)iov,
> msg->msg_iovlen * sizeof( struct vki_iovec ) );
>
> @@ -1073,14 +1074,12 @@
> }
>
> if ( ML_(safe_to_deref) (&msg->msg_control, sizeof (void *))
> - && msg->msg_control )
> - {
> + && msg->msg_control ) {
> VG_(sprintf) ( fieldName, "(%s.msg_control)", name );
> foreach_func ( tid, False, fieldName,
> (Addr)msg->msg_control, msg->msg_controllen );
> }
>
> - VG_(free) ( fieldName );
> }
>
> static void check_cmsg_for_fds(ThreadId tid, struct vki_msghdr *msg)
> @@ -1088,8 +1087,8 @@
> struct vki_cmsghdr *cm = VKI_CMSG_FIRSTHDR(msg);
>
> while (cm) {
> - if (cm->cmsg_level == VKI_SOL_SOCKET &&
> - cm->cmsg_type == VKI_SCM_RIGHTS ) {
> + if (cm->cmsg_level == VKI_SOL_SOCKET
> + && cm->cmsg_type == VKI_SCM_RIGHTS ) {
> Int *fds = (Int *) VKI_CMSG_DATA(cm);
> Int fdc = (cm->cmsg_len - VKI_CMSG_ALIGN(sizeof(struct
> vki_cmsghdr)))
> / sizeof(int);
> @@ -1112,7 +1111,7 @@
> const HChar *description,
> struct vki_sockaddr *sa, UInt salen )
> {
> - HChar *outmsg;
> + HChar outmsg[VG_(strlen)( description ) + 30]; // large enough
> struct vki_sockaddr_un* saun = (struct vki_sockaddr_un *)sa;
> struct vki_sockaddr_in* sin = (struct vki_sockaddr_in *)sa;
> struct vki_sockaddr_in6* sin6 = (struct vki_sockaddr_in6 *)sa;
> @@ -1126,17 +1125,12 @@
> /* NULL/zero-length sockaddrs are legal */
> if ( sa == NULL || salen == 0 ) return;
>
> - outmsg = VG_(malloc) ( "di.syswrap.pmr_sockaddr.1",
> - VG_(strlen)( description ) + 30 );
> -
> VG_(sprintf) ( outmsg, description, "sa_family" );
> PRE_MEM_READ( outmsg, (Addr) &sa->sa_family, sizeof(vki_sa_family_t));
>
> /* Don't do any extra checking if we cannot determine the sa_family. */
> - if (! ML_(safe_to_deref) (&sa->sa_family, sizeof(vki_sa_family_t))) {
> - VG_(free) (outmsg);
> + if (! ML_(safe_to_deref) (&sa->sa_family, sizeof(vki_sa_family_t)))
> return;
> - }
>
> switch (sa->sa_family) {
>
> @@ -1203,8 +1197,6 @@
> salen - sizeof(sa->sa_family));
> break;
> }
> -
> - VG_(free) ( outmsg );
> }
>
> /* Dereference a pointer to a UInt. */
> @@ -3684,8 +3676,7 @@
> UInt size = _VKI_IOC_SIZE(request);
> if (size > 0 && (dir & _VKI_IOC_READ)
> && res == 0
> - && arg != (Addr)NULL)
> - {
> + && arg != (Addr)NULL) {
> POST_MEM_WRITE(arg, size);
> }
> }
> @@ -3836,10 +3827,10 @@
>
> if (grows == VKI_PROT_GROWSDOWN) {
> rseg = VG_(am_next_nsegment)( aseg, False/*backwards*/ );
> - if (rseg &&
> - rseg->kind == SkResvn &&
> - rseg->smode == SmUpper &&
> - rseg->end+1 == aseg->start) {
> + if (rseg
> + && rseg->kind == SkResvn
> + && rseg->smode == SmUpper
> + && rseg->end+1 == aseg->start) {
> Addr end = ARG1 + ARG2;
> ARG1 = aseg->start;
> ARG2 = end - aseg->start;
> @@ -3849,10 +3840,10 @@
> }
> } else if (grows == VKI_PROT_GROWSUP) {
> rseg = VG_(am_next_nsegment)( aseg, True/*forwards*/ );
> - if (rseg &&
> - rseg->kind == SkResvn &&
> - rseg->smode == SmLower &&
> - aseg->end+1 == rseg->start) {
> + if (rseg
> + && rseg->kind == SkResvn
> + && rseg->smode == SmLower
> + && aseg->end+1 == rseg->start) {
> ARG2 = aseg->end - ARG1 + 1;
> ARG3 &= ~VKI_PROT_GROWSUP;
> } else {
> @@ -3993,10 +3984,8 @@
> SysRes sres;
>
> VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
> - if (ML_(safe_to_deref)( arg1s, 1 ) &&
> - (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, "/proc/self/cmdline"))
> - )
> - {
> + if (ML_(safe_to_deref)( arg1s, 1 )
> + && (VG_STREQ(arg1s, name) || VG_STREQ(arg1s,
> "/proc/self/cmdline"))) {
> sres = VG_(dup)( VG_(cl_cmdline_fd) );
> SET_STATUS_from_SysRes( sres );
> if (!sr_isError(sres)) {
> @@ -4062,8 +4051,8 @@
> && SimHintiS(SimHint_enable_outer, VG_(clo_sim_hints)))
> ok = True;
> #if defined(VGO_solaris)
> - if (!ok && VG_(vfork_fildes_addr) != NULL &&
> - *VG_(vfork_fildes_addr) >= 0 && *VG_(vfork_fildes_addr) == ARG1)
> + if (!ok && VG_(vfork_fildes_addr) != NULL
> + && *VG_(vfork_fildes_addr) >= 0 && *VG_(vfork_fildes_addr) == ARG1)
> ok = True;
> #endif
> if (!ok)
> @@ -4139,39 +4128,30 @@
> PRE_MEM_RASCIIZ( "readlink(path)", ARG1 );
> PRE_MEM_WRITE( "readlink(buf)", ARG2,ARG3 );
>
> - {
> +
> #if defined(VGO_linux)
> +#define PID_EXEPATH "/proc/%d/exe"
> +#define SELF_EXEPATH "/proc/self/exe"
> +#define SELF_EXEFD "/proc/self/fd/%d"
> +#elif defined(VGO_solaris)
> +#define PID_EXEPATH "/proc/%d/path/a.out"
> +#define SELF_EXEPATH "/proc/self/path/a.out"
> +#define SELF_EXEFD "/proc/self/path/%d"
> +#endif
>
This changes the logic of the define guards.
Previously #if defined(VGO_linux) would continue to guard this next block
until the #elif defined(VGO_solaris) took over.
The union of #if defined(VGO_linux) || defined(VGO_solaris) does not cover
all platforms that build this file - namely macOS.
I'll send a patch shortly to correct this logic.
> + {
> /*
> * Handle the case where readlink is looking at /proc/self/exe or
> - * /proc/<pid>/exe.
> + * /proc/<pid>/exe, or equivalent on Solaris.
> */
> HChar name[30]; // large enough
> HChar* arg1s = (HChar*) ARG1;
> - VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
> - if (ML_(safe_to_deref)(arg1s, 1) &&
> - (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, "/proc/self/exe"))
> - )
> - {
> - VG_(sprintf)(name, "/proc/self/fd/%d", VG_(cl_exec_fd));
> + VG_(sprintf)(name, PID_EXEPATH, VG_(getpid)());
> + if (ML_(safe_to_deref)(arg1s, 1)
> + && (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, SELF_EXEPATH))) {
> + VG_(sprintf)(name, SELF_EXEFD, VG_(cl_exec_fd));
> SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, (UWord)name,
> ARG2, ARG3));
> - } else
> -#elif defined(VGO_solaris)
> - /* Same for Solaris, but /proc/self/path/a.out and
> - /proc/<pid>/path/a.out. */
> - HChar name[30]; // large enough
> - HChar* arg1s = (HChar*) ARG1;
> - VG_(sprintf)(name, "/proc/%d/path/a.out", VG_(getpid)());
> - if (ML_(safe_to_deref)(arg1s, 1) &&
> - (VG_STREQ(arg1s, name) || VG_STREQ(arg1s,
> "/proc/self/path/a.out"))
> - )
> - {
> - VG_(sprintf)(name, "/proc/self/path/%d", VG_(cl_exec_fd));
> - SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, (UWord)name,
> - ARG2, ARG3));
> - } else
> -#endif
> - {
> + } else {
> /* Normal case */
> SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, ARG1, ARG2,
> ARG3));
> }
>
>
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
>
|