diff mbox series

[v2] nptl: Fix niggles with pthread_clockjoin_np

Message ID bd57f4f58493b896c9f387d223e489f0c89be276.1572691890.git-series.mac@mcrowe.com
State New
Headers show
Series [v2] nptl: Fix niggles with pthread_clockjoin_np | expand

Commit Message

Mike Crowe Nov. 2, 2019, 10:52 a.m. UTC
Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47 added
pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its hppa-specific
equivalent sysdeps/unix/sysv/linux/hppa/pthread.h.

Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too.

Florian Weimer spotted[3] that the clockid parameter was not using a
reserved identifier in pthread.h.

[1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html
[2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html
[3] https://sourceware.org/ml/libc-alpha/2019-11/msg00022.html

Fixes: 69ca4b54c151cec42ccca5e05790efc1a8206b47
---
 NEWS                                   |  2 +-
 manual/threads.texi                    |  2 +-
 sysdeps/nptl/pthread.h                 |  2 +-
 sysdeps/unix/sysv/linux/hppa/pthread.h | 11 +++++++++++
 4 files changed, 14 insertions(+), 3 deletions(-)


base-commit: 42893aa38fd6041d349ea0427c4d5ccbacd9a2be

Comments

Rafal Luzynski Nov. 2, 2019, 9:13 p.m. UTC | #1
2.11.2019 11:52 Mike Crowe <mac@mcrowe.com> wrote:
> 
> Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47
> added
> pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its
> hppa-specific
> equivalent sysdeps/unix/sysv/linux/hppa/pthread.h.
> 
> Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too.
> 
> Florian Weimer spotted[3] that the clockid parameter was not using a
> reserved identifier in pthread.h.
> 
> [1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html
> [2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html
> [3] https://sourceware.org/ml/libc-alpha/2019-11/msg00022.html
> 
> Fixes: 69ca4b54c151cec42ccca5e05790efc1a8206b47
> ---
>  NEWS                                   |  2 +-
>  manual/threads.texi                    |  2 +-
>  sysdeps/nptl/pthread.h                 |  2 +-
>  sysdeps/unix/sysv/linux/hppa/pthread.h | 11 +++++++++++
>  4 files changed, 14 insertions(+), 3 deletions(-)
> [...]

LGTM but I'd like to hear a feedback from Joseph and Florian as well.

Thanks and regards,

Rafal
Florian Weimer Nov. 2, 2019, 9:16 p.m. UTC | #2
* Mike Crowe:

> Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47 added
> pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its hppa-specific
> equivalent sysdeps/unix/sysv/linux/hppa/pthread.h.
>
> Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too.
>
> Florian Weimer spotted[3] that the clockid parameter was not using a
> reserved identifier in pthread.h.
>
> [1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html
> [2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html
> [3] https://sourceware.org/ml/libc-alpha/2019-11/msg00022.html
>
> Fixes: 69ca4b54c151cec42ccca5e05790efc1a8206b47

This version looks okay to me, thanks.
Joseph Myers Nov. 4, 2019, 6:13 p.m. UTC | #3
On Sat, 2 Nov 2019, Rafal Luzynski wrote:

> 2.11.2019 11:52 Mike Crowe <mac@mcrowe.com> wrote:
> > 
> > Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47
> > added
> > pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its
> > hppa-specific
> > equivalent sysdeps/unix/sysv/linux/hppa/pthread.h.
> > 
> > Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too.
> > 
> > Florian Weimer spotted[3] that the clockid parameter was not using a
> > reserved identifier in pthread.h.
> > 
> > [1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html
> > [2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html
> > [3] https://sourceware.org/ml/libc-alpha/2019-11/msg00022.html
> > 
> > Fixes: 69ca4b54c151cec42ccca5e05790efc1a8206b47
> > ---
> >  NEWS                                   |  2 +-
> >  manual/threads.texi                    |  2 +-
> >  sysdeps/nptl/pthread.h                 |  2 +-
> >  sysdeps/unix/sysv/linux/hppa/pthread.h | 11 +++++++++++
> >  4 files changed, 14 insertions(+), 3 deletions(-)
> > [...]
> 
> LGTM but I'd like to hear a feedback from Joseph and Florian as well.

This patch is OK.
Adhemerval Zanella Nov. 4, 2019, 7:46 p.m. UTC | #4
On 04/11/2019 15:13, Joseph Myers wrote:
> On Sat, 2 Nov 2019, Rafal Luzynski wrote:
> 
>> 2.11.2019 11:52 Mike Crowe <mac@mcrowe.com> wrote:
>>>
>>> Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47
>>> added
>>> pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its
>>> hppa-specific
>>> equivalent sysdeps/unix/sysv/linux/hppa/pthread.h.
>>>
>>> Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too.
>>>
>>> Florian Weimer spotted[3] that the clockid parameter was not using a
>>> reserved identifier in pthread.h.
>>>
>>> [1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html
>>> [2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html
>>> [3] https://sourceware.org/ml/libc-alpha/2019-11/msg00022.html
>>>
>>> Fixes: 69ca4b54c151cec42ccca5e05790efc1a8206b47
>>> ---
>>>  NEWS                                   |  2 +-
>>>  manual/threads.texi                    |  2 +-
>>>  sysdeps/nptl/pthread.h                 |  2 +-
>>>  sysdeps/unix/sysv/linux/hppa/pthread.h | 11 +++++++++++
>>>  4 files changed, 14 insertions(+), 3 deletions(-)
>>> [...]
>>
>> LGTM but I'd like to hear a feedback from Joseph and Florian as well.
> 
> This patch is OK.
> 

Pushed upstream, thanks
Lukasz Majewski Nov. 5, 2019, 4:07 p.m. UTC | #5
Dear All,

I've been testing some other glibc related work and I've noticed that
from time to time the following test fails:

FAIL: nptl/tst-stack4{.out}

cat nptl/tst-stack4.out 
Didn't expect signal from child: got `Aborted'





System: Debian 10 (buster) - x86_64:

Reproducing: 

rm -rf * && ../src/configure --prefix=/usr
make PARALLELMFLAGS="-j14" && make PARALLELMFLAGS="-j14" check


Is it related to system workload?


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
Florian Weimer Nov. 5, 2019, 4:49 p.m. UTC | #6
* Lukasz Majewski:

> Dear All,
>
> I've been testing some other glibc related work and I've noticed that
> from time to time the following test fails:
>
> FAIL: nptl/tst-stack4{.out}
>
> cat nptl/tst-stack4.out 
> Didn't expect signal from child: got `Aborted'

It's a known issue.  I think it's bug 19329 in our tracker.

Thanks,
Florian
diff mbox series

Patch

diff --git a/NEWS b/NEWS
index 3006b1a..2fc1f89 100644
--- a/NEWS
+++ b/NEWS
@@ -35,7 +35,7 @@  Major new features:
   tz_dsttime fields are zero.
 
 * The function pthread_clockjoin_np has been added, enabling join with a
-  terminated thread with an specific clock.  It allows waiting against
+  terminated thread with a specific clock.  It allows waiting against
   CLOCK_MONOTONIC and CLOCK_REALTIME.  This function is a GNU extension.
 
 Deprecated and removed features, and other changes affecting compatibility:
diff --git a/manual/threads.texi b/manual/threads.texi
index e40b55c..0858ef8 100644
--- a/manual/threads.texi
+++ b/manual/threads.texi
@@ -759,7 +759,7 @@  will wait forever in the same way as @code{pthread_join}.
 				      const struct timespec *@var{abstime})
 @standards{GNU, pthread.h}
 @safety{@prelim{}@mtsafe{}@asunsafe{@asulock{}}@acunsafe{@aculock{}}}
-Behaves like @code{pthread_timedjoin_np} except that time absolute time in
+Behaves like @code{pthread_timedjoin_np} except that the absolute time in
 @var{abstime} is measured against the clock specified by @var{clockid}.
 @end deftypefun
 
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index d2fe6b7..a4ff323 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -272,7 +272,7 @@  extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
    This function is a cancellation point and therefore not marked with
    __THROW.  */
 extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
-                                 clockid_t clockid,
+                                 clockid_t __clockid,
 				 const struct timespec *__abstime);
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread.h b/sysdeps/unix/sysv/linux/hppa/pthread.h
index 424135c..300c187 100644
--- a/sysdeps/unix/sysv/linux/hppa/pthread.h
+++ b/sysdeps/unix/sysv/linux/hppa/pthread.h
@@ -238,6 +238,17 @@  extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
    __THROW.  */
 extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
 				 const struct timespec *__abstime);
+
+/* Make calling thread wait for termination of the thread TH, but only
+   until TIMEOUT measured against the clock specified by CLOCKID.  The
+   exit status of the thread is stored in *THREAD_RETURN, if
+   THREAD_RETURN is not NULL.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return,
+                                 clockid_t __clockid,
+				 const struct timespec *__abstime);
 #endif
 
 /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.