From: Ivo Raisr Date: Sat, 30 Jul 2016 03:01:52 +0000 (+0000) Subject: Fix test memcheck/tests/descr_belowsp so as the stack X-Git-Tag: svn/VALGRIND_3_12_0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2935e69718c4a40ce7a34572995ec6e27d45fe99;p=thirdparty%2Fvalgrind.git Fix test memcheck/tests/descr_belowsp so as the stack guard page is visible also on Solaris. n-i-bz git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15919 --- diff --git a/memcheck/tests/descr_belowsp.c b/memcheck/tests/descr_belowsp.c index 113d272dc9..4b429d36ae 100644 --- a/memcheck/tests/descr_belowsp.c +++ b/memcheck/tests/descr_belowsp.c @@ -163,14 +163,29 @@ int main(int argc, const char** argv) grow_the_stack(); bad_things_below_sp(); - - r = pthread_create(&children, NULL, child_fn_0, NULL); + + pthread_attr_t attrs; + r = pthread_attr_init(&attrs); + assert(!r); + +# if defined(VGO_solaris) + /* Solaris needs to configure at least two page sizes to have + a visible stack guard page. One page size is deducted for + an implicit mmap red zone. */ + r = pthread_attr_setguardsize(&attrs, 2 * guess_pagesize()); assert(!r); +# endif /* VGO_solaris */ + r = pthread_create(&children, &attrs, child_fn_0, NULL); + assert(!r); + + r = pthread_attr_destroy(&attrs); + assert(!r); + r = pthread_join(children, NULL); assert(!r); - - + + return 0; }