summaryrefslogtreecommitdiffstats
path: root/boehm-gc/pthread_support.c
diff options
context:
space:
mode:
Diffstat (limited to 'boehm-gc/pthread_support.c')
-rw-r--r--boehm-gc/pthread_support.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/boehm-gc/pthread_support.c b/boehm-gc/pthread_support.c
index bbda8522c03..f0a58c886a3 100644
--- a/boehm-gc/pthread_support.c
+++ b/boehm-gc/pthread_support.c
@@ -1135,7 +1135,13 @@ GC_PTR GC_get_thread_stack_base()
size_t stack_size;
my_pthread = pthread_self();
- pthread_getattr_np (my_pthread, &attr);
+ if (pthread_getattr_np (my_pthread, &attr) != 0)
+ {
+# ifdef DEBUG_THREADS
+ GC_printf1("Can not determine stack base for attached thread");
+# endif
+ return 0;
+ }
pthread_attr_getstack (&attr, (void **) &stack_addr, &stack_size);
pthread_attr_destroy (&attr);
OpenPOWER on IntegriCloud