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

Andreas Schneider asn at samba.org
Thu Dec 7 07:08:09 UTC 2017


On Wednesday, 6 December 2017 23:15:21 CET Christof Schmitt wrote:
> On Wed, Dec 06, 2017 at 09:47:10PM +0100, Andreas Schneider wrote:
> > On Wednesday, 6 December 2017 21:42:54 CET Christof Schmitt wrote:
> > > On Wed, Dec 06, 2017 at 09:38:02PM +0100, Andreas Schneider wrote:
> > > > > If we decide to go with cmocka anyway, the best approach would be to
> > > > > put
> > > > > the new test in a new file and implement it completely with cmocka.
> > > > > Existing tests could then be converted later.
> > > > 
> > > > I thought that we would go that way for master. Just write that one
> > > > test
> > > > using cmocka. We could do the backport without the test for Samba 4.6,
> > > > Samba 4.7 includes cmocka in third_party.
> > > 
> > > Ok, let me work on this approach then.
> 
> See attached patches.
> 
> > > > If we want to use cmocka for every test we need to provide a way for
> > > > mutexes without linking cmocka to a threading library. cmocka only
> > > > requires libc and it should stay that way. However we could create it
> > > > in
> > > > such a way that you can set functions for locking which called at the
> > > > right positions in cmocka.
> > > 
> > > I am not sure what you mean here. pthreadpool uses mutexes and threads
> > > internally and links against pthreads. Is that a problem for cmocka?
> > 
> > Normally not. But in case there is an issue we have:
> > 
> > CMOCKA_TEST_ABORT=1 ./mytest
> > 
> > 
> > For debugging.
> 
> Thank you. I have not seen a problem so far.

The test looks fine but I think we need a configure check at a prominent place 
to see if the linker has the --wrap feature. I know that ld.bfd and ld.gold 
do, but I'm not sure on other platforms.


Thanks,


	Andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list