abort() calls from messaging code

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Jun 15 19:25:02 UTC 2017

On Thu, Jun 15, 2017 at 09:03:21AM -0700, Jeremy Allison via samba-technical wrote:
> On Thu, Jun 15, 2017 at 05:50:42PM +0200, Volker Lendecke wrote:
> > On Thu, Jun 15, 2017 at 08:45:30AM -0700, Jeremy Allison wrote:
> > > Arrrgggh. Sorry, this stuff is a black art :-(. Really sorry
> > > I didn't catch this in the 1828011317b review.
> > 
> > That's why we're putting so much effort into tevent_req and hiding
> > threads into a very dark corner. You only want to chase this kind of
> > problem very, very rarely in small pieces of code :-)
> How did you catch it ? Race conditions are a nightmare to
> find and I'm interested in learning :-).

According to susv4 it's undefined behaviour to destroy a locked mutex.
So I tried to find out whether there are ways we could end up in that
situation. Took a bit, but it was mainly staring at code. There's very
few places where we lock/unlock that mutex, and so I finally found


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

More information about the samba-technical mailing list