Samba hangs (pthread?)

Rainer Weikusat rainer.weikusat at sncag.com
Sun Jun 11 16:25:30 GMT 2006


James Peach <jpeach at samba.org> writes:

[...]

>> 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,

For LinuxThreads (ie not NPTL) it decidedly should (and will), because
Samba changes its uid on oaccasion, which may result in some threads
running with uid 0 and some other threads with a non-priviledged one,
which in turn can cause the pthread sleep/ wakeup-mechanism, which
relies on the ability of a thread to send a signal to any other thread
within the same process, to fail (the signal isn't delivered to the
target thread due to EPERM and the sending thread "hangs", waiting for
some action to be taken because of the signal).

NPTL appears[*] to use signals for something, too, so it may be
affected by the same issue, considering that setuid is still not per
process.

	[*] the code is mostly incomprehensible, due to unbounded
	over-abstraction 

NB: This is just an issue I happen to know of. There is an easy
kernel-level workaround for that: allow signals among threads running
in the same address space.


More information about the samba-technical mailing list