Discussion:
pthread_getattr_np or pthread_attr_getstack
(too old to reply)
NIIBE Yutaka
2012-11-30 05:10:02 UTC
Permalink
Hello,

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
bdwgc).

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

http://buildd.debian-ports.org/status/fetch.php?pkg=gauche&arch=alpha&ver=0.9.3.3-4&stamp=1354011462

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 DONT_USE_GET_STACKBASE_FOR_MAIN
# 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;
--
--
To UNSUBSCRIBE, email to debian-alpha-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@cfw2.gniibe.org
Michael Cree
2012-11-30 07:50:01 UTC
Permalink
Post by NIIBE Yutaka
Do function pthread_getattr_np or pthread_attr_getstack work well on
alpha? This is my question.
No, there's definitely something not quite right with the pthread stuff
when running an SMP kernel on Alpha. It works fine with a UP kernel
but problems are seen when running the SMP kernel.
Post by NIIBE Yutaka
http://buildd.debian-ports.org/status/fetch.php?pkg=gauche&arch=alpha&ver=0.9.3.3-4&stamp=1354011462
was built on the buildd Imago (which is indeed running an SMP kernel),
though the latest build (0.9.3.3-7) succeeded. Probably a fluke.

I've seen the pthreads problem hit builds of a number of packages; they
always succeed if built while running a UP kernel. I guess I could
put those packages having pthread failures into Imago's do not take
for build list so that they are always built by the buildd Debian-alpha2
which is running a UP kernel.

However, we really should track down the real problem in pthreads...

Cheers
Michael.
--
To UNSUBSCRIBE, email to debian-alpha-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@omega
NIIBE Yutaka
2012-11-30 08:00:01 UTC
Permalink
Thank you for your prompt reply.
Post by Michael Cree
No, there's definitely something not quite right with the pthread stuff
when running an SMP kernel on Alpha. It works fine with a UP kernel
but problems are seen when running the SMP kernel.
I see.
Post by Michael Cree
was built on the buildd Imago (which is indeed running an SMP kernel),
though the latest build (0.9.3.3-7) succeeded. Probably a fluke.
Not a fluke. Since I looked FTBFS, I added a workaround in 0.9.3.3-7.
That's the patch not using pthread_getattr_np and
pthread_attr_getstack.
--
--
To UNSUBSCRIBE, email to debian-alpha-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@cfw2.gniibe.org
Michael Cree
2012-11-30 08:20:01 UTC
Permalink
Post by NIIBE Yutaka
Thank you for your prompt reply.
Post by Michael Cree
No, there's definitely something not quite right with the pthread stuff
when running an SMP kernel on Alpha. It works fine with a UP kernel
but problems are seen when running the SMP kernel.
I see.
Post by Michael Cree
was built on the buildd Imago (which is indeed running an SMP kernel),
though the latest build (0.9.3.3-7) succeeded. Probably a fluke.
Not a fluke. Since I looked FTBFS, I added a workaround in 0.9.3.3-7.
That's the patch not using pthread_getattr_np and
pthread_attr_getstack.
Ah, I see I should've read a bit further down your original message ;-)

I could give building 0.9.3.3-4 a go on a system with a UP kernel to
verify that it is the usual pthread on SMP system problem. If that
works you are welcome to remove the Alpha specific patch and I will
add gauche to the "do not build on Imago" list.

Cheers
Michael.
--
To UNSUBSCRIBE, email to debian-alpha-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@omega
Michael Cree
2012-11-30 09:30:02 UTC
Permalink
Post by Michael Cree
I could give building 0.9.3.3-4 a go on a system with a UP kernel to
verify that it is the usual pthread on SMP system problem. If that
works you are welcome to remove the Alpha specific patch and I will
add gauche to the "do not build on Imago" list.
No, 0.9.3.3-4 FTBFS also under a UP kernel. (It's not the same pthreads
issue seen with SMP kernels.) The build leaves behind a defunct process
named 'gosh' so dpkg-buildpackage is not terminating properly just like
what is seen in the buildd log.

I'd keep the Alpha patch in gauche for the time being, thanks.

Cheers
Michael.
--
To UNSUBSCRIBE, email to debian-alpha-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@omega
NIIBE Yutaka
2012-12-03 05:00:01 UTC
Permalink
Post by Michael Cree
No, 0.9.3.3-4 FTBFS also under a UP kernel. (It's not the same pthreads
issue seen with SMP kernels.) The build leaves behind a defunct process
named 'gosh' so dpkg-buildpackage is not terminating properly just like
what is seen in the buildd log.
I'd keep the Alpha patch in gauche for the time being, thanks.
Thank you for your time.

OK, I keep the patch for Gauche.

I will inform Debian's libgc maintainer for the patch when it will be
upgraded to 7.2.

When I will not find anything for Alpha (libc or kernel, I don't
know), I will eventually send it to libgc upstram.
--
--
To UNSUBSCRIBE, email to debian-alpha-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@cfw2.gniibe.org
Loading...