This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: powerpc pthread_once bug fix
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: libc-alpha at sourceware dot org, rsa at linux dot vnet dot ibm dot com
- Date: Tue, 24 Jul 2012 23:08:01 -0500
- Subject: Re: powerpc pthread_once bug fix
- References: <20120711113606.GM3117@bubble.grove.modra.org>
On Wed, Jul 11, 2012 at 6:36 AM, Alan Modra <amodra@gmail.com> wrote:
> This fixes some bugs in the powerpc pthread_once code. Ref
> gcc.gnu.org/bugzilla/show_bug.cgi?id=52839#c10
>
> Release barriers are needed to ensure any memory written by
> init_routine is seen by other threads before *once_control changes.
> In the case of clear_once_control we need to flush any partially
> written state.
I just tried this patch on powerpc32 and it hangs make check in
nptl/tst-sem4. I attached GDB to the process and got this:
0x0ffcec9c in __GI___pthread_once (once_control=0xffe9198,
init_routine=0xffcf390 <__where_is_shmfs>)
at ../nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c:77
77 lll_futex_wait (once_control, oldval, LLL_PRIVATE);
(gdb) info threads
Id Target Id Frame
* 1 process 25126 0x0ffcec9c in __GI___pthread_once
(once_control=0xffe9198,
init_routine=0xffcf390 <__where_is_shmfs>) at
../nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c:77
(gdb) bt
#0 0x0ffcec9c in __GI___pthread_once (once_control=0xffe9198,
init_routine=0xffcf390 <__where_is_shmfs>)
at ../nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c:77
#1 0x0ffcf6e8 in sem_open (name=0x10000cd4 "/glibc-tst-sem4",
oflag=192) at sem_open.c:234
#2 0x100005e4 in main () at tst-sem4.c:66
(gdb)