Hi!

I have experinced a bug in smbd making it hang or cause
a backlog crash very similar to the one in this TR.

And I have also located a bug in libnss_ldap that can explain the
behaviour. I also have a work around for it. I think that it may
be the same as in this TR.

I have filed a bug at padl:
  http://bugzilla.padl.com/show_bug.cgi?id=271

In short: The problem is that the file descriptor to the LDAP server
used b libnss_ldap is not closed after fork() in the child processes.
This makes the parent and any childs use the same socket to talk to the
LDAP server, which may mess things up!

The cause is that libnss_ldap fails to register the fork() hook functions
and thus the child process does not close the socket.

In the case of smbd a workaround is is to restart slapd after samba has
started, since that will close the socket in the parent process and any
child will therefore not be able to share the socket.

But a more robost solution than this is needed and the bug #271 excplains
how to recompilöe the debian packet to solve the problem.

This bug affects any code using libnss_ldap directly or inderectly and that
forks.

A side effecy of the bug is the "famus" log entries
  smbd[18358]: nss_ldap: reconnecting to LDAP server...
  smbd[18358]: nss_ldap: reconnected to LDAP server after 1 attempt(s)
that has been around for quite som time now and most seems to think is
natural, but is in fact a side effect of this very bug.

This bug is qute serious since many deamons, like samba may completely
block or crash.

It would be nice to have a libnss_ldap-238-2 in debian/sarge to fix
this issue. All that is needed is to add "LIBS=-lpthread" to the build
rules before invoking configure.

I have tested this soluton this evning and it works just fine,
no smbd locking up, and no more of these log entries at every fork().

Before I located the bug I also wrote a bug on smaba:
  https://bugzilla.samba.org/show_bug.cgi?id=3753

regards Petter



Reply via email to