[PATCHES][BUG 13170] Fix crash in pthreadpool thread after failure from pthread_create

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Dec 6 10:32:56 UTC 2017


On Wed, Dec 06, 2017 at 08:01:14AM +0100, Andreas Schneider wrote:
> > Thanks for the pointer. Mocking the function completely does not work,
> > as the good path requires creating an actual thread, but the --wrap
> > option to override the call to pthread_create in the linker is useful.
> 
> Yes, that's what mocking is for. The test instruments how the mocked function 
> behaves. So the test can tell the mocked function to call pthread_create() or 
> return an error.

Obviously this is the perfect candidate for cmocka. A small
independent piece of code that needs testing. Yes, I've seen your talk
in Göttingen about cmocka, but still it would be great to get your
support how to use cmocka in this case, now that I have a piece of
code that is contained enough and that needs this. Can you walk us
through adding cmocka here to make pthread_create fail
deterministically?

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