Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
cause: The PPC specific pthread_once code did not correctly
publish changes it made. As a result, those changes were not visible to other threads at the proper time.
fix: release barriers were added to the appropriate PPC pthread code to ensure proper synchronization of data between multiple threads.
Description of problem:
User space application (modified openposix testsuite for pthread_detach) is getting sporadically aborted by signal 6, because gcc_assert() at _Unwind_SetSpColumn() fails.
When looking at a core file in gdb:
(gdb) bt
#0 0x0000008066374e50 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x0000008066376de4 in abort () at abort.c:92
#2 0x000000806687e504 in _Unwind_SetSpColumn (context=0xfff8336df58, outer_cfa=0xfff8336e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1265
#3 uw_init_context_1 (context=0xfff8336df58, outer_cfa=0xfff8336e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1472
#4 0x000000806687ebe0 in _Unwind_ForcedUnwind (exc=0xfff8336f670, stop=@0x8066560ad8: 0x8066545660 <unwind_stop>, stop_argument=0xfff8336e880) at ../../../gcc/unwind.inc:201
#5 0x0000008066548904 in _Unwind_ForcedUnwind (exc=<value optimized out>, stop=<value optimized out>, stop_argument=<value optimized out>) at ../nptl/sysdeps/pthread/unwind-forcedunwind.c:132
#6 0x0000008066545600 in __pthread_unwind (buf=<value optimized out>) at unwind.c:130
#7 0x0000008066545bac in __do_cancel () at pthreadP.h:265
#8 __pthread_enable_asynccancel () at cancellation.c:49
#9 0x000000806653c568 in start_thread (arg=0xfff8336f200) at pthread_create.c:289
#10 0x000000806643a32c in .__clone () from /lib64/libc-2.12.so
(gdb) frame 2
#2 0x000000806687e504 in _Unwind_SetSpColumn (context=0xfff8336df58, outer_cfa=0xfff8336e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1265
1265 gcc_assert (size == sizeof(_Unwind_Word));
Version-Release number of selected component (if applicable):
RHEL-6.3 Server ppc64
gcc-4.4.6-4.el6.ppc64
glibc-2.12-1.80.el6.ppc64
How reproducible:
attached reproducer can usually hit the issue within minutes
Steps to Reproduce:
1. run attached reproducer as unprivileged user on power7 host
Actual results:
application is aborted by signal 6
Expected results:
no gcc_assert failure
Additional info:
I have seen failure only on ppc64 (power7). This comment in upstream bugzilla seems to fit:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52839#c10
Created attachment 607556[details]
reproducer that can trigger the gcc_assert
As unprivileged user run on power7 host:
ulimit -c unlimited
gcc -g3 -O0 gcc_assert_dw2.c -lpthread
./a.out
Within few minutes it should hit gcc_aseert at:
#2 0x000000806687e504 in _Unwind_SetSpColumn (context=0xfff8070df58, outer_cfa=0xfff8070e610, outer_ra=0x8066548904) at ../../../gcc/unwind-dw2.c:1265
1265 gcc_assert (size == sizeof(_Unwind_Word));
Agreed. Actually Alan M. posted a patch to the libc-alpha list in late July. Unfortunately that patch was reported to hang stuff on ppc32 and when I threw it into brew for fun, it hung builds for both ppc32 and ppc64.
Somehow that last hunk munges things -- I'm not sure if it's the missing "memory" clobber in the asm, or using GENERAL_REGS instead of BASE_REGS for the address of once_control.
AFAICT, that last hunk is just a slightly optimized read barrier + atomic_increment. So I've kept the atomic_increment and just added a call to atomic_read_barrier (and kept the other changes). Builds/testing in progress.
Created attachment 608381[details]
Potential fix from Alan Modra
16 parallel instances of the test just passed 100k iterations each without tripping a failure which is about 10x longer than they'd ever managed to go before without tripping. I'm going to let it run overnight, but I'm pretty sure we've got the right fix.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2013-0279.html