Warn if a program appears to be using the now-obsolete Valgrind libpthread. coregrind/core.h | 55 +++++++++-------------------------------------- coregrind/vg_scheduler.c | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 44 deletions(-) diff -puN coregrind/vg_scheduler.c~libpthread-warning coregrind/vg_scheduler.c --- valgrind/coregrind/vg_scheduler.c~libpthread-warning 2005-01-10 16:40:47.000000000 -0800 +++ valgrind-jeremy/coregrind/vg_scheduler.c 2005-01-11 10:13:19.000000000 -0800 @@ -1055,6 +1055,53 @@ void do_client_request ( ThreadId tid ) SET_CLREQ_RETVAL( tid, VG_(get_n_errs_found)() ); 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)) { /* architecture handled the client request */ diff -puN coregrind/core.h~libpthread-warning coregrind/core.h --- valgrind/coregrind/core.h~libpthread-warning 2005-01-10 16:40:47.000000000 -0800 +++ valgrind-jeremy/coregrind/core.h 2005-01-11 10:13:13.000000000 -0800 @@ -457,37 +457,16 @@ extern Bool VG_(is_empty_arena) ( Arena #define VG_USERREQ__MALLOC 0x2001 #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 #define VG_USERREQ__PTHREAD_MUTEX_TIMEDLOCK 0x300C @@ -501,52 +480,40 @@ extern Bool VG_(is_empty_arena) ( Arena #define VG_USERREQ__PTHREAD_KEY_DELETE 0x3014 #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 #define VG_USERREQ__PTHREAD_KEY_VALIDATE 0x301C - #define VG_USERREQ__CLEANUP_PUSH 0x3020 #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 /* Internal equivalent of VALGRIND_PRINTF_BACKTRACE . */ #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: #define VG_USERREQ__SIGNAL_RETURNS 0x4001 _