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
(22) |
2
(24) |
|
3
(19) |
4
(20) |
5
(17) |
6
(20) |
7
(13) |
8
|
9
|
|
10
(10) |
11
(35) |
12
(20) |
13
(6) |
14
(19) |
15
|
16
|
|
17
(2) |
18
(3) |
19
(12) |
20
(1) |
21
(14) |
22
(2) |
23
(13) |
|
24
(2) |
25
(16) |
26
(17) |
27
(21) |
28
(17) |
29
(17) |
30
(14) |
|
31
(15) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2013-03-24 20:10:36
|
philippe 2013-03-24 20:10:23 +0000 (Sun, 24 Mar 2013)
New Revision: 13332
Log:
fix 307082 HG false positive: pthread_cond_destroy: destruction of unknown cond var
Added files:
trunk/helgrind/tests/cond_init_destroy.c
trunk/helgrind/tests/cond_init_destroy.stderr.exp
trunk/helgrind/tests/cond_init_destroy.vgtest
Modified files:
trunk/NEWS
trunk/helgrind/helgrind.h
trunk/helgrind/hg_intercepts.c
trunk/helgrind/hg_main.c
trunk/helgrind/tests/Makefile.am
Modified: trunk/helgrind/hg_main.c (+23 -0)
===================================================================
--- trunk/helgrind/hg_main.c 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/hg_main.c 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -2377,6 +2377,22 @@
cvi->nWaiters--;
}
+static void evh__HG_PTHREAD_COND_INIT_POST ( ThreadId tid,
+ void* cond, void* cond_attr )
+{
+ CVInfo* cvi;
+
+ if (SHOW_EVENTS >= 1)
+ VG_(printf)("evh__HG_PTHREAD_COND_INIT_POST"
+ "(ctid=%d, cond=%p, cond_attr=%p)\n",
+ (Int)tid, (void*)cond, (void*) cond_attr );
+
+ cvi = map_cond_to_CVInfo_lookup_or_alloc( cond );
+ tl_assert (cvi);
+ tl_assert (cvi->so);
+}
+
+
static void evh__HG_PTHREAD_COND_DESTROY_PRE ( ThreadId tid,
void* cond )
{
@@ -4842,6 +4858,13 @@
break;
}
+ /* Thread successfully completed pthread_cond_init:
+ cond=arg[1], cond_attr=arg[2] */
+ case _VG_USERREQ__HG_PTHREAD_COND_INIT_POST:
+ evh__HG_PTHREAD_COND_INIT_POST( tid,
+ (void*)args[1], (void*)args[2] );
+ break;
+
/* cond=arg[1] */
case _VG_USERREQ__HG_PTHREAD_COND_DESTROY_PRE:
evh__HG_PTHREAD_COND_DESTROY_PRE( tid, (void*)args[1] );
Added: trunk/helgrind/tests/cond_init_destroy.c (+8 -0)
===================================================================
--- trunk/helgrind/tests/cond_init_destroy.c 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/tests/cond_init_destroy.c 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -0,0 +1,8 @@
+#include <pthread.h>
+int main(int argc, char *argv[])
+{
+ pthread_cond_t c;
+ pthread_cond_init(& c, NULL);
+ pthread_cond_destroy(& c);
+ return 0;
+}
Added: trunk/helgrind/tests/cond_init_destroy.stderr.exp (+3 -0)
===================================================================
--- trunk/helgrind/tests/cond_init_destroy.stderr.exp 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/tests/cond_init_destroy.stderr.exp 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -0,0 +1,3 @@
+
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Modified: trunk/helgrind/hg_intercepts.c (+50 -3)
===================================================================
--- trunk/helgrind/hg_intercepts.c 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/hg_intercepts.c 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -631,10 +631,8 @@
/* Handled: pthread_cond_wait pthread_cond_timedwait
pthread_cond_signal pthread_cond_broadcast
+ pthread_cond_init
pthread_cond_destroy
-
- Unhandled: pthread_cond_init
- -- is this important?
*/
//-----------------------------------------------------------
@@ -917,7 +915,56 @@
# error "Unsupported OS"
#endif
+// glibc: pthread_cond_init@GLIBC_2.0
+// glibc: pthread_cond_init@GLIBC_2.2.5
+// glibc: pthread_cond_init@@GLIBC_2.3.2
+// darwin: pthread_cond_init
+// Easy way out: Handling of attr could have been messier.
+// It turns out that pthread_cond_init under linux ignores
+// all information in cond_attr, so do we.
+// FIXME: MacOS X?
+__attribute__((noinline))
+static int pthread_cond_init_WRK(pthread_cond_t* cond, pthread_condattr_t *cond_attr)
+{
+ int ret;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, "<< pthread_cond_init %p", cond);
+ fflush(stderr);
+ }
+
+ CALL_FN_W_WW(ret, fn, cond, cond_attr);
+
+ if (ret == 0) {
+ DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_COND_INIT_POST,
+ pthread_cond_t*,cond, pthread_condattr_t*, cond_attr);
+ } else {
+ DO_PthAPIerror( "pthread_cond_init", ret );
+ }
+
+ if (TRACE_PTH_FNS) {
+ fprintf(stderr, " coinit -> %d >>\n", ret);
+ }
+
+ return ret;
+}
+#if defined(VGO_linux)
+ PTH_FUNC(int, pthreadZucondZuinitZAZa, // pthread_cond_init@*
+ pthread_cond_t* cond, pthread_condattr_t* cond_attr) {
+ return pthread_cond_init_WRK(cond, cond_attr);
+ }
+#elif defined(VGO_darwin)
+ PTH_FUNC(int, pthreadZucondZuinit, // pthread_cond_init
+ pthread_cond_t* cond, pthread_condattr_t * cond_attr) {
+ return pthread_cond_init_WRK(cond, cond_attr);
+ }
+#else
+# error "Unsupported OS"
+#endif
+
+
//-----------------------------------------------------------
// glibc: pthread_cond_destroy@@GLIBC_2.3.2
// glibc: pthread_cond_destroy@GLIBC_2.2.5
Added: trunk/helgrind/tests/cond_init_destroy.vgtest (+1 -0)
===================================================================
--- trunk/helgrind/tests/cond_init_destroy.vgtest 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/tests/cond_init_destroy.vgtest 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -0,0 +1 @@
+prog: cond_init_destroy
Modified: trunk/helgrind/tests/Makefile.am (+2 -0)
===================================================================
--- trunk/helgrind/tests/Makefile.am 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/tests/Makefile.am 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -12,6 +12,7 @@
annotate_rwlock.stderr.exp \
annotate_smart_pointer.vgtest annotate_smart_pointer.stdout.exp \
annotate_smart_pointer.stderr.exp \
+ cond_init_destroy.vgtest cond_init_destroy.stderr.exp \
cond_timedwait_invalid.vgtest cond_timedwait_invalid.stdout.exp \
cond_timedwait_invalid.stderr.exp \
bar_bad.vgtest bar_bad.stdout.exp bar_bad.stderr.exp \
@@ -101,6 +102,7 @@
# should be conditionally compiled like tc20_verifywrap is.
check_PROGRAMS = \
annotate_hbefore \
+ cond_init_destroy \
cond_timedwait_invalid \
free_is_write \
hg01_all_ok \
Modified: trunk/helgrind/helgrind.h (+2 -1)
===================================================================
--- trunk/helgrind/helgrind.h 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/helgrind/helgrind.h 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -115,7 +115,8 @@
_VG_USERREQ__HG_ARANGE_MAKE_UNTRACKED, /* Addr a, ulong len */
_VG_USERREQ__HG_ARANGE_MAKE_TRACKED, /* Addr a, ulong len */
_VG_USERREQ__HG_PTHREAD_BARRIER_RESIZE_PRE, /* pth_bar_t*, ulong */
- _VG_USERREQ__HG_CLEAN_MEMORY_HEAPBLOCK /* Addr start_of_block */
+ _VG_USERREQ__HG_CLEAN_MEMORY_HEAPBLOCK, /* Addr start_of_block */
+ _VG_USERREQ__HG_PTHREAD_COND_INIT_POST /* pth_cond_t*, pth_cond_attr_t*/
} Vg_TCheckClientRequest;
Modified: trunk/NEWS (+1 -0)
===================================================================
--- trunk/NEWS 2013-03-22 11:49:46 +00:00 (rev 13331)
+++ trunk/NEWS 2013-03-24 20:10:23 +00:00 (rev 13332)
@@ -95,6 +95,7 @@
307038 DWARF2 CFI reader: unhandled DW_OP_ opcode 0x8 (DW_OP_const1u et al)
FIXED r13010
+307082 [390] HG false positive: pthread_cond_destroy: destruction of unknown cond var
307101 sys_capget second argument can be NULL
FIXED r13021
|
|
From: Philippe W. <phi...@sk...> - 2013-03-24 17:47:19
|
On Sun, 2013-03-24 at 06:37 +0800, Lu Mitnick wrote:
I think the below is basically ok. However, I do not think that Valgrind
is mmap the .so : it relies on LD_PRELOAD and the dynamic loader to load
e.g. the redirection .so
Philippe
> Hello Pḧilippe,
>
> The following is what I understand about valgrind. Would you give me
> some suggestion?
>
> * Valgrind is just a launcher (stage 1). It detect whether the client
> is a script or an executable. If client
> is the former, Valgrind would bring up interpreter to interpret the
> client. Then use execv to replace the
> execution image with tool - memcheck (stage 2)
>
> * Because memcheck is a fully static linked image. It use mmap to load
> relevant *.so, which is used
> to construct function call redirection table - Spec and Active. To
> get information about symbol and
> address, Valgrind use readelf.c to parse .dynsym tables of the
> client and loaded *.so.
>
> * When execution beginning, Valgrind use JIT to generate the
> redirected function call. Take a simple
> example. The debug message "REDIR: 0x4eb6f40 (malloc) redirected to
> 0x4c2c6ba (malloc)" means
> Valgrind translate the original client function call "call
> 0x4eb6f40<malloc>" to "call 0x4c2c6ba
> <replace_malloc>"
>
> * Valgrind didn't rely on ld-linux.so during function redirection. But
> it still execute ld-linux.so on
> emulated CPU when the client need some symbol resolvation because of
> dynamic linking.
>
>
> I took a small experiment to get deep understanding of valgrind.
>
>
>
> $ cat malloc.c
> #include <stdlib.h>
>
> int main() {
> char *p = (char*)malloc(sizeof(char));
> *(int*)p = 10;
> return 0;
> }
>
> $ gcc malloc.c
>
> $ ./i-valgrind-3.8.1/bin/valgrind -v ./a.out
> ...
> --12872-- REDIR: 0x4eb6f40 (malloc) redirected to 0x4c2c6ba (malloc)
> ...
> ==12872== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from
> 2)
>
> Event the a.out is stripped (without .symtab, only remains .dynsym),
> Valgrind still work. So I guess
> Valgrind only rely on .dynsym table.
>
> I also striped lib.so. However, Valgrind works well. So I thought
> Valgrind didn't rely on .symtab table
> anymore.
>
>
> Thanks a lot
>
> 2013/3/12 Philippe Waroquiers <phi...@sk...>
> On Tue, 2013-03-12 at 02:46 +0800, Lu Mitnick wrote:
> > Hello Pḧilippe,
> >
> > I have took a look of the files you mentioned, not
> understanding how
> > Valgrind works very well.
> > In the following is a observation of me, please tell me if
> the
> > statement is wrong.
> >
> > * coregrind/m_redir implements the function lookup table
> used by
> > VG_(translate)
> > (coregrind/m_translate.c), a function do translattion.
>
> Yes, the translation code (m_translate.c) will call m_redir.c
> function VG_(redir_do_lookup) to see if an address of a
> function
> has to be redirected. If yes, rather than translating the
> original
> function, it translates the replacement function.
>
>
> >
> > Besides, I have some questions. Would you mind to answer me?
> >
> > * Is memcheck/Valgrind applicable to static-linked binary?
>
> Valgrind will sort of work with statically linked binaries,
> except
> that the standard Valgrind and tool redirections will not
> work.
> So, for example, malloc will not be replaced.
> This is because redirection instructions are in a shared
> object.
> If the executable is statically linked, the preload of the
> valgrind
> shared object will not be done, and so no replacement of
> malloc,
> libc, ... will be done.
>
> > * How do valgrind catch malloc call during translation?
> >
> > I am wondering how do Valgrind gather the information of
> malloc
> > address. So that it could
> > change the call target address during translation
> > (redirection/wrapping). Especially in striped
> > binary, there are fewer symbols. How do Valgrind do it?
> And which
> > source files should I take
> > a look?
>
> Valgrind will not work if libc etc have no debug info.
> Some distributions are stripping their libc etc.
> In such a case, VAlgrind will refuse
> to start, and will indicate to install the debug info for the
> library.
>
> Philippe
>
>
>
>
|