diff --git a/glibc.spec b/glibc.spec index d4236c75ffe436ecbe559c2e65ac6c439ee267bb..ad8575a7e1d9910037465c55356b623406bf0ec7 100644 --- a/glibc.spec +++ b/glibc.spec @@ -65,7 +65,7 @@ ############################################################################## Name: glibc Version: 2.34 -Release: 32 +Release: 33 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -137,6 +137,7 @@ Patch50: Linux-Simplify-__opensock-and-fix-race-condition-BZ-.patch Patch51: linux-Simplify-get_nprocs.patch Patch52: misc-Add-__get_nprocs_sched.patch Patch53: linux-Revert-the-use-of-sched_getaffinity-on-get_npr.patch +Patch54: pthread-tst-cancel28-Fix-barrier-re-init-race-condit.patch Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch Patch9001: delete-no-hard-link-to-avoid-all_language-package-to.patch @@ -1333,6 +1334,9 @@ fi %endif %changelog +* Wed Dec 15 2021 Qingqing Li - 2.34-33 +- pthread/tst-cancel28: Fix barrier re-init race condition + * Thu Dec 9 2021 Yang Yanchao - 2.34-32 - Deleted some unnecessary command when make master.filelist diff --git a/pthread-tst-cancel28-Fix-barrier-re-init-race-condit.patch b/pthread-tst-cancel28-Fix-barrier-re-init-race-condit.patch new file mode 100644 index 0000000000000000000000000000000000000000..208821236906cd5b9a03ae1ade5a2f6888924cdb --- /dev/null +++ b/pthread-tst-cancel28-Fix-barrier-re-init-race-condit.patch @@ -0,0 +1,41 @@ +From 9874ca536b1d0662b1cea46af3ce09a4d42aeb32 Mon Sep 17 00:00:00 2001 +From: Stafford Horne +Date: Sat, 25 Sep 2021 17:02:06 +0900 +Subject: [PATCH] pthread/tst-cancel28: Fix barrier re-init race condition + +When running this test on the OpenRISC port I am working on this test +fails with a timeout. The test passes when being straced or debugged. +Looking at the code there seems to be a race condition in that: + + 1 main thread: calls xpthread_cancel + 2 sub thread : receives cancel signal + 3 sub thread : cleanup routine waits on barrier + 4 main thread: re-inits barrier + 5 main thread: waits on barrier + +After getting to 5 the main thread and sub thread wait forever as the 2 +barriers are no longer the same. + +Removing the barrier re-init seems to fix this issue. Also, the barrier +does not need to be reinitialized as that is done by default. + +Reviewed-by: Adhemerval Zanella +--- + sysdeps/pthread/tst-cancel28.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/sysdeps/pthread/tst-cancel28.c b/sysdeps/pthread/tst-cancel28.c +index 627cbc8..9286c15 100644 +--- a/sysdeps/pthread/tst-cancel28.c ++++ b/sysdeps/pthread/tst-cancel28.c +@@ -69,7 +69,6 @@ do_test (void) + + xpthread_cancel (timer_thread); + +- xpthread_barrier_init (&barrier, NULL, 2); + xpthread_barrier_wait (&barrier); + + return 0; +-- +1.8.3.1 +