Skip to content

Allow 64 bit atomics in glibc 2.22 for 32bit SDK

Juro Bystricky openembedded-core 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1glibc: Allow 64 bit atomics for x86meta/recipes-core/glibc/glibc/use_64bit_atomics.patch meta/recipes-core/glibc/glibc_2.22.bb+25 -06 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] Allow 64 bit atomics in glibc 2.22 for 32bit SDK

Investigating the bug https://bugzilla.yoctoproject.org/show_bug.cgi?id=8140
points to a new bug in glibc that first appeared in 2.21, in particular in libpthread-2.21.so and is still present in libpthread-2.22.so. Replacing these libraries with libpthread-2.20.so or libpthread-2.19.so fixes the original bug [YOCTO#8140].
The code between the 2.20 and 2.21 has changed quite a bit, so it is not easy to point out the exact culprit, but it is somewhere in the semaphore handling code.

This patch provides a workaround for the problem. The patch only affects 32 bit native SDKs. The patch consists of allowing 64bit atomic operations for x86. It is safe for Pentium and above, and as a matter of fact it is the best fix available for these platforms in a sense that it not only fixes the problem but also results in a more efficient code. It makes the need to find the actual bug not neccessary (although, time-permitting I will try to determine the exact root cause of the bug)

There is a question of why other 32 bit images do not exhibit this bug. I don't know. It may be related to the way python multiprocessing module handles semaphores/locking/queues.

Any feedback welcome.

Juro Bystricky (1):
glibc: Allow 64 bit atomics for x86

 .../glibc/glibc/use_64bit_atomics.patch            | 24 ++++++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.22.bb              |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/use_64bit_atomics.patch
Signature · 1 line
1.9.1