[PATCH] Fix a pthreadpool race

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Dec 12 13:40:39 UTC 2017


On Tue, Dec 12, 2017 at 02:37:02PM +0100, Volker Lendecke wrote:
> On Tue, Dec 12, 2017 at 01:40:29PM +0100, Volker Lendecke wrote:
> > On Tue, Dec 12, 2017 at 06:57:22AM +1300, Gary Lockyer wrote:
> > > Stack trace with symbols attached.
> > 
> > Thanks. This is pretty easy to reproduce in the new cmocka test by
> > Christof Schmitt. Just run
> > 
> > while : ; do valgrind --tool=helgrind --num-callers=50 bin/pthreadpooltest_cmocka; done
> > 
> > and wait a few seconds. I'm getting
> 
> Just got
> 
> failure: test_create [
> No entries for symbol __wrap_pthread_create.
> ../lib/pthreadpool/tests_cmocka.c:75: error: Could not get value to mock function __wrap_pthread_create
> ../lib/pthreadpool/tests_cmocka.c:150: note: Previously returned mock value was declared here
> ]
> 
> in one of a few hundred runs. Andreas, can you imagine what that might
> be?

Hmmmm. cmocka.c does setjmp/longjmp. This *might* be an explanation
how we leave pthreadpool_add_job with a mutex locked. I think I need
to fully understand cmocka.c now, now that the Samba Team has decided
that we are fully responsible for that as well :-(

Volker

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