Samba hangs (pthread?)

James Peach jpeach at
Sun Jun 11 07:30:02 GMT 2006

On Fri, 2006-06-09 at 14:34 +0200, Wilco Baan Hofman wrote:
> Hash: SHA1
> Hi,
> I have problems at a customer site with a bug that samba hangs every
> one or two days.
> See also bug 3817 at
> Jerry said that this problem is probably caused by
> which is linked into smbd.

I'll go out on a limb and suggest that Jerry was referring to the
__fsetlocking call, which is a internal libc locking primitive which one
could reasonably expect to exhibit different behaviour under pthreads.

> This is default behaviour for debian, because it links to
> through
> I've tried reporting this to debian and got the following reply:
> Er, samba has been linked with for well over a year on
> Debian, and you're the only person to ever claim that this causes
> problems.
> Whether or not libldap_r is linked against libpthread really should
> make no
> difference, when samba itself is not multithreaded and therefore there are
> no threads being spawned.  Anyway, the backtrace in the bug report shows a
> hang in pthread *after glibc has aborted with an error in free()*; any
> problem with libpthread deadlocking is definitely secondary to this.
> Steve Langasek also said that using a non-threaded version of the ldap
> client library result into more problems.
> Details can be found at:
> Now I have a question: Does it hurt samba to have
> linked into it?

The problem is, no-one really knows. Linking with pthread causes certain
libc internals to change in behaviour. There has been one such case on
the list recently that involved sigaction. Now, linking with pthreads
*shouldn't* cause a problem, but Samba isn't thoroughly tested with
pthreads, and different versions of pthreads+libc have different bugs,
so YMMV.

James Peach | jpeach at

More information about the samba-technical mailing list