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
|
3
|
|
4
|
5
|
6
|
7
(1) |
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
|
18
|
19
|
20
|
21
|
22
(4) |
23
(3) |
24
(2) |
|
25
(9) |
26
(2) |
27
(1) |
28
|
29
(7) |
30
(5) |
31
(2) |
|
From: Paul F. <pa...@so...> - 2022-12-29 21:23:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5cfb0173eda1843904650bef755b3e19a5b3fb1b commit 5cfb0173eda1843904650bef755b3e19a5b3fb1b Author: Paul Floyd <pj...@wa...> Date: Thu Dec 29 22:21:03 2022 +0100 Add DRD shared_timed_mutex to Helgrind This uses pthread_rwlock_timedrdlock / pthread_rwlock_timedwrlock (see commit 6ffb70e650ee7cf4ada829557dd30ababb09e078) Diff: --- helgrind/tests/Makefile.am | 1 + helgrind/tests/shared_timed_mutex.stderr.exp | 3 +++ helgrind/tests/shared_timed_mutex.vgtest | 3 +++ 3 files changed, 7 insertions(+) diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 32f926b74f..ac6b15af77 100755 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -66,6 +66,7 @@ EXTRA_DIST = \ 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 \ + shared_timed_mutex.vgtest shared_timed_mutex.stderr.exp \ shmem_abits.vgtest shmem_abits.stdout.exp shmem_abits.stderr.exp \ stackteardown.vgtest stackteardown.stdout.exp stackteardown.stderr.exp \ t2t_laog.vgtest t2t_laog.stdout.exp t2t_laog.stderr.exp \ diff --git a/helgrind/tests/shared_timed_mutex.stderr.exp b/helgrind/tests/shared_timed_mutex.stderr.exp new file mode 100644 index 0000000000..d18786f806 --- /dev/null +++ b/helgrind/tests/shared_timed_mutex.stderr.exp @@ -0,0 +1,3 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/helgrind/tests/shared_timed_mutex.vgtest b/helgrind/tests/shared_timed_mutex.vgtest new file mode 100644 index 0000000000..d3a044379c --- /dev/null +++ b/helgrind/tests/shared_timed_mutex.vgtest @@ -0,0 +1,3 @@ +prereq: test -e ../../drd/tests/shared_timed_mutex +vgopts: --read-var-info=yes +prog: ../../drd/tests/shared_timed_mutex |
|
From: Paul F. <pa...@so...> - 2022-12-29 21:10:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=d7c93d1f71f36e0b67770125b48a2583662af152 commit d7c93d1f71f36e0b67770125b48a2583662af152 Author: Paul Floyd <pj...@wa...> Date: Thu Dec 29 22:08:14 2022 +0100 Add a variation of the Helgrind tls_threads test This version uses GLIBC_TUNABLES in the environment so it checks that glibc.pthread.stack_cache_size can be detected and modified. Diff: --- helgrind/tests/Makefile.am | 1 + helgrind/tests/tls_threads2.stderr.exp | 2 ++ helgrind/tests/tls_threads2.vgtest | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 2157f7cd38..32f926b74f 100755 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -135,6 +135,7 @@ EXTRA_DIST = \ tc24_nonzero_sem.stderr.exp \ tls_threads.vgtest tls_threads.stdout.exp \ tls_threads.stderr.exp \ + tls_threads2.vgtest tls_threads2.stderr.exp \ trylock.vgtest trylock.stderr.exp # Wrapper headers used by some check programs. diff --git a/helgrind/tests/tls_threads2.stderr.exp b/helgrind/tests/tls_threads2.stderr.exp new file mode 100644 index 0000000000..be3b8904e7 --- /dev/null +++ b/helgrind/tests/tls_threads2.stderr.exp @@ -0,0 +1,2 @@ +starting join in main +finished join in main diff --git a/helgrind/tests/tls_threads2.vgtest b/helgrind/tests/tls_threads2.vgtest new file mode 100644 index 0000000000..f8f0ad15be --- /dev/null +++ b/helgrind/tests/tls_threads2.vgtest @@ -0,0 +1,4 @@ +prereq: ../../tests/os_test linux +env: GLIBC_TUNABLES=glibc.pthread.mutex_spin_count=4:glibc.pthread.stack_cache_size=41943040:glibc.pthread.rseq=1 +prog: tls_threads +vgopts: -q --sim-hints=no-nptl-pthread-stackcache |
|
From: Paul F. <pa...@so...> - 2022-12-29 21:03:03
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6ffb70e650ee7cf4ada829557dd30ababb09e078 commit 6ffb70e650ee7cf4ada829557dd30ababb09e078 Author: Paul Floyd <pj...@wa...> Date: Thu Dec 29 22:00:53 2022 +0100 Bug 400793 - pthread_rwlock_timedwrlock false positive Add Helgrind intercepts for pthread_rwlock_timedwrlock (and pthread_rwlock_timedrdlock) Reuse the DRD trylock test Diff: --- NEWS | 1 + helgrind/hg_intercepts.c | 18 ++++++++++++------ helgrind/tests/Makefile.am | 3 ++- helgrind/tests/trylock.stderr.exp | 13 +++++++++++++ helgrind/tests/trylock.vgtest | 1 + 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 071f654b50..16ae313dfc 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 170510 Don't warn about ioctl of size 0 without direction hint 351857 confusing error message about valid command line option 392331 Spurious lock not held error from inside pthread_cond_timedwait +400793 pthread_rwlock_timedwrlock false positive 444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. 444488 Use glibc.pthread.stack_cache_size tunable 444568 drd/tests/pth_barrier_thr_cr fails on Fedora 38 diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 0d29cb3bfa..5a83996e36 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -2222,9 +2222,6 @@ static int pthread_spin_trylock_WRK(pthread_spinlock_t *lock) pthread_rwlock_unlock pthread_rwlock_tryrdlock pthread_rwlock_trywrlock - - Unhandled: pthread_rwlock_timedrdlock - pthread_rwlock_timedwrlock */ //----------------------------------------------------------- @@ -2676,7 +2673,7 @@ static int pthread_rwlock_tryrdlock_WRK(pthread_rwlock_t* rwlock) //----------------------------------------------------------- -// glibc: Unhandled +// glibc: pthread_rwlock_timedrdlock // darwin: Unhandled // Solaris: pthread_rwlock_timedrdlock // Solaris: pthread_rwlock_reltimedrdlock_np @@ -2712,6 +2709,11 @@ static int pthread_rwlock_timedrdlock_WRK(pthread_rwlock_t *rwlock, return ret; } #if defined(VGO_linux) +PTH_FUNC(int, pthreadZurwlockZutimedrdlock, // pthread_rwlock_timedrdlock + pthread_rwlock_t *rwlock, + const struct timespec *timeout) { + return pthread_rwlock_timedrdlock_WRK(rwlock, timeout); +} #elif defined(VGO_darwin) #elif defined(VGO_freebsd) PTH_FUNC(int, pthreadZurwlockZutimedrdlock, // pthread_rwlock_timedrdlock @@ -2779,8 +2781,7 @@ PTH_FUNC(int, pthreadZurwlockZuclockrdlock, // pthread_rwlock_clockrdlock //----------------------------------------------------------- -// glibc: Unhandled -// darwin: Unhandled +// glibc: pthread_rwlock_timedwrlock // Solaris: pthread_rwlock_timedwrlock // Solaris: pthread_rwlock_reltimedwrlock_np // FreeBSD: pthread_rwlock_timedwrlock @@ -2815,6 +2816,11 @@ static int pthread_rwlock_timedwrlock_WRK(pthread_rwlock_t *rwlock, return ret; } #if defined(VGO_linux) +PTH_FUNC(int, pthreadZurwlockZutimedwrlock, // pthread_rwlock_timedwrlock + pthread_rwlock_t *rwlock, + const struct timespec *timeout) { + return pthread_rwlock_timedwrlock_WRK(rwlock, timeout); +} #elif defined(VGO_darwin) #elif defined(VGO_freebsd) PTH_FUNC(int, pthreadZurwlockZutimedwrlock, // pthread_rwlock_timedwrlock diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 28f4c61912..2157f7cd38 100755 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -134,7 +134,8 @@ EXTRA_DIST = \ tc24_nonzero_sem.vgtest tc24_nonzero_sem.stdout.exp \ tc24_nonzero_sem.stderr.exp \ tls_threads.vgtest tls_threads.stdout.exp \ - tls_threads.stderr.exp + tls_threads.stderr.exp \ + trylock.vgtest trylock.stderr.exp # Wrapper headers used by some check programs. noinst_HEADERS = safe-pthread.h safe-semaphore.h diff --git a/helgrind/tests/trylock.stderr.exp b/helgrind/tests/trylock.stderr.exp new file mode 100644 index 0000000000..e3aea4bd4e --- /dev/null +++ b/helgrind/tests/trylock.stderr.exp @@ -0,0 +1,13 @@ + +Locking rwlock via pthread_rwlock_wrlock(). +Locking rwlock via pthread_rwlock_trywrlock(). +Locking rwlock via pthread_rwlock_timedwrlock(). +Locking rwlock via pthread_rwlock_rdlock(). +Locking rwlock via pthread_rwlock_tryrdlock(). +Locking rwlock via pthread_rwlock_timedrdlock(). +Attempt to lock for writing recursively (not allowed). +Locking mutex via pthread_mutex_trylock(). +Locking mutex via pthread_mutex_lock(). +Locking mutex via pthread_mutex_timedlock(). + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/helgrind/tests/trylock.vgtest b/helgrind/tests/trylock.vgtest new file mode 100644 index 0000000000..1d4f16d3b8 --- /dev/null +++ b/helgrind/tests/trylock.vgtest @@ -0,0 +1 @@ +prog: ../../drd/tests/trylock |
|
From: Paul F. <pa...@so...> - 2022-12-29 20:00:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=ab1eb2cb7473013e1458630372ee1fde2e4f66e9 commit ab1eb2cb7473013e1458630372ee1fde2e4f66e9 Author: Paul Floyd <pj...@wa...> Date: Thu Dec 29 20:59:25 2022 +0100 Update modified hg04 reference for DRD. Diff: --- drd/tests/hg04_race.stderr.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drd/tests/hg04_race.stderr.exp b/drd/tests/hg04_race.stderr.exp index 5b5969c995..4cc01a213f 100644 --- a/drd/tests/hg04_race.stderr.exp +++ b/drd/tests/hg04_race.stderr.exp @@ -1,8 +1,8 @@ Thread 3: Conflicting load by thread 3 at 0x........ size 4 - at 0x........: th (hg04_race.c:10) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) Location 0x........ is 0 bytes inside global var "shared" declared at hg04_race.c:6 Other segment start (thread 2) @@ -11,8 +11,8 @@ Other segment end (thread 2) (thread finished, call stack no longer available) Conflicting store by thread 3 at 0x........ size 4 - at 0x........: th (hg04_race.c:10) - by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?) + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) Location 0x........ is 0 bytes inside global var "shared" declared at hg04_race.c:6 Other segment start (thread 2) |
|
From: Philippe W. <phi...@so...> - 2022-12-29 15:37:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a5b88a02d5750c464736ab1d4c66cedd4182c79e commit a5b88a02d5750c464736ab1d4c66cedd4182c79e Author: Philippe Waroquiers <phi...@sk...> Date: Thu Dec 29 15:56:36 2022 +0100 Add a test for helgrind --history-backtrace-size Extend hg04_race to have more entries in the conflicting stacktrace, and make another test hg04_race_h9 to test with one more entry than the default of 8. Diff: --- helgrind/tests/Makefile.am | 1 + helgrind/tests/hg04_race.c | 67 ++++++++++++++++++++++++++-- helgrind/tests/hg04_race.stderr.exp | 52 ++++++++++++++++------ helgrind/tests/hg04_race_h9.stderr.exp | 79 ++++++++++++++++++++++++++++++++++ helgrind/tests/hg04_race_h9.stdout.exp | 0 helgrind/tests/hg04_race_h9.vgtest | 3 ++ 6 files changed, 187 insertions(+), 15 deletions(-) diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 2286e220f1..28f4c61912 100755 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -34,6 +34,7 @@ EXTRA_DIST = \ hg02_deadlock.vgtest hg02_deadlock.stdout.exp hg02_deadlock.stderr.exp \ hg03_inherit.vgtest hg03_inherit.stdout.exp hg03_inherit.stderr.exp \ hg04_race.vgtest hg04_race.stdout.exp hg04_race.stderr.exp \ + hg04_race_h9.vgtest hg04_race_h9.stdout.exp hg04_race_h9.stderr.exp \ hg05_race2.vgtest hg05_race2.stdout.exp hg05_race2.stderr.exp \ hg06_readshared.vgtest hg06_readshared.stdout.exp \ hg06_readshared.stderr.exp \ diff --git a/helgrind/tests/hg04_race.c b/helgrind/tests/hg04_race.c index 111195bf90..760caf8860 100644 --- a/helgrind/tests/hg04_race.c +++ b/helgrind/tests/hg04_race.c @@ -5,18 +5,79 @@ static int shared; +__attribute__((noinline)) +static void th10(void) +{ + shared++; +} + +__attribute__((noinline)) +static void th9(void) +{ + th10(); +} + +__attribute__((noinline)) +static void th8(void) +{ + th9(); +} + +__attribute__((noinline)) +static void th7(void) +{ + th8(); +} + +__attribute__((noinline)) +static void th6(void) +{ + th7(); +} + +__attribute__((noinline)) +static void th5(void) +{ + th6(); +} + +__attribute__((noinline)) +static void th4(void) +{ + th5(); +} + +__attribute__((noinline)) +static void th3(void) +{ + th4(); +} + +__attribute__((noinline)) +static void th2(void) +{ + th3(); +} + + +__attribute__((noinline)) +static void th1(void) +{ + th2(); +} + static void *th(void *v) { - shared++; + th1(); - return 0; + return 0; } int main() { pthread_t a, b; - pthread_create(&a, NULL, th, NULL); + pthread_create(&a, NULL, th, NULL); sleep(1); /* force ordering */ pthread_create(&b, NULL, th, NULL); diff --git a/helgrind/tests/hg04_race.stderr.exp b/helgrind/tests/hg04_race.stderr.exp index 67f6573963..f66394bd13 100644 --- a/helgrind/tests/hg04_race.stderr.exp +++ b/helgrind/tests/hg04_race.stderr.exp @@ -4,28 +4,42 @@ Thread #x was created ... by 0x........: pthread_create@* (hg_intercepts.c:...) - by 0x........: main (hg04_race.c:21) + by 0x........: main (hg04_race.c:82) ---Thread-Announcement------------------------------------------ Thread #x was created ... by 0x........: pthread_create@* (hg_intercepts.c:...) - by 0x........: main (hg04_race.c:19) + by 0x........: main (hg04_race.c:80) ---------------------------------------------------------------- Possible data race during read of size 4 at 0x........ by thread #x Locks held: none - at 0x........: th (hg04_race.c:10) + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) + by 0x........: th2 (hg04_race.c:59) + by 0x........: th1 (hg04_race.c:66) + by 0x........: th (hg04_race.c:71) by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... This conflicts with a previous write of size 4 by thread #x Locks held: none - at 0x........: th (hg04_race.c:10) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) Location 0x........ is 0 bytes inside global var "shared" declared at hg04_race.c:6 @@ -33,15 +47,29 @@ Locks held: none Possible data race during write of size 4 at 0x........ by thread #x Locks held: none - at 0x........: th (hg04_race.c:10) + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) + by 0x........: th2 (hg04_race.c:59) + by 0x........: th1 (hg04_race.c:66) + by 0x........: th (hg04_race.c:71) by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... This conflicts with a previous write of size 4 by thread #x Locks held: none - at 0x........: th (hg04_race.c:10) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) Location 0x........ is 0 bytes inside global var "shared" declared at hg04_race.c:6 diff --git a/helgrind/tests/hg04_race_h9.stderr.exp b/helgrind/tests/hg04_race_h9.stderr.exp new file mode 100644 index 0000000000..6e692e749a --- /dev/null +++ b/helgrind/tests/hg04_race_h9.stderr.exp @@ -0,0 +1,79 @@ + +---Thread-Announcement------------------------------------------ + +Thread #x was created + ... + by 0x........: pthread_create@* (hg_intercepts.c:...) + by 0x........: main (hg04_race.c:82) + +---Thread-Announcement------------------------------------------ + +Thread #x was created + ... + by 0x........: pthread_create@* (hg_intercepts.c:...) + by 0x........: main (hg04_race.c:80) + +---------------------------------------------------------------- + +Possible data race during read of size 4 at 0x........ by thread #x +Locks held: none + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) + by 0x........: th2 (hg04_race.c:59) + by 0x........: th1 (hg04_race.c:66) + by 0x........: th (hg04_race.c:71) + by 0x........: mythread_wrapper (hg_intercepts.c:...) + +This conflicts with a previous write of size 4 by thread #x +Locks held: none + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) + by 0x........: th2 (hg04_race.c:59) + Location 0x........ is 0 bytes inside global var "shared" + declared at hg04_race.c:6 + +---------------------------------------------------------------- + +Possible data race during write of size 4 at 0x........ by thread #x +Locks held: none + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) + by 0x........: th2 (hg04_race.c:59) + by 0x........: th1 (hg04_race.c:66) + by 0x........: th (hg04_race.c:71) + by 0x........: mythread_wrapper (hg_intercepts.c:...) + +This conflicts with a previous write of size 4 by thread #x +Locks held: none + at 0x........: th10 (hg04_race.c:11) + by 0x........: th9 (hg04_race.c:17) + by 0x........: th8 (hg04_race.c:23) + by 0x........: th7 (hg04_race.c:29) + by 0x........: th6 (hg04_race.c:35) + by 0x........: th5 (hg04_race.c:41) + by 0x........: th4 (hg04_race.c:47) + by 0x........: th3 (hg04_race.c:53) + by 0x........: th2 (hg04_race.c:59) + Location 0x........ is 0 bytes inside global var "shared" + declared at hg04_race.c:6 + + +ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) diff --git a/helgrind/tests/hg04_race_h9.stdout.exp b/helgrind/tests/hg04_race_h9.stdout.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/helgrind/tests/hg04_race_h9.vgtest b/helgrind/tests/hg04_race_h9.vgtest new file mode 100644 index 0000000000..528d7a19ac --- /dev/null +++ b/helgrind/tests/hg04_race_h9.vgtest @@ -0,0 +1,3 @@ +prog: hg04_race +vgopts: --read-var-info=yes --history-backtrace-size=9 +stderr_filter_args: hg04_race.c |
|
From: Philippe W. <phi...@so...> - 2022-12-29 12:19:00
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3c916e4cbf82eace7b9721a95f0217211aeb05fb commit 3c916e4cbf82eace7b9721a95f0217211aeb05fb Author: Philippe Waroquiers <phi...@sk...> Date: Thu Dec 29 13:18:27 2022 +0100 Fix typo in NEWS. Diff: --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 664c08a970..071f654b50 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,7 @@ AMD64/macOS 10.13 and nanoMIPS/Linux. * Helgrind: - The option ---history-backtrace-size=<number> allows to configure the number of entries to record in the stack traces of "old" - accesses. Previous, this number was hardcoded to 8. + accesses. Previously, this number was hardcoded to 8. * ==================== FIXED BUGS ==================== |
|
From: Philippe W. <phi...@so...> - 2022-12-29 10:37:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=29252c77bbbcbc69eb94058677611a0e312eedf8 commit 29252c77bbbcbc69eb94058677611a0e312eedf8 Author: Philippe Waroquiers <phi...@sk...> Date: Thu Dec 29 11:11:01 2022 +0100 Add clo option the nr of entries in helgrind --history-level=full stack traces The number of such entries was hardcoded to 8. A new command line option -history-backtrace-size=number allows to set the (max) number of entries to record. Note that according perl perf/vg_perf --tools=helgrind --vg=. --vg=../trunk_untouched perf this change (unexpectedly) improves some tests: - Running tests in perf ---------------------------------------------- -- bigcode1 -- bigcode1 . :0.08s he: 2.0s (25.5x, -----) bigcode1 trunk_untouched:0.08s he: 2.1s (25.9x, -1.5%) -- bigcode2 -- bigcode2 . :0.08s he: 4.2s (52.2x, -----) bigcode2 trunk_untouched:0.08s he: 4.2s (52.0x, 0.5%) -- bz2 -- bz2 . :0.40s he: 6.5s (16.3x, -----) bz2 trunk_untouched:0.40s he: 7.4s (18.5x,-14.0%) -- fbench -- fbench . :0.15s he: 2.0s (13.2x, -----) fbench trunk_untouched:0.15s he: 2.3s (15.5x,-17.7%) -- ffbench -- ffbench . :0.16s he: 3.7s (23.2x, -----) ffbench trunk_untouched:0.16s he: 3.7s (23.4x, -0.8%) -- heap -- heap . :0.05s he: 5.1s (102.8x, -----) heap trunk_untouched:0.05s he: 5.2s (104.6x, -1.8%) -- heap_pdb4 -- heap_pdb4 . :0.07s he: 5.8s (82.9x, -----) heap_pdb4 trunk_untouched:0.07s he: 5.8s (83.3x, -0.5%) -- many-loss-records -- many-loss-records . :0.01s he: 1.0s (96.0x, -----) many-loss-records trunk_untouched:0.01s he: 0.9s (95.0x, 1.0%) -- many-xpts -- many-xpts . :0.04s he: 1.6s (38.8x, -----) many-xpts trunk_untouched:0.04s he: 1.5s (38.5x, 0.6%) -- memrw -- memrw . :0.06s he: 2.5s (41.2x, -----) memrw trunk_untouched:0.06s he: 2.5s (41.2x, 0.0%) -- sarp -- sarp . :0.02s he: 4.0s (198.0x, -----) sarp trunk_untouched:0.02s he: 3.9s (196.5x, 0.8%) -- tinycc -- tinycc . :0.10s he: 7.1s (70.7x, -----) tinycc trunk_untouched:0.10s he: 7.6s (75.8x, -7.2%) -- Finished tests in perf ---------------------------------------------- == 12 programs, 24 timings ================= Diff: --- NEWS | 7 +++ helgrind/docs/hg-manual.xml | 33 +++++++---- helgrind/hg_basics.h | 3 + helgrind/hg_main.c | 13 +++- helgrind/libhb_core.c | 140 +++++++++++++++++++++++++------------------- 5 files changed, 123 insertions(+), 73 deletions(-) diff --git a/NEWS b/NEWS index b538ad5241..664c08a970 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,13 @@ AMD64/macOS 10.13 and nanoMIPS/Linux. * Make the address space limit on FreeBSD amd64 128Gbytes (the same as Linux and Solaris, it was 32Gbytes) +* ==================== TOOL CHANGES =================== + +* Helgrind: + - The option ---history-backtrace-size=<number> allows to configure + the number of entries to record in the stack traces of "old" + accesses. Previous, this number was hardcoded to 8. + * ==================== FIXED BUGS ==================== The following bugs have been fixed or resolved. Note that "n-i-bz" diff --git a/helgrind/docs/hg-manual.xml b/helgrind/docs/hg-manual.xml index c00be7bd0c..7082e91f7a 100644 --- a/helgrind/docs/hg-manual.xml +++ b/helgrind/docs/hg-manual.xml @@ -666,9 +666,9 @@ the point it was detected.</para> "<computeroutput>This conflicts with a previous write</computeroutput>". This shows a previous access which also accessed the stated address, and which is believed to be racing -against the access in the first call stack. Note that this second -call stack is limited to a maximum of 8 entries to limit the -memory usage.</para> +against the access in the first call stack. Note that this second call +stack is limited to a maximum of <varname>--history-backtrace-size</varname> +entries with a default value of 8 to limit the memory usage.</para> <para>Finally, Helgrind may attempt to give a description of the raced-on address in source level terms. In this example, it @@ -1117,13 +1117,13 @@ unlock(mx) unlock(mx) [default: full] ]]></option> </term> <listitem> - <para><option>--history-level=full</option> (the default) causes - Helgrind collects enough information about "old" accesses that - it can produce two stack traces in a race report -- both the - stack trace for the current access, and the trace for the - older, conflicting access. To limit memory usage, "old" accesses - stack traces are limited to a maximum of 8 entries, even if - <option>--num-callers</option> value is bigger.</para> + <para><option>--history-level=full</option> (the default) causes Helgrind + collects enough information about "old" accesses that it can produce two + stack traces in a race report -- both the stack trace for the current + access, and the trace for the older, conflicting access. To limit memory + usage, "old" accesses stack traces are limited to a maximum + of <varname>--history-backtrace-size</varname> entries (default 8) or + to <option>--num-callers</option> value if this value is smaller.</para> <para>Collecting such information is expensive in both speed and memory, particularly for programs that do many inter-thread synchronisation events (locks, unlocks, etc). Without such @@ -1150,6 +1150,19 @@ unlock(mx) unlock(mx) </listitem> </varlistentry> + <varlistentry id="opt.history-backtrace-size" + xreflabel="--history-backtrace-size"> + <term> + <option><![CDATA[--history-backtrace-size=<number> + [default: 8] ]]></option> + </term> + <listitem> + <para>When <varname>--history-level=full</varname> is selected, + <varname>--history-backtrace-size=number</varname> indicates how many + entries to record in "old" accesses stack traces.</para> + </listitem> + </varlistentry> + <varlistentry id="opt.delta-stacktrace" xreflabel="--delta-stacktrace"> <term> diff --git a/helgrind/hg_basics.h b/helgrind/hg_basics.h index 89c1bc0f81..1698fca151 100644 --- a/helgrind/hg_basics.h +++ b/helgrind/hg_basics.h @@ -91,6 +91,9 @@ extern Bool HG_(clo_cmp_race_err_addrs); very useful). */ extern UWord HG_(clo_history_level); +/* Controls how many IPs an history stack records. */ +extern UInt HG_(clo_history_backtrace_size); + /* For full history level, determines how the stack trace is computed. no : a stacktrace is always computed from scratch, typically using the unwind information. diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 813c983a4c..26a37ead5e 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -5756,6 +5756,11 @@ static Bool hg_process_cmd_line_option ( const HChar* arg ) else if VG_XACT_CLO(arg, "--history-level=full", HG_(clo_history_level), 2); + else if VG_BINT_CLO(arg, "--history-backtrace-size", + HG_(clo_history_backtrace_size), 2, 500) {} + // 500 just in case someone with a lot of CPU and memory would like to use + // the same value for --num-callers and this. + else if VG_BOOL_CLO(arg, "--delta-stacktrace", HG_(clo_delta_stacktrace)) {} @@ -5765,9 +5770,9 @@ static Bool hg_process_cmd_line_option ( const HChar* arg ) /* "stuvwx" --> stuvwx (binary) */ else if VG_STR_CLO(arg, "--hg-sanity-flags", tmp_str) { Int j; - + if (6 != VG_(strlen)(tmp_str)) { - VG_(message)(Vg_UserMsg, + VG_(message)(Vg_UserMsg, "--hg-sanity-flags argument must have 6 digits\n"); return False; } @@ -5798,7 +5803,7 @@ static Bool hg_process_cmd_line_option ( const HChar* arg ) else if VG_BOOL_CLO(arg, "--ignore-thread-creation", HG_(clo_ignore_thread_creation)) {} - else + else return VG_(replacement_malloc_process_cmd_line_option)(arg); return True; @@ -5813,6 +5818,8 @@ static void hg_print_usage ( void ) " full: show both stack traces for a data race (can be very slow)\n" " approx: full trace for one thread, approx for the other (faster)\n" " none: only show trace for one thread in a race (fastest)\n" +" --history-backtrace-size=<number> record <number> callers for full\n" +" history level [8]\n" " --delta-stacktrace=no|yes [yes on linux amd64/x86]\n" " no : always compute a full history stacktrace from unwind info\n" " yes : derive a stacktrace from the previous stacktrace\n" diff --git a/helgrind/libhb_core.c b/helgrind/libhb_core.c index 683c685f24..7c0ea84503 100644 --- a/helgrind/libhb_core.c +++ b/helgrind/libhb_core.c @@ -284,7 +284,8 @@ typedef #define N_KWs_N_STACKs_PER_THREAD 62500 -#define N_FRAMES 8 +UInt HG_(clo_history_backtrace_size) = 8; + // (UInt) `echo "Reference Counted Execution Context" | md5sum` #define RCEC_MAGIC 0xab88abb2UL @@ -297,7 +298,9 @@ typedef UWord rc; UWord rcX; /* used for crosschecking */ UWord frames_hash; /* hash of all the frames */ - UWord frames[N_FRAMES]; + UWord frames[0]; + /* Variable-length array. + The size depends on HG_(clo_history_backtrace_size). */ } RCEC; @@ -305,7 +308,7 @@ struct _Thr { /* Current VTSs for this thread. They change as we go along. viR is the VTS to be used for reads, viW for writes. Usually they are the same, but can differ when we deal with reader-writer - locks. It is always the case that + locks. It is always the case that VtsID__cmpLEQ(viW,viR) == True that is, viW must be the same, or lagging behind, viR. */ VtsID viR; @@ -337,19 +340,24 @@ struct _Thr { Thread should be merged into a single structure. */ Thread* hgthread; + /* The ULongs (scalar Kws) in this accumulate in strictly + increasing order, without duplicates. This is important because + we need to be able to find a given scalar Kw in this array + later, by binary search. */ + XArray* /* ULong_n_EC */ local_Kws_n_stacks; + /* cached_rcec maintains the last RCEC that was retrieved for this thread. */ - RCEC cached_rcec; // cached_rcec value, not ref-counted. + RCEC cached_rcec; + // cached_rcec value, not ref-counted. + // As the last member of an RCEC is a variable length array, this must be + // the last element of the _Thr struct. + /* The shadow register vex_shadow1 SP register (SP_s1) is used to maintain the validity of the cached rcec. If SP_s1 is 0, then the cached rcec is invalid (cannot be used). If SP_S1 is != 0, then the cached rcec is valid. The valid cached rcec can be used to generate a new RCEC by changing just the last frame. */ - /* The ULongs (scalar Kws) in this accumulate in strictly - increasing order, without duplicates. This is important because - we need to be able to find a given scalar Kw in this array - later, by binary search. */ - XArray* /* ULong_n_EC */ local_Kws_n_stacks; }; @@ -4061,7 +4069,12 @@ static inline void set_cached_rcec_validity(Thr *thr, Bool valid) static Thr* Thr__new ( void ) { - Thr* thr = HG_(zalloc)( "libhb.Thr__new.1", sizeof(Thr) ); + Thr* thr = HG_(zalloc) + ( "libhb.Thr__new.1", + sizeof(Thr) + HG_(clo_history_backtrace_size) * sizeof(UWord)); + // We need to add the size of the frames in the cached_rcec (last member of + // _Thr). + thr->viR = VtsID_INVALID; thr->viW = VtsID_INVALID; thr->llexit_done = False; @@ -4308,7 +4321,7 @@ static Bool RCEC__differs_by_frames ( RCEC* ec1, RCEC* ec2 ) { tl_assert(ec2 && ec2->magic == RCEC_MAGIC); } if (ec1->frames_hash != ec2->frames_hash) return True; - for (i = 0; i < N_FRAMES; i++) { + for (i = 0; i < HG_(clo_history_backtrace_size); i++) { if (ec1->frames[i] != ec2->frames[i]) return True; } return False; @@ -4424,6 +4437,8 @@ static RCEC* ctxt__find_or_add ( RCEC* example ) copy = alloc_RCEC(); tl_assert(copy != example); *copy = *example; + for (Word i = 0; i < HG_(clo_history_backtrace_size); i++) + copy->frames[i] = example->frames[i]; copy->next = contextTab[hent]; contextTab[hent] = copy; stats__ctxt_tab_curr++; @@ -4457,16 +4472,17 @@ static Bool check_cached_rcec_ok (Thr* thr, Addr previous_frame0) { Bool ok = True; UInt i; - UWord frames[N_FRAMES]; - UWord sps[N_FRAMES]; - UWord fps[N_FRAMES]; + UWord frames[HG_(clo_history_backtrace_size)]; + UWord sps[HG_(clo_history_backtrace_size)]; + UWord fps[HG_(clo_history_backtrace_size)]; const DiEpoch cur_ep = VG_(current_DiEpoch)(); - for (i = 0; i < N_FRAMES; i++) + for (i = 0; i < HG_(clo_history_backtrace_size); i++) frames[i] = sps[i] = fps[i] = 0; - VG_(get_StackTrace)( thr->hgthread->coretid, &frames[0], N_FRAMES, + VG_(get_StackTrace)( thr->hgthread->coretid, &frames[0], + HG_(clo_history_backtrace_size), &sps[0], &fps[0], 0); - for (i = 0; i < N_FRAMES; i++) { + for (i = 0; i < HG_(clo_history_backtrace_size); i++) { if ( thr->cached_rcec.frames[i] != frames[i] ) { /* There are a bunch of "normal" reasons for which a stack derived from the cached rcec differs from frames. */ @@ -4506,16 +4522,20 @@ static Bool check_cached_rcec_ok (Thr* thr, Addr previous_frame0) unless asked to show below main. */ if (reason == NULL) { UInt fr_main; - Vg_FnNameKind fr_kind; - for (fr_main = 0; fr_main < N_FRAMES; fr_main++) { + Vg_FnNameKind fr_kind = Vg_FnNameNormal; + for (fr_main = 0; + fr_main < HG_(clo_history_backtrace_size); + fr_main++) { fr_kind = VG_(get_fnname_kind_from_IP) (cur_ep, frames[fr_main]); if (fr_kind == Vg_FnNameMain || fr_kind == Vg_FnNameBelowMain) break; } UInt kh_main; - Vg_FnNameKind kh_kind; - for (kh_main = 0; kh_main < N_FRAMES; kh_main++) { + Vg_FnNameKind kh_kind = Vg_FnNameNormal; + for (kh_main = 0; + kh_main < HG_(clo_history_backtrace_size); + kh_main++) { kh_kind = VG_(get_fnname_kind_from_IP) (cur_ep, thr->cached_rcec.frames[kh_main]); if (kh_kind == Vg_FnNameMain || kh_kind == Vg_FnNameBelowMain) @@ -4558,7 +4578,7 @@ static Bool check_cached_rcec_ok (Thr* thr, Addr previous_frame0) if (reason == NULL) { if ((i > 0 && sps[i] == sps[i-1] && fps[i] == fps[i-1]) - || (i < N_FRAMES-1 + || (i < HG_(clo_history_backtrace_size)-1 && sps[i] == sps[i+1] && fps[i] == fps[i+1])) { reason = "previous||next frame: identical sp and fp"; } @@ -4566,7 +4586,7 @@ static Bool check_cached_rcec_ok (Thr* thr, Addr previous_frame0) if (reason == NULL) { if ((i > 0 && fps[i] == fps[i-1]) - || (i < N_FRAMES-1 + || (i < HG_(clo_history_backtrace_size)-1 && fps[i] == fps[i+1])) { reason = "previous||next frame: identical fp"; } @@ -4585,7 +4605,7 @@ static Bool check_cached_rcec_ok (Thr* thr, Addr previous_frame0) So, if we find __run_exit_handlers, ignore the difference. */ if (reason == NULL) { const HChar *fnname; - for (UInt f = 0; f < N_FRAMES; f++) { + for (UInt f = 0; f < HG_(clo_history_backtrace_size); f++) { if (VG_(get_fnname)( cur_ep, frames[f], &fnname) && VG_(strcmp) ("__run_exit_handlers", fnname) == 0) { reason = "exit handlers"; @@ -4633,9 +4653,10 @@ static Bool check_cached_rcec_ok (Thr* thr, Addr previous_frame0) (void*)previous_frame0); VG_(pp_StackTrace)(cur_ep, &previous_frame0, 1); VG_(printf)("resulting cached stack trace:\n"); - VG_(pp_StackTrace)(cur_ep, thr->cached_rcec.frames, N_FRAMES); + VG_(pp_StackTrace)(cur_ep, thr->cached_rcec.frames, + HG_(clo_history_backtrace_size)); VG_(printf)("check stack trace:\n"); - VG_(pp_StackTrace)(cur_ep, frames, N_FRAMES); + VG_(pp_StackTrace)(cur_ep, frames, HG_(clo_history_backtrace_size)); VG_(show_sched_status) (False, // host_stacktrace False, // stack_usage @@ -4697,20 +4718,22 @@ static RCEC* get_RCEC ( Thr* thr ) stats__cached_rcec_updated++; } else { /* Compute a fresh stacktrace. */ - main_get_stacktrace( thr, &thr->cached_rcec.frames[0], N_FRAMES ); + main_get_stacktrace( thr, &thr->cached_rcec.frames[0], + HG_(clo_history_backtrace_size) ); if (DEBUG_CACHED_RCEC) { Bool save_show_below_main = VG_(clo_show_below_main); VG_(clo_show_below_main) = True; VG_(printf)("caching stack trace:\n"); VG_(pp_StackTrace)(VG_(current_DiEpoch)(), - &thr->cached_rcec.frames[0], N_FRAMES); + &thr->cached_rcec.frames[0], + HG_(clo_history_backtrace_size)); VG_(clo_show_below_main) = save_show_below_main; } stats__cached_rcec_fresh++; } hash = 0; - for (i = 0; i < N_FRAMES; i++) { + for (i = 0; i < HG_(clo_history_backtrace_size); i++) { hash ^= thr->cached_rcec.frames[i]; hash = ROLW(hash, 19); } @@ -5044,11 +5067,12 @@ Bool libhb_event_map_lookup ( /*OUT*/ExeContext** resEC, tl_assert(ref_rcec->magic == RCEC_MAGIC); tl_assert(ref_szB >= 1); /* Count how many non-zero frames we have. */ - maxNFrames = min_UInt(N_FRAMES, VG_(clo_backtrace_size)); + maxNFrames = min_UInt(HG_(clo_history_backtrace_size), + VG_(clo_backtrace_size)); for (n = 0; n < maxNFrames; n++) { if (0 == ref_rcec->frames[n]) break; } - *resEC = VG_(make_ExeContext_from_StackTrace)(ref_rcec->frames, + *resEC = VG_(make_ExeContext_from_StackTrace)(&ref_rcec->frames[0], n); *resThr = Thr__from_ThrID(ref->acc.tsw.thrid); *resSzB = ref_szB; @@ -5072,17 +5096,17 @@ void libhb_event_map_access_history ( Addr a, SizeT szB, Access_t fn ) OldRef *ref = lru.next; SizeT ref_szB; Int n; - + while (ref != &mru) { ref_szB = ref->acc.tsw.szB; if (cmp_nonempty_intervals(a, szB, ref->ga, ref_szB) == 0) { RCEC* ref_rcec = ref->acc.rcec; - for (n = 0; n < N_FRAMES; n++) { + for (n = 0; n < HG_(clo_history_backtrace_size); n++) { if (0 == ref_rcec->frames[n]) { break; } } - (*fn)(ref_rcec->frames, n, + (*fn)(&ref_rcec->frames[0], n, Thr__from_ThrID(ref->acc.tsw.thrid), ref->ga, ref_szB, @@ -5101,13 +5125,14 @@ static void event_map_init ( void ) Word i; /* Context (RCEC) pool allocator */ - rcec_pool_allocator = VG_(newPA) ( - sizeof(RCEC), - 1000 /* RCECs per pool */, - HG_(zalloc), - "libhb.event_map_init.1 (RCEC pools)", - HG_(free) - ); + rcec_pool_allocator + = VG_(newPA) ( + sizeof(RCEC) + 2 * HG_(clo_history_backtrace_size) * sizeof(UWord), + 1000 /* RCECs per pool */, + HG_(zalloc), + "libhb.event_map_init.1 (RCEC pools)", + HG_(free) + ); /* Context table */ tl_assert(!contextTab); @@ -6839,25 +6864,20 @@ void libhb_shutdown ( Bool show_stats ) stats__ctxt_tab_qs, stats__ctxt_tab_cmps ); #if 0 - VG_(printf)("sizeof(AvlNode) = %lu\n", sizeof(AvlNode)); - VG_(printf)("sizeof(WordBag) = %lu\n", sizeof(WordBag)); - VG_(printf)("sizeof(MaybeWord) = %lu\n", sizeof(MaybeWord)); - VG_(printf)("sizeof(CacheLine) = %lu\n", sizeof(CacheLine)); - VG_(printf)("sizeof(LineZ) = %lu\n", sizeof(LineZ)); - VG_(printf)("sizeof(LineF) = %lu\n", sizeof(LineF)); - VG_(printf)("sizeof(SecMap) = %lu\n", sizeof(SecMap)); - VG_(printf)("sizeof(Cache) = %lu\n", sizeof(Cache)); - VG_(printf)("sizeof(SMCacheEnt) = %lu\n", sizeof(SMCacheEnt)); - VG_(printf)("sizeof(CountedSVal) = %lu\n", sizeof(CountedSVal)); - VG_(printf)("sizeof(VTS) = %lu\n", sizeof(VTS)); - VG_(printf)("sizeof(ScalarTS) = %lu\n", sizeof(ScalarTS)); - VG_(printf)("sizeof(VtsTE) = %lu\n", sizeof(VtsTE)); - VG_(printf)("sizeof(MSMInfo) = %lu\n", sizeof(MSMInfo)); - - VG_(printf)("sizeof(struct _XArray) = %lu\n", sizeof(struct _XArray)); - VG_(printf)("sizeof(struct _WordFM) = %lu\n", sizeof(struct _WordFM)); - VG_(printf)("sizeof(struct _Thr) = %lu\n", sizeof(struct _Thr)); - VG_(printf)("sizeof(struct _SO) = %lu\n", sizeof(struct _SO)); + VG_(printf)("sizeof(CacheLine) = %zu\n", sizeof(CacheLine)); + VG_(printf)("sizeof(LineZ) = %zu\n", sizeof(LineZ)); + VG_(printf)("sizeof(LineF) = %zu\n", sizeof(LineF)); + VG_(printf)("sizeof(SecMap) = %zu\n", sizeof(SecMap)); + VG_(printf)("sizeof(Cache) = %zu\n", sizeof(Cache)); + VG_(printf)("sizeof(SMCacheEnt) = %zu\n", sizeof(SMCacheEnt)); + VG_(printf)("sizeof(CountedSVal) = %zu\n", sizeof(CountedSVal)); + VG_(printf)("sizeof(VTS) = %zu\n", sizeof(VTS)); + VG_(printf)("sizeof(ScalarTS) = %zu\n", sizeof(ScalarTS)); + VG_(printf)("sizeof(VtsTE) = %zu\n", sizeof(VtsTE)); + + VG_(printf)("sizeof(struct _Thr) = %zu\n", sizeof(struct _Thr)); + VG_(printf)("sizeof(RCEC) = %zu\n", sizeof(RCEC)); + VG_(printf)("sizeof(struct _SO) = %zu\n", sizeof(struct _SO)); #endif VG_(printf)("%s","<<< END libhb stats >>>\n"); |