diff --git a/glibc-RHEL-119400-1.patch b/glibc-RHEL-119400-1.patch new file mode 100644 index 0000000..32da474 --- /dev/null +++ b/glibc-RHEL-119400-1.patch @@ -0,0 +1,84 @@ +commit 03b8d764109be48a53b18abd4b5050e8cdc2c6da +Author: Siddhesh Poyarekar +Date: Thu Nov 21 17:13:33 2024 -0500 + + nptl: Add smoke test for pthread_getcpuclockid failure + + Exercise the case where an exited thread will cause + pthread_getcpuclockid to fail. + + Signed-off-by: Siddhesh Poyarekar + Reviewed-by: Florian Weimer + +Conflicts: + nptl/Makefile + (fixup context) + +diff --git a/nptl/Makefile b/nptl/Makefile +index 34c80f6f38261669..7139f76827b5ffe6 100644 +--- a/nptl/Makefile ++++ b/nptl/Makefile +@@ -318,6 +318,7 @@ tests = \ + tst-pthread-defaultattr-free \ + tst-pthread-gdb-attach \ + tst-pthread-gdb-attach-static \ ++ tst-pthread-getcpuclockid-invalid \ + tst-pthread-timedlock-lockloop \ + tst-pthread_exit-nothreads \ + tst-pthread_exit-nothreads-static \ +diff --git a/nptl/tst-pthread-getcpuclockid-invalid.c b/nptl/tst-pthread-getcpuclockid-invalid.c +new file mode 100644 +index 0000000000000000..e88a56342767a83e +--- /dev/null ++++ b/nptl/tst-pthread-getcpuclockid-invalid.c +@@ -0,0 +1,50 @@ ++/* Smoke test to verify that pthread_getcpuclockid fails with ESRCH when the ++ thread in question has exited. ++ Copyright the GNU Toolchain Authors. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++void * ++thr (void *in) ++{ ++ return in; ++} ++ ++int ++do_test (void) ++{ ++ clockid_t c; ++ pthread_t t = xpthread_create (NULL, thr, NULL); ++ ++ int ret = 0; ++ while ((ret = pthread_getcpuclockid (t, &c)) == 0) ++ sched_yield (); ++ ++ TEST_COMPARE (ret, ESRCH); ++ ++ return 0; ++} ++ ++#include diff --git a/glibc-RHEL-119400-2.patch b/glibc-RHEL-119400-2.patch new file mode 100644 index 0000000..49bee5c --- /dev/null +++ b/glibc-RHEL-119400-2.patch @@ -0,0 +1,51 @@ +commit 19a198f05802fcc05441c364ed75311ef3f6d663 +Author: Siddhesh Poyarekar +Date: Thu Nov 28 06:30:40 2024 -0500 + + pthread_getcpuclockid: Add descriptive comment to smoke test + + Add a descriptive comment to the tst-pthread-cpuclockid-invalid test and + also drop pthread_getcpuclockid from the TODO-testing list since it now + has full coverage. + + Signed-off-by: Siddhesh Poyarekar + +diff --git a/nptl/TODO-testing b/nptl/TODO-testing +index e076e5624f1cfbaa..f50d2ceb51b247c3 100644 +--- a/nptl/TODO-testing ++++ b/nptl/TODO-testing +@@ -10,10 +10,6 @@ pthread_attr_[sg]etstack + + some more tests needed + +-pthread_getcpuclockid +- +- check that value is reset -> rt subdir +- + pthread_getschedparam + pthread_setschedparam + +diff --git a/nptl/tst-pthread-getcpuclockid-invalid.c b/nptl/tst-pthread-getcpuclockid-invalid.c +index e88a56342767a83e..7ac46acad8fe0fd7 100644 +--- a/nptl/tst-pthread-getcpuclockid-invalid.c ++++ b/nptl/tst-pthread-getcpuclockid-invalid.c +@@ -1,5 +1,4 @@ +-/* Smoke test to verify that pthread_getcpuclockid fails with ESRCH when the +- thread in question has exited. ++/* pthread_getcpuclockid should fail with ESRCH when the thread exits. + Copyright the GNU Toolchain Authors. + This file is part of the GNU C Library. + +@@ -17,6 +16,12 @@ + License along with the GNU C Library; if not, see + . */ + ++/* The input thread descriptor to pthread_getcpuclockid needs to be valid when ++ the function is called. For the purposes of this test, this means that the ++ thread should not be detached, have exited, but not joined. This should be ++ good enough to complete coverage for pthread_getcpuclockid alongside ++ tst-clock2. */ ++ + #include + #include + #include diff --git a/glibc.spec b/glibc.spec index 7a7c2fc..3990ad4 100644 --- a/glibc.spec +++ b/glibc.spec @@ -2348,7 +2348,7 @@ update_gconv_modules_cache () %endif %changelog -* Thu Oct 09 2025 Eduard Abdullin - 2.39-75.alma.1 +* Tue Oct 14 2025 Eduard Abdullin - 2.39-76.alma.1 - Overwrite target for x86_64_v2 - Update patch-git.lua to handle AlmaLinux branches correctly