Re: feature tests for pthreads implementation and configuration?
- From: mikpe@xxxxxxxxxxxxxxx (Mikael Pettersson)
- Date: 26 Mar 2006 19:50:44 +0200
In article <1143145375.368361.103690@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<loic-dev@xxxxxxx> wrote:
Hi Mikael,
Is there a way to query Linux' pthreads about:
1. is it LinuxThreads or NPTL?
2. if LinuxThreads, for which kernel version was it configured?
Yes. Pls look at:
http://kasperd.net/~kasperd/comp.os.linux.development.faq#nptl
Thanks for this pointer.
Our problem is that a multi-threaded application we're developing
(a complex programming language implementation) is malfunctioning
when compiled against FC3's pthreads on x86 or amd64 (which seem
to be LinuxThreads configured for really old Linux kernels) while
it works fine when compiled against FC4's NPTL pthreads. (It also
works fine on Solaris9/x86.)
AFAIK, FC3 uses NPTL by default. There's perhaps a bug in that
particular NPTL version.
Actually I failed to consider that I ran FC3 with kernel 2.6.16 and
FC4 with an earlier RH 2.6 kernel. It turns out that the issue
comes from the 2.6.16 kernel, not FC3-vs-FC4 pthreads. (And I did
get NPTL with FC3; I looked at the wrong place and found the fallback
LinuxThreads code instead of the NPTL code it actually used.)
The issue is that kernel 2.6.16 clears a new thread's sigaltstack
settings (as per SUSv3) while previous kernels and apparently also
Solaris 9/x86 preserved it. That caused SIGFPEs in our threads to
be delivered on the current stack (a big no-no in our runtime system)
instead of the alt stack, causing memory corruption and SIGSEGVs.
The simple solution was to have each thread allocate and install
its own alt stack before starting running application code.
--
Mikael Pettersson (mikpe@xxxxxxxxx)
Computing Science Department, Uppsala University
.
- Follow-Ups:
- References:
- feature tests for pthreads implementation and configuration?
- From: Mikael Pettersson
- Re: feature tests for pthreads implementation and configuration?
- From: loic-dev
- feature tests for pthreads implementation and configuration?
- Prev by Date: Re: Serial interrupt
- Next by Date: GNU Make implicit rules
- Previous by thread: Re: feature tests for pthreads implementation and configuration?
- Next by thread: Re: feature tests for pthreads implementation and configuration?
- Index(es):
Relevant Pages
|