This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix infloop in __pthread_disable_asynccancel on x86_64


2009-11-27  Andreas Schwab  <schwab@redhat.com>

	* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
	THREAD_SELF->cancelhandling after returning from futex call.

diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index 0d48ec6..6806962 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -96,8 +96,8 @@ ENTRY(__pthread_disable_asynccancel)
 	cmpxchgl %r11d, %fs:CANCELHANDLING
 	jnz	2b
 
-3:	movl	%r11d, %eax
-	andl	$(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
+	movl	%r11d, %eax
+3:	andl	$(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
 	cmpl	$TCB_CANCELING_BITMASK, %eax
 	je	4f
 1:	ret
@@ -111,5 +111,6 @@ ENTRY(__pthread_disable_asynccancel)
 	addq	$CANCELHANDLING, %rdi
 	LOAD_PRIVATE_FUTEX_WAIT (%esi)
 	syscall
+	movl	%fs:CANCELHANDLING, %eax
 	jmp	3b
 END(__pthread_disable_asynccancel)
-- 
1.6.5.2


Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]