[PATCH] Fix a pthreadpool race

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Dec 12 21:10:06 UTC 2017


On Tue, Dec 12, 2017 at 01:02:46PM -0700, Christof Schmitt wrote:
> The assumption here is that no call to pthread_create is done and hence no call
> to will_return is required. What likely happened is that the worker thread
> exited, then test_create_do triggered the creation of a new pthread, which in
> turn caused a call to mock_type. As there is no entry in the global list,
> cmocka tried to abort through a jump while still holding the mutex.

Worker threads only exit after one second of idle time. I can
reproduce the issue within a minute if running the cmocka test in a
tight loop, and eventually it will block. But my system is completely
idle otherwise, so it's extremely unlikely that one second passed
between two test steps.

> Since this now appears to be a problem in some test environments, i would
> suggest to simply remove the last part of the test (the call to test_create_do
> without a previous will_return).

I have it on a stock debian stretch, 64-bit. Admittedly in a virtual
environment, but a very fast one.

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