Bug 7844 - winbind has a race condition with crashed children
winbind has a race condition with crashed children
Product: Samba 3.5
Classification: Unclassified
Component: Winbind
Other All
: P3 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2010-12-06 13:49 UTC by Volker Lendecke
Modified: 2011-09-22 19:53 UTC (History)
0 users

See Also:

Patch for 3.5 (2.20 KB, patch)
2010-12-06 13:51 UTC, Volker Lendecke
jra: review+
Fix for master and v3-6-test. (2.21 KB, patch)
2010-12-06 14:51 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Lendecke 2010-12-06 13:49:56 UTC
Patch with explanation to follow
Comment 1 Volker Lendecke 2010-12-06 13:51:30 UTC
Created attachment 6119 [details]
Patch for 3.5

If a child dies, the parent process right away closes the socket.
This is wrong, with tevent we still have events pending. This works
fine for epoll but does not for at least the FreeBSD select variant.
Tevent sticks a closed socket into the select masks. This then
returns an error EBADF. When this happens, the parent winbind dies
instead of forking a new child.

This moves the socket close from the SIGCHLD cleanup function to
the socket receiver. I could not reproduce the parent death anymore
and it did not create an obvious fd leak.
Comment 2 Jeremy Allison 2010-12-06 14:51:13 UTC
Created attachment 6120 [details]
Fix for master and v3-6-test.
Comment 3 Volker Lendecke 2010-12-06 15:13:04 UTC
Comment on attachment 6120 [details]
Fix for master and v3-6-test.

Tested 3.6 with that patch. Could not drive it into the lockup anymore that was easily reproducable without this patch.

Comment 4 Volker Lendecke 2011-03-05 14:19:34 UTC
Jeremy, can you give the 3.5 patch another consideration? This needs a formal review to get into 3.5.


Comment 5 Volker Lendecke 2011-09-19 03:37:06 UTC
Ok, probably this is not worth it for 3.5.
Comment 6 Jeremy Allison 2011-09-19 23:52:25 UTC
Yes, it's worth it for 3.5.x. winbindd reliability is a significant issue - always !

I've reviewed and will + it for 3.5.x.

Comment 7 Jeremy Allison 2011-09-19 23:52:41 UTC
Comment on attachment 6119 [details]
Patch for 3.5

LGTM for 3.5.x.
Comment 8 Jeremy Allison 2011-09-19 23:53:06 UTC
Re-assigning to Karolin for inclusion in 3.5.next.
Comment 9 Karolin Seeger 2011-09-22 19:53:00 UTC
Pushed to v3-5-test.
Closing out bug report.