From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31468 invoked by alias); 31 Jan 2013 22:08:00 -0000 Received: (qmail 31453 invoked by uid 22791); 31 Jan 2013 22:08:00 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_DM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Jan 2013 22:07:54 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0VM7pBQ000343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 31 Jan 2013 17:07:51 -0500 Received: from stumpy.slc.redhat.com (ovpn-113-73.phx2.redhat.com [10.3.113.73]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0VM7nUR024714; Thu, 31 Jan 2013 17:07:49 -0500 Message-ID: <510AEB35.6090909@redhat.com> Date: Thu, 31 Jan 2013 22:08:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "Carlos O'Donell" CC: "Joseph S. Myers" , Mike Frysinger , libc-alpha , libc-ports@sourceware.org, Marcus Shawcroft Subject: Re: [PATCH] Memory fencing problem in pthread cancellation References: <50F46969.1000305@redhat.com> <50F48281.3070207@systemhalted.org> <50F48DA4.4000407@systemhalted.org> In-Reply-To: <50F48DA4.4000407@systemhalted.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00087.txt.bz2 On 01/14/2013 03:58 PM, Carlos O'Donell wrote: > You are correct, we need another entry for libgcc_s_resume, and we need > to load that after the barrier, otherwise we won't call libgcc_s_resume. > > Something like this: > > 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..1e03b13 100644 > --- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c > +++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c > @@ -104,7 +104,12 @@ asm ( > " mov r6, r0\n" > " cmp r3, #0\n" > " beq 4f\n" > -"5: mov r0, r6\n" > + atomic_asm_full_barrier() > +"5: ldr r4, 6f\n" > +" ldr r5, 7f\n" > +"8: add r4, pc, r4\n" > +" ldr r3, [r4, r5]\n" > +" mov r0, r6\n" > " ldmfd sp!, {r4, r5, r6, lr}\n" > " " CFI_ADJUST_CFA_OFFSET (-16) "\n" > " " CFI_RESTORE (r4) "\n" > @@ -123,7 +128,13 @@ 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" > +#ifdef __thumb2__ > +"6: .word _GLOBAL_OFFSET_TABLE_ - 8b - 4\n" > +#else > +"6: .word _GLOBAL_OFFSET_TABLE_ - 8b - 8\n" > +#endif > +"7: .word libgcc_s_resume(GOTOFF)\n" > " .size _Unwind_Resume, .-_Unwind_Resume\n" > ); Added. Likewise for the other changes. With one tweak: [ ... ] > @@ -76,7 +92,7 @@ asm ( > " " CFI_RESTORE (lr) "\n" > " bx r3\n" > " " CFI_RESTORE_STATE "\n" > -"4: bl init\n" > +"4: bl pthread_cancel_init\n" > " ldr r3, [r4, r5]\n" > " b 5b\n" > " " CFI_ENDPROC "\n" I got the impression via a later message from Joseph that this code was supposed to call init rather than pthread_cancel_init. So I didn't apply that hunk. Updated patch with all the updates/fixes to be posted tomorrow AM. Jeff