This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Memory fencing problem in pthread cancellation
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Carlos O'Donell <carlos at systemhalted dot org>
- Cc: Jeff Law <law at redhat dot com>, Mike Frysinger <vapier at gentoo dot org>, libc-alpha <libc-alpha at sourceware dot org>, <libc-ports at sourceware dot org>, Marcus Shawcroft <marcus dot shawcroft at linaro dot org>
- Date: Mon, 14 Jan 2013 22:21:17 +0000
- Subject: Re: [PATCH] Memory fencing problem in pthread cancellation
- References: <50F46969.1000305@redhat.com> <50F48281.3070207@systemhalted.org>
On Mon, 14 Jan 2013, Carlos O'Donell wrote:
> diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
> index 58ca9ac..d7ac847 100644
> --- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
> +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
> @@ -104,6 +104,7 @@ asm (
> " mov r6, r0\n"
> " cmp r3, #0\n"
> " beq 4f\n"
> + atomic_asm_full_barrier()
> "5: mov r0, r6\n"
> " ldmfd sp!, {r4, r5, r6, lr}\n"
> " " CFI_ADJUST_CFA_OFFSET (-16) "\n"
> @@ -123,7 +124,7 @@ asm (
> #else
> "1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n"
> #endif
> -"2: .word libgcc_s_resume(GOTOFF)\n"
> +"2: .word libgcc_s_handle(GOTOFF)\n"
> " .size _Unwind_Resume, .-_Unwind_Resume\n"
> );
That last change doesn't seem right. Note the subsequent "bx r3" if r3
isn't zero. If you want to test libgcc_s_handle for being zero, you then
need, separately (after the barrier?) to load the libgcc_s_resume value.
(Whatever you do in unwind-forcedunwind.c, presumably much the same change
should go in unwind-resume.c as well.)
--
Joseph S. Myers
joseph@codesourcery.com