|
From: <sv...@va...> - 2016-07-30 03:01:59
|
Author: iraisr
Date: Sat Jul 30 04:01:52 2016
New Revision: 15919
Log:
Fix test memcheck/tests/descr_belowsp so as the stack
guard page is visible also on Solaris.
n-i-bz
Modified:
trunk/memcheck/tests/descr_belowsp.c
Modified: trunk/memcheck/tests/descr_belowsp.c
==============================================================================
--- trunk/memcheck/tests/descr_belowsp.c (original)
+++ trunk/memcheck/tests/descr_belowsp.c Sat Jul 30 04:01:52 2016
@@ -163,14 +163,29 @@
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;
}
|