|
From: Jeremy F. <je...@go...> - 2005-01-15 03:26:31
|
CVS commit by fitzhardinge:
Warn if a program appears to be using the now-obsolete Valgrind
libpthread.
M +11 -44 core.h 1.56
M +47 -0 vg_scheduler.c 1.203
--- valgrind/coregrind/vg_scheduler.c #1.202:1.203
@@ -1056,4 +1056,51 @@ void do_client_request ( ThreadId tid )
break;
+ /* Obsolete requests: print a warning in case there's an old
+ libpthread.so still hanging around. */
+ case VG_USERREQ__APPLY_IN_NEW_THREAD:
+ case VG_USERREQ__QUIT:
+ case VG_USERREQ__WAIT_JOINER:
+ case VG_USERREQ__PTHREAD_JOIN:
+ case VG_USERREQ__SET_CANCELSTATE:
+ case VG_USERREQ__SET_CANCELTYPE:
+ case VG_USERREQ__TESTCANCEL:
+ case VG_USERREQ__SET_CANCELPEND:
+ case VG_USERREQ__SET_OR_GET_DETACH:
+ case VG_USERREQ__PTHREAD_GET_THREADID:
+ case VG_USERREQ__PTHREAD_MUTEX_LOCK:
+ case VG_USERREQ__PTHREAD_MUTEX_TIMEDLOCK:
+ case VG_USERREQ__PTHREAD_MUTEX_TRYLOCK:
+ case VG_USERREQ__PTHREAD_MUTEX_UNLOCK:
+ case VG_USERREQ__PTHREAD_COND_WAIT:
+ case VG_USERREQ__PTHREAD_COND_TIMEDWAIT:
+ case VG_USERREQ__PTHREAD_COND_SIGNAL:
+ case VG_USERREQ__PTHREAD_COND_BROADCAST:
+ case VG_USERREQ__PTHREAD_KEY_CREATE:
+ case VG_USERREQ__PTHREAD_KEY_DELETE:
+ case VG_USERREQ__PTHREAD_SETSPECIFIC_PTR:
+ case VG_USERREQ__PTHREAD_GETSPECIFIC_PTR:
+ case VG_USERREQ__PTHREAD_SIGMASK:
+ case VG_USERREQ__SIGWAIT:
+ case VG_USERREQ__PTHREAD_KILL:
+ case VG_USERREQ__PTHREAD_YIELD:
+ case VG_USERREQ__PTHREAD_KEY_VALIDATE:
+ case VG_USERREQ__CLEANUP_PUSH:
+ case VG_USERREQ__CLEANUP_POP:
+ case VG_USERREQ__GET_KEY_D_AND_S:
+ case VG_USERREQ__NUKE_OTHER_THREADS:
+ case VG_USERREQ__GET_N_SIGS_RETURNED:
+ case VG_USERREQ__SET_FHSTACK_USED:
+ case VG_USERREQ__GET_FHSTACK_USED:
+ case VG_USERREQ__SET_FHSTACK_ENTRY:
+ case VG_USERREQ__GET_FHSTACK_ENTRY:
+ case VG_USERREQ__GET_SIGRT_MIN:
+ case VG_USERREQ__GET_SIGRT_MAX:
+ case VG_USERREQ__ALLOC_RTSIG:
+ VG_(message)(Vg_UserMsg, "It looks like you've got an old libpthread.so* ");
+ VG_(message)(Vg_UserMsg, "installed in \"%s\".", VG_(libdir));
+ VG_(message)(Vg_UserMsg, "Please delete it and try again.");
+ VG_(exit)(99);
+ break;
+
default:
if (VGA_(client_request)(tid, arg)) {
--- valgrind/coregrind/core.h #1.55:1.56
@@ -458,35 +458,14 @@ extern Bool VG_(is_empty_arena) ( Arena
#define VG_USERREQ__FREE 0x2002
-/* (Fn, Arg): Create a new thread and run Fn applied to Arg in it. Fn
- MUST NOT return -- ever. Eventually it will do either __QUIT or
- __WAIT_JOINER. */
+/* Obsolete pthread-related requests */
#define VG_USERREQ__APPLY_IN_NEW_THREAD 0x3001
-
-/* ( no-args ): calling thread disappears from the system forever.
- Reclaim resources. */
#define VG_USERREQ__QUIT 0x3002
-
-/* ( void* ): calling thread waits for joiner and returns the void* to
- it. */
#define VG_USERREQ__WAIT_JOINER 0x3003
-
-/* ( ThreadId, void** ): wait to join a thread. */
#define VG_USERREQ__PTHREAD_JOIN 0x3004
-
-/* Set cancellation state and type for this thread. */
#define VG_USERREQ__SET_CANCELSTATE 0x3005
#define VG_USERREQ__SET_CANCELTYPE 0x3006
-
-/* ( no-args ): Test if we are at a cancellation point. */
#define VG_USERREQ__TESTCANCEL 0x3007
-
-/* ( ThreadId, &thread_exit_wrapper is the only allowable arg ): call
- with this arg to indicate that a cancel is now pending for the
- specified thread. */
#define VG_USERREQ__SET_CANCELPEND 0x3008
-
-/* Set/get detach state for this thread. */
#define VG_USERREQ__SET_OR_GET_DETACH 0x3009
-
#define VG_USERREQ__PTHREAD_GET_THREADID 0x300A
#define VG_USERREQ__PTHREAD_MUTEX_LOCK 0x300B
@@ -502,7 +481,6 @@ extern Bool VG_(is_empty_arena) ( Arena
#define VG_USERREQ__PTHREAD_SETSPECIFIC_PTR 0x3015
#define VG_USERREQ__PTHREAD_GETSPECIFIC_PTR 0x3016
-#define VG_USERREQ__READ_MILLISECOND_TIMER 0x3017
#define VG_USERREQ__PTHREAD_SIGMASK 0x3018
-#define VG_USERREQ__SIGWAIT 0x3019 /* unused */
+#define VG_USERREQ__SIGWAIT 0x3019
#define VG_USERREQ__PTHREAD_KILL 0x301A
#define VG_USERREQ__PTHREAD_YIELD 0x301B
@@ -512,35 +489,21 @@ extern Bool VG_(is_empty_arena) ( Arena
#define VG_USERREQ__CLEANUP_POP 0x3021
#define VG_USERREQ__GET_KEY_D_AND_S 0x3022
-
#define VG_USERREQ__NUKE_OTHER_THREADS 0x3023
-
-/* Ask how many signal handler returns have happened to this
- thread. */
-#define VG_USERREQ__GET_N_SIGS_RETURNED 0x3024 /* unused */
-
-/* Get/set entries for a thread's pthread_atfork stack. */
+#define VG_USERREQ__GET_N_SIGS_RETURNED 0x3024
#define VG_USERREQ__SET_FHSTACK_USED 0x3025
#define VG_USERREQ__GET_FHSTACK_USED 0x3026
#define VG_USERREQ__SET_FHSTACK_ENTRY 0x3027
#define VG_USERREQ__GET_FHSTACK_ENTRY 0x3028
-
-/* Denote the finish of __libc_freeres_wrapper(). */
-#define VG_USERREQ__LIBC_FREERES_DONE 0x3029
-
-/* Allocate RT signals */
#define VG_USERREQ__GET_SIGRT_MIN 0x302B
#define VG_USERREQ__GET_SIGRT_MAX 0x302C
#define VG_USERREQ__ALLOC_RTSIG 0x302D
-
-/* Hook for replace_malloc.o to get malloc functions */
#define VG_USERREQ__GET_MALLOCFUNCS 0x3030
-
-/* Get stack information for a thread. */
#define VG_USERREQ__GET_STACK_INFO 0x3033
-
-/* Cosmetic ... */
#define VG_USERREQ__GET_PTHREAD_TRACE_LEVEL 0x3101
-/* Log a pthread error from client-space. Cosmetic. */
#define VG_USERREQ__PTHREAD_ERROR 0x3102
+
+
+#define VG_USERREQ__READ_MILLISECOND_TIMER 0x3017
+
/* Internal equivalent of VALGRIND_PRINTF . */
#define VG_USERREQ__INTERNAL_PRINTF 0x3103
@@ -548,4 +511,8 @@ extern Bool VG_(is_empty_arena) ( Arena
#define VG_USERREQ__INTERNAL_PRINTF_BACKTRACE 0x3104
+/* Denote the finish of __libc_freeres_wrapper().
+ A synonym for exit. */
+#define VG_USERREQ__LIBC_FREERES_DONE 0x3029
+
/*
In core_asm.h:
|