Samba hangs (pthread?)
jpeach at samba.org
Sun Jun 11 07:30:02 GMT 2006
On Fri, 2006-06-09 at 14:34 +0200, Wilco Baan Hofman wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> I have problems at a customer site with a bug that samba hangs every
> one or two days.
> See also bug 3817 at https://bugzilla.samba.org/show_bug.cgi?id=3817.
> Jerry said that this problem is probably caused by libpthread.so.0
> 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 pthread.so.0
> through libldap_r.so.2.
> I've tried reporting this to debian and got the following reply:
> Er, samba has been linked with libldap_r.so.2 for well over a year on
> Debian, and you're the only person to ever claim that this causes
> 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 libpthread.so.0
> 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,
James Peach | jpeach at samba.org
More information about the samba-technical