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
(5) |
|
3
(5) |
4
(6) |
5
(6) |
6
(10) |
7
(10) |
8
(10) |
9
(10) |
|
10
(6) |
11
(6) |
12
(8) |
13
(33) |
14
(19) |
15
(6) |
16
(15) |
|
17
(8) |
18
(29) |
19
(23) |
20
(20) |
21
(8) |
22
(6) |
23
(6) |
|
24
(6) |
25
(22) |
26
(21) |
27
(9) |
28
(21) |
29
(11) |
30
(7) |
|
31
(16) |
|
|
|
|
|
|
|
From: Tom H. <th...@cy...> - 2004-10-16 16:50:20
|
CVS commit by thughes:
When returning from handling a signal check whether any mutex that the
thread was waiting on has been unlocked while the signal handler was
running and resume the thread if it was.
M +12 -0 vg_scheduler.c 1.189
--- valgrind/coregrind/vg_scheduler.c #1.188:1.189
@@ -465,4 +465,16 @@ void handle_signal_return ( ThreadId tid
}
+ /* If we were interrupted while waiting on a mutex then check that
+ it hasn't been unlocked while we were busy handling the signal. */
+ if (VG_(threads)[tid].status == VgTs_WaitMX &&
+ VG_(threads)[tid].associated_mx->__vg_m_count == 0) {
+ vg_pthread_mutex_t* mutex = VG_(threads)[tid].associated_mx;
+ mutex->__vg_m_count = 1;
+ mutex->__vg_m_owner = (/*_pthread_descr*/void*)tid;
+ VG_(threads)[tid].status = VgTs_Runnable;
+ VG_(threads)[tid].associated_mx = NULL;
+ /* m_edx already holds pth_mx_lock() success (0) */
+ }
+
if (restart_blocked_syscalls)
/* Easy; we don't have to do anything. */
|
|
From: Tom H. <th...@cy...> - 2004-10-16 16:17:09
|
CVS commit by thughes:
If a thread is waiting on a mutex or condition variable when a signal is
delivered that the thread state is temporarily changed from WaitMX or WaitCV
to Running while the signal handler is running. The original state is then
restored when the handler returns.
This patch forces the associated_mx and associated_cv values to be cleared
at the same time and the original values restored afterwards. Without this
the scheduler state will not be considered sane while the handler is running.
This is based on a patch from Kenneth Schalk and fixes a problem he had
with posting to a semaphore in a signal handler. It also allows a couple
of assertions in the scheduler sanity check to be uncommented.
BUG: 72082
M +2 -4 vg_scheduler.c 1.188
M +6 -0 vg_signals.c 1.95
M +9 -0 x86/signal.c 1.3
--- valgrind/coregrind/vg_scheduler.c #1.187:1.188
@@ -3237,8 +3237,6 @@ void scheduler_sanity ( void )
vg_assert(mx != NULL);
} else {
- /* Unfortunately these don't hold true when a sighandler is
- running. To be fixed. */
- /* vg_assert(cv == NULL); */
- /* vg_assert(mx == NULL); */
+ vg_assert(cv == NULL);
+ vg_assert(mx == NULL);
}
--- valgrind/coregrind/vg_signals.c #1.94:1.95
@@ -1596,4 +1596,10 @@ void VG_(deliver_signal) ( ThreadId tid,
}
+ /* Clear the associated mx/cv information as we are no longer
+ waiting on anything. The original details will be restored
+ when the signal frame is popped. */
+ tst->associated_mx = NULL;
+ tst->associated_cv = NULL;
+
/* handler gets the union of the signal's mask and the thread's
mask */
--- valgrind/coregrind/x86/signal.c #1.2:1.3
@@ -110,4 +110,7 @@ typedef
delivering this signal? */
ThreadStatus status;
+ void* /*pthread_mutex_t* */ associated_mx;
+ void* /*pthread_cond_t* */ associated_cv;
+
/* Sanity check word. Is the highest-addressed word; do not
move!*/
@@ -270,4 +273,7 @@ void VGA_(push_signal_frame)(ThreadId ti
frame->status = tst->status;
+ frame->associated_mx = tst->associated_mx;
+ frame->associated_cv = tst->associated_cv;
+
frame->magicE = 0x27182818;
@@ -343,4 +349,7 @@ Int VGA_(pop_signal_frame)(ThreadId tid)
tst->status = frame->status;
+ tst->associated_mx = frame->associated_mx;
+ tst->associated_cv = frame->associated_cv;
+
tst->sig_mask = frame->mask;
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-16 15:31:59
|
CVS commit by nethercote:
Remove unnecessary glibc #includes; use VKI_O_RDONLY instead of O_RDONLY as
appropriate with VG_(open).
M +1 -4 vg_main.c 1.216
--- valgrind/coregrind/vg_main.c #1.215:1.216
@@ -37,13 +37,10 @@
#include <dlfcn.h>
#include <errno.h>
-#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ptrace.h>
-#include <sys/signal.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -1386,5 +1383,5 @@ static void load_client(char* cl_argv[],
} else {
Int ret;
- VG_(clexecfd) = VG_(open)(exec, O_RDONLY, VKI_S_IRUSR);
+ VG_(clexecfd) = VG_(open)(exec, VKI_O_RDONLY, VKI_S_IRUSR);
ret = do_exec(exec, info);
if (ret != 0) {
|
|
From: Tom H. <th...@cy...> - 2004-10-16 14:49:56
|
CVS commit by thughes:
Remove the limit on the number of pthread read/write locks. This works
in a similar way to the previous patch that removed the limit on the
number of semaphores and fixes bug 86264.
A corecheck/tests/pth_rwlock.c 1.1 [POSSIBLY UNSAFE: printf] [no copyright]
A corecheck/tests/pth_rwlock.stderr.exp 1.1
A corecheck/tests/pth_rwlock.vgtest 1.1
M +1 -0 corecheck/tests/.cvsignore 1.9
M +4 -1 corecheck/tests/Makefile.am 1.22
M +0 -3 coregrind/core.h 1.36
M +93 -89 coregrind/vg_libpthread.c 1.167
--- valgrind/corecheck/tests/.cvsignore #1.8:1.9
@@ -11,4 +11,5 @@
pth_mutexspeed
pth_once
+pth_rwlock
res_search
.ktemp
--- valgrind/corecheck/tests/Makefile.am #1.21:1.22
@@ -29,4 +29,5 @@
pth_mutexspeed.stdout.exp pth_mutexspeed.vgtest \
pth_once.stderr.exp pth_once.stdout.exp pth_once.vgtest \
+ pth_rwlock.stderr.exp pth_rwlock.vgtest \
sigkill.stderr.exp sigkill.vgtest \
res_search.stderr.exp res_search.stdout.exp res_search.vgtest \
@@ -38,5 +39,5 @@
fdleak_socketpair sigkill res_search \
pth_atfork1 pth_cancel1 pth_cancel2 pth_cvsimple pth_empty \
- pth_exit pth_exit2 pth_mutexspeed pth_once \
+ pth_exit pth_exit2 pth_mutexspeed pth_once pth_rwlock \
as_mmap as_shm \
vgprintf
@@ -82,4 +83,6 @@
pth_once_SOURCES = pth_once.c
pth_once_LDADD = -lpthread
+pth_rwlock_SOURCES = pth_rwlock.c
+pth_rwlock_LDADD = -lpthread
res_search_SOURCES = res_search.c
res_search_LDADD = -lresolv -lpthread
--- valgrind/coregrind/core.h #1.35:1.36
@@ -165,7 +165,4 @@
#define VG_PTHREAD_STACK_SIZE (1 << 20)
-/* Number of entries in the rwlock-remapping table. */
-#define VG_N_RWLOCKS 500
-
/* Number of entries in each thread's cleanup stack. */
#define VG_N_CLEANUPSTACK 16
--- valgrind/coregrind/vg_libpthread.c #1.166:1.167
@@ -2944,5 +2944,4 @@ int sem_timedwait(sem_t* sem, const stru
typedef
struct {
- int initted; /* != 0 --> in use; sanity check only */
int prefer_w; /* != 0 --> prefer writer */
int nwait_r; /* # of waiting readers */
@@ -2958,16 +2957,12 @@ typedef
-static pthread_mutex_t rw_remap_mx = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t rw_new_mx = PTHREAD_MUTEX_INITIALIZER;
-static int rw_remap_used = 0;
-static pthread_rwlock_t* rw_remap_orig[VG_N_RWLOCKS];
-static vg_rwlock_t rw_remap_new[VG_N_RWLOCKS];
+#define RWLOCK_CHECK_MAGIC 0xb5d17027
-static
-void init_vg_rwlock ( vg_rwlock_t* vg_rwl )
+static void init_vg_rwlock ( vg_rwlock_t* vg_rwl )
{
int res = 0;
- vg_rwl->initted = 1;
vg_rwl->prefer_w = 1;
vg_rwl->nwait_r = 0;
@@ -2980,52 +2975,69 @@ void init_vg_rwlock ( vg_rwlock_t* vg_rw
}
-
-/* Take the address of a LinuxThreads rwlock_t and return the shadow
- address of our version. Further, if the LinuxThreads version
- appears to have been statically initialised, do the same to the one
- we allocate here. The vg_pthread_rwlock_t.__vg_rw_readers field is set
- to zero by PTHREAD_RWLOCK_INITIALIZER (as are several other fields), so
- we take zero as meaning uninitialised and non-zero meaning initialised.
-*/
-static vg_rwlock_t* rw_remap ( pthread_rwlock_t* orig )
+static vg_rwlock_t* rw_new ( pthread_rwlock_t* orig )
{
- int res, i;
- vg_rwlock_t* vg_rwl;
+ int res;
+ vg_rwlock_t* rwl;
vg_pthread_rwlock_t* vg_orig;
+ CONVERT(rwlock, orig, vg_orig);
- res = __pthread_mutex_lock(&rw_remap_mx);
+ res = __pthread_mutex_lock(&rw_new_mx);
my_assert(res == 0);
- for (i = 0; i < rw_remap_used; i++) {
- if (rw_remap_orig[i] == orig)
- break;
- }
- if (i == rw_remap_used) {
- if (rw_remap_used == VG_N_RWLOCKS) {
- res = __pthread_mutex_unlock(&rw_remap_mx);
- my_assert(res == 0);
- barf("VG_N_RWLOCKS is too low. Increase and recompile.");
- }
- rw_remap_used++;
- rw_remap_orig[i] = orig;
- rw_remap_new[i].initted = 0;
- if (0) printf("allocated rwlock %d\n", i);
- }
- res = __pthread_mutex_unlock(&rw_remap_mx);
+ rwl = my_malloc(sizeof(vg_rwlock_t));
+
+ vg_orig->__vg_rw_writer = rwl;
+ vg_orig->__vg_rw_read_waiting = (void *)((Addr)rwl ^ RWLOCK_CHECK_MAGIC);
+
+ init_vg_rwlock(rwl);
+ if (vg_orig->__vg_rw_kind == PTHREAD_RWLOCK_PREFER_READER_NP)
+ rwl->prefer_w = 0;
+
+ res = __pthread_mutex_unlock(&rw_new_mx);
my_assert(res == 0);
- vg_rwl = &rw_remap_new[i];
- /* Initialise the shadow, if required. */
+ return rwl;
+}
+
+static vg_rwlock_t* rw_lookup ( pthread_rwlock_t* orig )
+{
+ vg_rwlock_t* rwl;
+ vg_pthread_rwlock_t* vg_orig;
CONVERT(rwlock, orig, vg_orig);
- if (vg_orig->__vg_rw_readers == 0) {
- vg_orig->__vg_rw_readers = 1;
- init_vg_rwlock(vg_rwl);
- if (vg_orig->__vg_rw_kind == PTHREAD_RWLOCK_PREFER_READER_NP)
- vg_rwl->prefer_w = 0;
- }
- return vg_rwl;
+ if (vg_orig->__vg_rw_writer == NULL)
+ rwl = rw_new (orig);
+ else if (((Addr)vg_orig->__vg_rw_writer ^ RWLOCK_CHECK_MAGIC) == (Addr)vg_orig->__vg_rw_read_waiting)
+ rwl = vg_orig->__vg_rw_writer;
+ else
+ rwl = NULL;
+
+ return rwl;
}
+static void rw_free ( pthread_rwlock_t* orig )
+{
+ int res;
+ vg_rwlock_t* rwl;
+ vg_pthread_rwlock_t* vg_orig;
+ CONVERT(rwlock, orig, vg_orig);
+
+ rwl = vg_orig->__vg_rw_writer;
+
+ vg_orig->__vg_rw_writer = NULL;
+ vg_orig->__vg_rw_read_waiting = NULL;
+
+ res = __pthread_mutex_unlock(&rwl->mx);
+ my_assert(res == 0);
+
+ res = pthread_cond_destroy(&rwl->cv_w);
+ res |= pthread_cond_destroy(&rwl->cv_r);
+ res |= pthread_mutex_destroy(&rwl->mx);
+ my_assert(res == 0);
+
+ my_free(rwl);
+
+ return;
+}
int pthread_rwlock_init ( pthread_rwlock_t* orig,
@@ -3039,11 +3051,11 @@ int pthread_rwlock_init ( pthread_rwlock
if (0) printf ("pthread_rwlock_init\n");
- /* Force the remapper to initialise the shadow. */
- vg_orig->__vg_rw_readers = 0;
/* Install the lock preference; the remapper needs to know it. */
- vg_orig->__vg_rw_kind = PTHREAD_RWLOCK_DEFAULT_NP;
if (vg_attr)
vg_orig->__vg_rw_kind = vg_attr->__vg_lockkind;
- rwl = rw_remap ( (pthread_rwlock_t*)vg_orig );
+ else
+ vg_orig->__vg_rw_kind = PTHREAD_RWLOCK_DEFAULT_NP;
+ /* Allocate the shadow */
+ rwl = rw_new ((pthread_rwlock_t *)vg_orig);
return 0;
}
@@ -3065,12 +3077,11 @@ int pthread_rwlock_rdlock ( pthread_rwlo
if (0) printf ("pthread_rwlock_rdlock\n");
- rwl = rw_remap ( orig );
- res = __pthread_mutex_lock(&rwl->mx);
- my_assert(res == 0);
- if (!rwl->initted) {
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rwl = rw_lookup (orig);
+ if(!rwl) {
+ pthread_error("pthread_rwlock_rdlock: lock overwritten or not initialized");
return EINVAL;
}
+ res = __pthread_mutex_lock(&rwl->mx);
+ my_assert(res == 0);
if (rwl->status < 0) {
my_assert(rwl->status == -1);
@@ -3099,12 +3110,11 @@ int pthread_rwlock_tryrdlock ( pthread_r
if (0) printf ("pthread_rwlock_tryrdlock\n");
- rwl = rw_remap ( orig );
- res = __pthread_mutex_lock(&rwl->mx);
- my_assert(res == 0);
- if (!rwl->initted) {
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rwl = rw_lookup (orig);
+ if(!rwl) {
+ pthread_error("pthread_rwlock_tryrdlock: lock overwritten or not initialized");
return EINVAL;
}
+ res = __pthread_mutex_lock(&rwl->mx);
+ my_assert(res == 0);
if (rwl->status == -1) {
/* Writer active; we have to give up. */
@@ -3137,12 +3147,11 @@ int pthread_rwlock_wrlock ( pthread_rwlo
if (0) printf ("pthread_rwlock_wrlock\n");
- rwl = rw_remap ( orig );
- res = __pthread_mutex_lock(&rwl->mx);
- my_assert(res == 0);
- if (!rwl->initted) {
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rwl = rw_lookup (orig);
+ if(!rwl) {
+ pthread_error("pthread_rwlock_wrlock: lock overwritten or not initialized");
return EINVAL;
}
+ res = __pthread_mutex_lock(&rwl->mx);
+ my_assert(res == 0);
if (rwl->status != 0) {
rwl->nwait_w++;
@@ -3169,12 +3178,11 @@ int pthread_rwlock_trywrlock ( pthread_r
vg_rwlock_t* rwl;
if (0) printf ("pthread_wrlock_trywrlock\n");
- rwl = rw_remap ( orig );
- res = __pthread_mutex_lock(&rwl->mx);
- my_assert(res == 0);
- if (!rwl->initted) {
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rwl = rw_lookup (orig);
+ if(!rwl) {
+ pthread_error("pthread_rwlock_trywrlock: lock overwritten or not initialized");
return EINVAL;
}
+ res = __pthread_mutex_lock(&rwl->mx);
+ my_assert(res == 0);
if (rwl->status != 0) {
/* Reader(s) or a writer active; we have to give up. */
@@ -3197,12 +3205,11 @@ int pthread_rwlock_unlock ( pthread_rwlo
vg_rwlock_t* rwl;
if (0) printf ("pthread_rwlock_unlock\n");
- rwl = rw_remap ( orig );
- res = __pthread_mutex_lock(&rwl->mx);
- my_assert(res == 0);
- if (!rwl->initted) {
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rwl = rw_lookup (orig);
+ if(!rwl) {
+ pthread_error("pthread_rwlock_unlock: lock overwritten or not initialized");
return EINVAL;
}
+ res = __pthread_mutex_lock(&rwl->mx);
+ my_assert(res == 0);
if (rwl->status == 0) {
res = __pthread_mutex_unlock(&rwl->mx);
@@ -3272,12 +3279,11 @@ int pthread_rwlock_destroy ( pthread_rwl
vg_rwlock_t* rwl;
if (0) printf ("pthread_rwlock_destroy\n");
- rwl = rw_remap ( orig );
- res = __pthread_mutex_lock(&rwl->mx);
- my_assert(res == 0);
- if (!rwl->initted) {
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rwl = rw_lookup (orig);
+ if(!rwl) {
+ pthread_error("pthread_rwlock_destroy: lock overwritten or not initialized");
return EINVAL;
}
+ res = __pthread_mutex_lock(&rwl->mx);
+ my_assert(res == 0);
if (rwl->status != 0 || rwl->nwait_r > 0 || rwl->nwait_w > 0) {
res = __pthread_mutex_unlock(&rwl->mx);
@@ -3285,7 +3291,5 @@ int pthread_rwlock_destroy ( pthread_rwl
return EBUSY;
}
- rwl->initted = 0;
- res = __pthread_mutex_unlock(&rwl->mx);
- my_assert(res == 0);
+ rw_free (orig);
return 0;
}
|
|
From: Tom H. <th...@cy...> - 2004-10-16 11:02:36
|
CVS commit by thughes: Suppress .stderr.diff2 files as well as .stderr.diff files. M +1 -1 corecheck/tests/.cvsignore 1.8 M +1 -1 memcheck/tests/.cvsignore 1.18 --- valgrind/corecheck/tests/.cvsignore #1.7:1.8 @@ -14,5 +14,5 @@ .ktemp *.stdout.diff -*.stderr.diff +*.stderr.diff* *.stdout.out *.stderr.out --- valgrind/memcheck/tests/.cvsignore #1.17:1.18 @@ -54,5 +54,5 @@ weirdioctl *.stdout.diff -*.stderr.diff +*.stderr.diff* *.stdout.out *.stderr.out |
|
From: Tom H. <th...@cy...> - 2004-10-16 10:59:52
|
CVS commit by thughes:
When signal routing is in use (because we are running on an older kernel
that doesn't route signals to the correct threads properly) the siginfo
data was not being propagated to any signal handlers installed by the
client program.
This is because the main thread routes the signal to the proxy LWP by
using the tkill system call but that then appears in the proxy as a user
initiated signal and the original siginfo data is lost.
This patch adds a small queue of siginfo data for pending sigals to
each thread's state so that when the proxy LWP passes the signal back
to the main thread the relevant siginfo data can be recovered and passed
on to any signal handlers. Thix fixes bug 91325.
M +12 -0 core.h 1.35
M +20 -1 vg_proxylwp.c 1.23
M +2 -0 vg_scheduler.c 1.187
M +8 -1 vg_signals.c 1.94
--- valgrind/coregrind/core.h #1.34:1.35
@@ -177,4 +177,7 @@
#define VG_N_SUPP_CALLERS 4
+/* Numer of entries in each thread's signal queue. */
+#define VG_N_SIGNALQUEUE 8
+
/* Useful macros */
/* a - alignment - must be a power of 2 */
@@ -813,4 +816,13 @@ typedef
vki_ksigset_t eff_sig_mask;
+ /* Signal queue. This is used when the kernel doesn't route
+ signals properly in order to remember the signal information
+ while we are routing the signal. It is a circular queue with
+ insertions performed at the head and removals at the tail.
+ */
+ vki_ksiginfo_t sigqueue[VG_N_SIGNALQUEUE];
+ Int sigqueue_head;
+ Int sigqueue_tail;
+
/* Stacks. When a thread slot is freed, we don't deallocate its
stack; we just leave it lying around for the next use of the
--- valgrind/coregrind/vg_proxylwp.c #1.22:1.23
@@ -1154,4 +1154,23 @@ static void sys_wait_results(Bool block,
case PX_Signal:
+ if (VG_(do_signal_routing) &&
+ res.u.siginfo.si_code == VKI_SI_USER &&
+ res.u.siginfo._sifields._kill._pid == VG_(getpid)()) {
+ Int ptr = tst->sigqueue_tail;
+
+ while (tst->sigqueue[ptr].si_signo != res.u.siginfo.si_signo) {
+ vg_assert(ptr != tst->sigqueue_head);
+ ptr = (ptr + 1) % VG_N_SIGNALQUEUE;
+ }
+
+ res.u.siginfo = tst->sigqueue[ptr];
+ tst->sigqueue[ptr].si_signo = 0;
+
+ while (tst->sigqueue_tail != tst->sigqueue_head &&
+ tst->sigqueue[tst->sigqueue_tail].si_signo == 0) {
+ tst->sigqueue_tail = (tst->sigqueue_tail + 1) % VG_N_SIGNALQUEUE;
+ }
+ }
+
if (VG_(clo_trace_signals) || VG_(clo_trace_syscalls))
VG_(message)(Vg_DebugMsg, "sys_wait_results: got PX_Signal for TID %d, signal %d",
--- valgrind/coregrind/vg_scheduler.c #1.186:1.187
@@ -373,4 +373,6 @@ void mostly_clear_thread_record ( Thread
VG_(ksigemptyset)(&VG_(threads)[tid].sig_mask);
VG_(ksigfillset)(&VG_(threads)[tid].eff_sig_mask);
+ VG_(threads)[tid].sigqueue_head = 0;
+ VG_(threads)[tid].sigqueue_tail = 0;
VG_(threads)[tid].specifics_ptr = NULL;
--- valgrind/coregrind/vg_signals.c #1.93:1.94
@@ -1919,4 +1919,5 @@ void VG_(route_signals)(void)
static ThreadId start_tid = 1; /* tid to start scanning from */
vki_ksigset_t set;
+ vki_ksiginfo_t siset[VKI_KNSIG];
vki_ksiginfo_t si;
Int sigNo;
@@ -1934,6 +1935,8 @@ void VG_(route_signals)(void)
/* grab any pending signals and add them to the pending signal set */
- while(VG_(ksigtimedwait)(&set, &si, &zero) > 0)
+ while(VG_(ksigtimedwait)(&set, &si, &zero) > 0) {
VG_(ksigaddset)(&proc_pending, si.si_signo);
+ siset[si.si_signo] = si;
+ }
/* transfer signals from the process pending set to a particular
@@ -1970,7 +1973,11 @@ void VG_(route_signals)(void)
/* found one - deliver it and be done */
if (target != -1) {
+ ThreadState *tst = &VG_(threads)[target];
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "Routing signal %d to tid %d",
sigNo, tid);
+ tst->sigqueue[tst->sigqueue_head] = siset[sigNo];
+ tst->sigqueue_head = (tst->sigqueue_head + 1) % VG_N_SIGNALQUEUE;
+ vg_assert(tst->sigqueue_head != tst->sigqueue_tail);
VG_(proxy_sendsig)(target, sigNo);
VG_(ksigdelset)(&proc_pending, sigNo);
|
|
From: Tom H. <th...@cy...> - 2004-10-16 10:50:13
|
CVS commit by thughes:
Yet another attempt to quash the assertions in the pthread forwarding code.
It appears that the resolution of the address is to forward to is now
working properly but that on some systems the second part of the assertion
fails because the dynamic linker resolves the name of the function being
forwarded to the glibc version rather than the version in valgrind's pthread
library.
The solution is to use dlopen to explicitly obtain a handle to valgrind's
pthread library and then lookup the symbol with dlsym when doing the
comparison in the assertion.
BUG: 88614
M +7 -1 vg_libpthread.c 1.165
--- valgrind/coregrind/vg_libpthread.c #1.164:1.165
@@ -2253,11 +2253,17 @@ void ** (*__libc_internal_tsd_address)
------------------------------------------------------------------ */
+static void *libpthread_handle;
+
#define FORWARD(name, altname, args...) \
({ \
static name##_t name##_ptr = NULL; \
+ if (libpthread_handle == NULL) { \
+ libpthread_handle = dlopen("libpthread.so.0", RTLD_LAZY); \
+ my_assert(libpthread_handle != NULL); \
+ } \
if (name##_ptr == NULL) { \
if ((name##_ptr = (name##_t)dlsym(RTLD_NEXT, #name)) == NULL) \
name##_ptr = (name##_t)dlsym(RTLD_DEFAULT, #altname); \
- my_assert(name##_ptr != NULL && name##_ptr != name); \
+ my_assert(name##_ptr != NULL && name##_ptr != dlsym(libpthread_handle, #name)); \
} \
name##_ptr(args); \
|
|
From: Tom H. <th...@cy...> - 2004-10-16 10:46:06
|
CVS commit by thughes:
It seems there are some kernels around where the getpid system call has
been changed to return the ID of the thread group leader but which do not
have a gettid system call.
This breaks VG_(gettid) which assumes that the getpid system call will
give the thread ID if the gettid system call does not exist.
The (horrible) solution is to use readlink to see where /proc/self points
when the gettid system call fails.
BUG: 82114
M +21 -2 vg_mylibc.c 1.93
--- valgrind/coregrind/vg_mylibc.c #1.92:1.93
@@ -233,6 +233,25 @@ Int VG_(gettid)(void)
ret = VG_(do_syscall)(__NR_gettid);
- if (ret == -VKI_ENOSYS)
- ret = VG_(do_syscall)(__NR_getpid);
+ if (ret == -VKI_ENOSYS) {
+ Char pid[16];
+
+ /*
+ * The gettid system call does not exist. The obvious assumption
+ * to make at this point would be that we are running on an older
+ * system where the getpid system call actually returns the ID of
+ * the current thread.
+ *
+ * Unfortunately it seems that there are some systems with a kernel
+ * where getpid has been changed to return the ID of the thread group
+ * leader but where the gettid system call has not yet been added.
+ *
+ * So instead of calling getpid here we use readlink to see where
+ * the /proc/self link is pointing...
+ */
+ if ((ret = VG_(do_syscall)(__NR_readlink, "/proc/self", pid, sizeof(pid))) >= 0) {
+ pid[ret] = '\0';
+ ret = VG_(atoll)(pid);
+ }
+ }
return ret;
|
|
From: Tom H. <th...@cy...> - 2004-10-16 03:15:31
|
Nightly build on standard ( Red Hat 7.2 ) started at 2004-10-16 02:00:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow insn_mmxext: valgrind ./insn_mmxext insn_sse: valgrind ./insn_sse int: valgrind ./int map_unmap: valgrind ./map_unmap mq: valgrind ./mq mremap: valgrind ./mremap munmap_exe: valgrind ./munmap_exe pth_blockedsig: valgrind ./pth_blockedsig pushpopseg: valgrind ./pushpopseg rcl_assert: valgrind ./rcl_assert rcrl: valgrind ./rcrl readline1: valgrind ./readline1 resolv: valgrind ./resolv rlimit_nofile: valgrind ./rlimit_nofile seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test Could not read `sha1_test.stderr.exp' make: *** [regtest] Error 2 |
|
From: <js...@ac...> - 2004-10-16 02:56:15
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2004-10-16 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow rlimit_nofile: valgrind ./rlimit_nofile seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 176 tests, 2 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_fcntl (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2004-10-16 02:25:53
|
Nightly build on dunsmere ( Fedora Core 2 ) started at 2004-10-16 03:20:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 181 tests, 8 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/writev (stderr) none/tests/exec-sigmask (stdout) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-10-16 02:19:57
|
Nightly build on audi ( Red Hat 9 ) started at 2004-10-16 03:15:01 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 181 tests, 8 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-10-16 02:13:26
|
Nightly build on ginetta ( Red Hat 8.0 ) started at 2004-10-16 03:10:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow rlimit_nofile: valgrind ./rlimit_nofile seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 181 tests, 2 stderr failures, 0 stdout failures ================= helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-10-16 02:09:42
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2004-10-16 03:05:05 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 181 tests, 7 stderr failures, 1 stdout failure ================= addrcheck/tests/toobig-allocs (stderr) memcheck/tests/badjump (stderr) memcheck/tests/brk (stderr) memcheck/tests/brk2 (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/toobig-allocs (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |