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

Christof Schmitt cs at samba.org
Thu Dec 7 19:33:58 UTC 2017


On Thu, Dec 07, 2017 at 08:11:46PM +0100, Andreas Schneider wrote:
> On Thursday, 7 December 2017 20:04:02 CET Christof Schmitt wrote:
> > On Thu, Dec 07, 2017 at 08:11:32AM +0100, Andreas Schneider wrote:
> > > 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.
> > > 
> > > Also you should set:
> > > 
> > > cmocka_set_message_output(CM_OUTPUT_SUBUNIT);
> > > 
> > > Then you can run it directly without the shell script.
> > 
> > See attached patches that include both changes: The additional check for
> > the linker flag and avoiding the shell script by having the test output
> > the subunit format directly.
> 
> RB+ for the test :-)

Thank you :-)

Pushed to autobuild with Volker's RB+ for the code changes and yours for
the test.

Christof



More information about the samba-technical mailing list