[PATCH] nptl: Handle NULL abstime [BZ #26394]

Lukasz Majewski lukma@denx.de
Mon Aug 17 14:24:23 GMT 2020


Hi Adhemerval, H.J. Liu,

> On 17/08/2020 10:52, H.J. Lu wrote:
> > On Mon, Aug 17, 2020 at 6:30 AM Lukasz Majewski <lukma@denx.de>
> > wrote:  
> >>
> >> Hi Andreas, H.J.,
> >>  
> >>> On Aug 15 2020, H.J. Lu wrote:
> >>>  
> >>>> From fa1f97680fca290a378c449f2b63682ee348fd2c Mon Sep 17 00:00:00
> >>>> 2001 From: "H.J. Lu" <hjl.tools@gmail.com>
> >>>> Date: Sat, 15 Aug 2020 11:06:35 -0700
> >>>> Subject: [PATCH] nptl: Handle NULL abstime [BZ #26394]
> >>>>
> >>>> Since abstime passed to pthread_{clock|timed}join_np may be
> >>>> NULL,  
> >>
> >> Could you point me to the exact reference that it is allowed (or
> >> required) to pass NULL to this syscall?
> >>
> >> The one which I've found on the web:
> >> https://linux.die.net/man/3/pthread_timedjoin_np
> >>
> >> doesn't mention about NULL pointer passed as the absolute time.
> >> It says explicitly:
> >> "The abstime argument is a structure of the following form,
> >> specifying an absolute time measured since the Epoch"
> >>
> >>
> >> As fair as I remember [1] glibc only handles the NULL pointer case
> >> when it is explicitly written in the documentation/spec that NULL
> >> is passed (like here: https://linux.die.net/man/2/timerfd_settime
> >> or here: https://linux.die.net/man/2/utimensat).
> >>
> >> Link:
> >> [1] -
> >> https://sourceware.org/pipermail/libc-alpha/2019-November/108072.html
> >>  
> > 
> > sysdeps/pthread/tst-join14.c explicitly passes NULL:
> > 
> > static int
> > do_test_clock (clockid_t clockid)
> > {
> >   pthread_t th = xpthread_create (NULL, tf, NULL);
> > 
> >   void *status;
> >   int val = (clockid == CLOCK_USE_TIMEDJOIN)
> >     ? pthread_timedjoin_np (th, &status, NULL)
> >     : pthread_clockjoin_np (th, &status, clockid, NULL);
> >   TEST_COMPARE (val, 0);
> > 
> >   if (status != (void *) 42l)
> >     FAIL_EXIT1 ("return value %p, expected %p\n", status, (void *)
> > 42l);
> > 
> >   return 0;
> > }
> >   
> 
> And it is a red-flag that you did not catch it running the testsuite.
>  Did you check the patch with a full make check to certify there is
> no regressions?

I must admit that I've run the build-many-glibcs and also my tests (on
yocto) on which NULL was not passed.

I must have forgotten to run the make check - sorry .....


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20200817/306ec0f6/attachment.sig>


More information about the Libc-alpha mailing list