Skip to contentSkip to conversation

glibc: fix pthread_cond_broadcast issue (arm)

PATCH In review Catalin Enache 2 participants 2 messages Jul 7, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 glibc: fix pthread_cond_broadcast issue (arm)

pthread_mutex functions such as pthread_cond_wait(), pthread_mutex_unlock() return errors after PTHREAD_PRIO_INHERIT is enabled

Reference:
https://sourceware.org/bugzilla/show_bug.cgi?id=18463

Upstream patches:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=f0e3925bf3b8df6940c3346db17e42615979d458
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=13cb8f76da9d9420330796f469dbf10643ba5b12
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=23b5cae1af04f2d912910fdaf73cb482265798c1
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=ed19993b5b0d05d62cc883571519a67dae481a14
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2e4cf778972573221e9b87fd992844ea9b67b9bf
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=abff18c0c6055ca5d1cd46923fd1205c057139a5

This issue is Morty specific (glibc 2.24).
The issue is no longer present in glibc 2.25 (master branch).

---
 .../glibc/0001-Add-atomic_exchange_relaxed.patch   |   58 +
 ...operations-required-by-the-new-condition-.patch |  124 +
 ...d-pretty-printers-for-the-NPTL-lock-types.patch | 3197 +++++++++
 ...-implementation-that-provides-stronger-or.patch | 7171 ++++++++++++++++++++
 .../glibc/0005-Remove-__ASSUME_REQUEUE_PI.patch    |  149 +
 .../glibc/0006-Fix-atomic_fetch_xor_release.patch  |   81 +
 meta/recipes-core/glibc/glibc_2.24.bb              |    6 +
 7 files changed, 10786 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-Add-atomic_exchange_relaxed.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-Add-atomic-operations-required-by-the-new-condition-.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0003-Add-pretty-printers-for-the-NPTL-lock-types.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0005-Remove-__ASSUME_REQUEUE_PI.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0006-Fix-atomic_fetch_xor_release.patch
meta/recipes-core/glibc/glibc/0001-Add-atomic_exchange_relaxed.patch new file +58 -0
new file mode 100644
index 0000000..a33a135
@@ -0,0 +1,58 @@
+From ce74a620bf9e1a40b7ba06d35160e20633a4d8bb Mon Sep 17 00:00:00 2001
+From: Catalin Enache <[email protected]>
+Date: Fri, 7 Jul 2017 13:11:16 +0300
+Subject: [PATCH 1/6] Add atomic_exchange_relaxed.
+
+* include/atomic.h (atomic_exchange_relaxed): New
+
+Upstream-Status: Backport
+
+Author: Torvald Riegel <[email protected]>
+Signed-off-by: Catalin Enache <[email protected]>
+---
+ ChangeLog        | 4 ++++
+ include/atomic.h | 9 +++++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 0fbda90..cb87279 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2016-08-05  Torvald Riegel  <[email protected]>
++
++	* include/atomic.h (atomic_exchange_relaxed): New.
++
+ 2016-01-28  Carlos O'Donell  <[email protected]>
+ 	    Alexey Makhalov <[email protected]>
+ 	    Florian Weimer <[email protected]>
+diff --git a/include/atomic.h b/include/atomic.h
+index ad3db25..129ee24 100644
+--- a/include/atomic.h
++++ b/include/atomic.h
+@@ -588,6 +588,9 @@ void __atomic_link_error (void);
+   __atomic_compare_exchange_n ((mem), (expected), (desired), 1,		      \
+     __ATOMIC_RELEASE, __ATOMIC_RELAXED); })
+ 
++# define atomic_exchange_relaxed(mem, desired) \
++  ({ __atomic_check_size((mem));					      \
++  __atomic_exchange_n ((mem), (desired), __ATOMIC_RELAXED); })
+ # define atomic_exchange_acquire(mem, desired) \
+   ({ __atomic_check_size((mem));					      \
+   __atomic_exchange_n ((mem), (desired), __ATOMIC_ACQUIRE); })
+@@ -684,6 +687,12 @@ void __atomic_link_error (void);
+    *(expected) == __atg103_expected; })
+ # endif
+ 
++/* XXX Fall back to acquire MO because archs do not define a weaker
++   atomic_exchange.  */
++# ifndef atomic_exchange_relaxed
++#  define atomic_exchange_relaxed(mem, val) \
++   atomic_exchange_acq ((mem), (val))
++# endif
+ # ifndef atomic_exchange_acquire
+ #  define atomic_exchange_acquire(mem, val) \
+    atomic_exchange_acq ((mem), (val))
+-- 
+2.10.2
+
meta/recipes-core/glibc/glibc/0002-Add-atomic-operations-required-by-the-new-condition-.patch new file +124 -0

124 lines not on this page · raw message

meta/recipes-core/glibc/glibc/0003-Add-pretty-printers-for-the-NPTL-lock-types.patch new file +3197 -0

2,818 lines not on this page · raw message

meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch new file +7171 -0

7,171 lines not on this page · raw message

meta/recipes-core/glibc/glibc/0005-Remove-__ASSUME_REQUEUE_PI.patch new file +149 -0

149 lines not on this page · raw message

meta/recipes-core/glibc/glibc/0006-Fix-atomic_fetch_xor_release.patch new file +81 -0

81 lines not on this page · raw message

meta/recipes-core/glibc/glibc_2.24.bb +6 -0
index 08ae459..e723e03 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.10.2

Part of the diff is not shown here. View the raw message.

#1 lore raw

✗ patchtest: failure for glibc: fix pthread_cond_broadcast issue (arm) (rev3)

== Series Details ==

Series: glibc: fix pthread_cond_broadcast issue (arm) (rev3)
Revision: 3
URL : https://patchwork.openembedded.org/series/7626/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series cannot be parsed correctly due to malformed diff lines [test_mbox_format]
Suggested fix Create the series again using git-format-patch and ensure it can be applied using git am
Diff line diff --git a/meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch b/meta/recipes-core/glibc/glibc/0004-New-condvar-implementation-that-provides-stronger-or.patch

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe