Samba hangs (pthread?)

Jeremy Allison jra at samba.org
Sun Jun 11 18:25:59 GMT 2006


On Sun, Jun 11, 2006 at 06:25:30PM +0200, Rainer Weikusat wrote:
> 
> 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.

Thanks for that - I've wondered for a while. We had the same
issue ensuring we can send tdb-based messages (signal-notified)
between smbd processes in Samba.

What kernel API should we use to ensure we can allow signals 
between threads in the same address space ? It's ok if it's
Linux-specific, we can add a configure test for it.

Jeremy.


More information about the samba-technical mailing list