[PATCH] tevent and threads - infrastructure improvements - version #2

Jeremy Allison jra at samba.org
Mon Sep 14 21:45:28 UTC 2015

On Mon, Sep 14, 2015 at 01:28:28PM -0700, Jeremy Allison wrote:
> On Mon, Sep 14, 2015 at 10:24:37PM +0200, Ralph Böhme wrote:
> > > The reason the mutex must be held until after the signaling
> > > is done is that in the second test code there may be a destructor
> > > waiting to remove the proxy object once the mutex gets released,
> > > and if that happens you get conflicting write errors.
> > 
> > Hm. I don't see a pending desctructor in the second test that would
> > fire before all threads have finished. Which talloc_free is triggering
> > it? I'll give it a closer look tomorrow.
> It's the talloc_free(ev) in the thread_fn_1() in the second
> thread test added.
> > So while I think you're probably right that we may need to lock the
> > proxy object when we're still working on it, I'm wondering if there's
> > something else fishy.
> Yeah, I'm looking closely, but the patch I posted passes
> --tool=helgrind and --tool=drd, when you release the mutex
> before the write you get the problem I described.

Hmmm. This is looking like the error I'm seeing is a helgrind
bug, but I'm looking *really* closely at that.

Check out the no-nptl-pthread-stackcache option...

More information about the samba-technical mailing list