# Openldap error: could not locate usable POSIX Threads

## kdillen

Hello All,

I have a rather big problem.   When I try to upgrade openldap to the latest version, I get this error message :  

error: could not locate usable POSIX Threads

I tried and looked already but as far as I can see I don't find any problem.  My system is running stable, no other progs had problems with it during the configure phase.

I am running on the Gentoo-dev-sources-2.6.7-r11 with  NTPL activated.  

So please if there is somebody who can help or needs more information.

Thanks in advance

----------

## moocha

Re-emerge glibc.

----------

## kdillen

Sorry I forget to mention it, I already re-emerged glibc

And to continue this problem.   Now the new perl version also refuses to compile.

----------

## moocha

This is weird... Removing the "threads" USE flag also doesn't help when compiling perl at least?

----------

## kdillen

I don't use threads in my USE-flags, and when I do a emerge -pv perl it shows -threads.     So I think that is safe enough.  

It is really strange 

Maybe I will do a new installation of gentoo on that system.

----------

## Henry78

same problem here: openldap-2.1.30-r2 wont configure. configure: error: could not locat usabe POSIX Threads.

does anybody know a solution yet?

----------

## Henry78

i think i found the error, but still have no soulution.

my situation: a fresh install of gentoo, bootstrapped from stage1. now i want to emerge gnome, and openldap-2.1.30-r2, as a dependency, failes due to a kernel (?) oops:

~~~snip~~~

checking for pthread link with -lpthread -lmach -lexc... no

checking for pthread link with -lpthread -Wl,woff,85... no

checking for phtread link with -lpthread...<1>Unable to handle kernel paging request at virtual address 0001695c

 printing eip:

c011e256

*pde=00000000

Ooops: 0002 [#58]

~~~snap~~~

afterwards, the openldap configure quits with the error stated above: "could not locate usable POSIX Threads"

btw: the perlthread-patch gets applied, and responses OK

thaks for all hints, really want to get gnome up on this boxLast edited by Henry78 on Wed Oct 27, 2004 11:11 am; edited 1 time in total

----------

## Henry78

oh: i already re-emerged glib, gcc, the Berkeley DB (db4) and perl (see the hint above) with and without the 'threads' USE-flag.

problem still exists

----------

## tgurr

Same problem here with openldap-2.1.30-r4, 

Any solution to this yet or should I fill a bug report? 

MfG. Psy

----------

## alwyn

Fixed it in my case.

There were two versions of glibc installed due to the older version having a messed up SLOT.

Remove the old version, re-emerge the new one and viola things compile.

----------

## KoH

I've got this problem too, I've re-emerged glibc several times, with and without nptl and nptlonly. Openldap refuses to configure properly. My /lib/libc.so.6 states:

```
GNU C Library stable release version 2.5, by Roland McGrath et al.

Copyright (C) 2006 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

Compiled by GNU CC version 4.1.2 20070214 (  (gdc 0.23, using dmd 1.007)) (Gentoo 4.1.2).

Compiled on a Linux >>2.6.21-gentoo-r3<< system on 2007-07-09.

Available extensions:

   C stubs add-on version 2.1.2

   crypt add-on version 2.1 by Michael Glad and others

   Gentoo patchset 1.8

   GNU Libidn by Simon Josefsson

   GNU libio by Per Bothner

   NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk

   Native POSIX Threads Library by Ulrich Drepper et al

   Support for some architectures added on, not maintained in glibc core.

   BIND-8.2.3-T5B

Thread-local storage support included.
```

Everything should be fine, but it isn't. mksquashfs also complains "FATAL ERROR:Failed to create thread" and some other programs (like MySQL which refuses to start: "InnoDB: Error: pthread_create returned 12") as well. I really have no idea why this happened, I believe the update of glibc from 2.5-r3 to -r4 caused this problem (as it didn't exist before) on my main machine. On a ThinkPad however - nearly the same software, same Gentoo - the glibc-update ran smoothly, openldap and other software compiles without problems.

I'd be happy for any suggestions where to search or what to do.

Regards

----------

## KoH

I finally found the cause for pthread_create returning 12 which also prevented the other programs mentioned below from working properly.

The stack size was set to a very high value in my ~/.bashrc (I can't remember why or how the 'ulimit -s 1024576'-line could appear there). After removing this line, everything worked fine, without recompiling or further tuning anywhere...

----------

