From: Julian Seward Date: Tue, 4 Jun 2002 20:59:16 +0000 (+0000) Subject: - report the size requested size in pthread_attr_setstacksize() when X-Git-Tag: svn/VALGRIND_1_0_3~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91ccd289f441234fff8775874716318f797cd6f6;p=thirdparty%2Fvalgrind.git - report the size requested size in pthread_attr_setstacksize() when the size is bigger then the hardcoded value in valgrind. This makes it easier to find out which value to use for VG_PTHREAD_STACK_SIZE. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@378 --- diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index 3ed46c033e..c2b0f68e61 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -249,14 +249,17 @@ int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) { size_t limit; + char buf[1024]; ensure_valgrind("pthread_attr_setstacksize"); limit = VG_PTHREAD_STACK_SIZE - VG_AR_CLIENT_STACKBASE_REDZONE_SZB - 1000; /* paranoia */ if (__stacksize < limit) return 0; - barf("pthread_attr_setstacksize: " - "requested size >= VG_PTHREAD_STACK_SIZE\n " - "edit vg_include.h and rebuild."); + snprintf(buf, sizeof(buf), "pthread_attr_setstacksize: " + "requested size %d >= VG_PTHREAD_STACK_SIZE\n " + "edit vg_include.h and rebuild.", __stacksize); + buf[sizeof(buf)-1] = '\0'; /* Make sure it is zero terminated */ + barf(buf); } diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index 3ed46c033e..c2b0f68e61 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -249,14 +249,17 @@ int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) { size_t limit; + char buf[1024]; ensure_valgrind("pthread_attr_setstacksize"); limit = VG_PTHREAD_STACK_SIZE - VG_AR_CLIENT_STACKBASE_REDZONE_SZB - 1000; /* paranoia */ if (__stacksize < limit) return 0; - barf("pthread_attr_setstacksize: " - "requested size >= VG_PTHREAD_STACK_SIZE\n " - "edit vg_include.h and rebuild."); + snprintf(buf, sizeof(buf), "pthread_attr_setstacksize: " + "requested size %d >= VG_PTHREAD_STACK_SIZE\n " + "edit vg_include.h and rebuild.", __stacksize); + buf[sizeof(buf)-1] = '\0'; /* Make sure it is zero terminated */ + barf(buf); } diff --git a/vg_libpthread.c b/vg_libpthread.c index 3ed46c033e..c2b0f68e61 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -249,14 +249,17 @@ int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) { size_t limit; + char buf[1024]; ensure_valgrind("pthread_attr_setstacksize"); limit = VG_PTHREAD_STACK_SIZE - VG_AR_CLIENT_STACKBASE_REDZONE_SZB - 1000; /* paranoia */ if (__stacksize < limit) return 0; - barf("pthread_attr_setstacksize: " - "requested size >= VG_PTHREAD_STACK_SIZE\n " - "edit vg_include.h and rebuild."); + snprintf(buf, sizeof(buf), "pthread_attr_setstacksize: " + "requested size %d >= VG_PTHREAD_STACK_SIZE\n " + "edit vg_include.h and rebuild.", __stacksize); + buf[sizeof(buf)-1] = '\0'; /* Make sure it is zero terminated */ + barf(buf); }