[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

pthread_getattr_np or pthread_attr_getstack


I'm not on this list, please add me to Cc: in the follow up.

Do function pthread_getattr_np or pthread_attr_getstack work well on
alpha?  This is my question.

Well, let me explain my issue.

I am a maintainer of gauche package (a lisp interpreter which use

Upgraded to bdwgc to 7.2d, gauche had FTBFS on alpha.  See the log:


I think that the cause of this problem is the one of message (by bdwgc):

   GC Warning: pthread_getattr_np or pthread_attr_getstack failed for main thread

It seems that pthread_getattr_np or pthread_attr_getstack failed on
alpha.  It only occurs on alpha, I don't see same/similar issue on
any architectures.

For gauche build, I added the following patch, so that another
implementation (of LINUX_STACKBOTTOM) will be used to detect stack
bottom (not using pthread_getattr_np and pthread_attr_getstack).

Then, it builds successfully, now. 

--- a/gc/include/private/gcconfig.h
+++ b/gc/include/private/gcconfig.h
@@ -1724,6 +1724,7 @@
 #   endif
 #   ifdef LINUX
 #       define OS_TYPE "LINUX"
 #       define LINUX_STACKBOTTOM
 #       ifdef __ELF__
 #         define SEARCH_FOR_DATA_START
--- a/gc/os_dep.c
+++ b/gc/os_dep.c
@@ -1158,7 +1158,7 @@
     ptr_t result; /* also used as "dummy" to get the approx. sp value */
 #   if defined(LINUX) && !defined(NACL) \
        && (defined(USE_GET_STACKBASE_FOR_MAIN) \
-           || (defined(THREADS) && !defined(REDIRECT_MALLOC)))
+	   || (defined(THREADS) && !defined(REDIRECT_MALLOC) && !defined(DONT_USE_GET_STACKBASE_FOR_MAIN)))
       pthread_attr_t attr;
       void *stackaddr;
       size_t size;

Reply to: