diff mbox

fix pthread_cancel lead to segmentation fault for x86_64.

Message ID 1400604775-20602-1-git-send-email-glen4linux@gmail.com
State Superseded
Headers show

Commit Message

ZhangPu May 20, 2014, 4:52 p.m. UTC
When x86_64 cpu contains 'cpu_has_xsave' flag(in kernel),call the
pthread_cancel will have a segmentation fault. Because gcc could
not find the end of stack in user signal stack.

Signed-off-by: ZhangPu <glen4linux@gmail.com>
---
 libc/sysdeps/linux/x86_64/sigaction.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Bernhard Reutner-Fischer June 12, 2014, 3:34 p.m. UTC | #1
On Wed, May 21, 2014 at 12:52:55AM +0800, ZhangPu wrote:
> When x86_64 cpu contains 'cpu_has_xsave' flag(in kernel),call the
> pthread_cancel will have a segmentation fault. Because gcc could
> not find the end of stack in user signal stack.

How ugly..
Applied, thanks!
diff mbox

Patch

diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c
index 703b24c..229e1a9 100644
--- a/libc/sysdeps/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/linux/x86_64/sigaction.c
@@ -116,6 +116,7 @@  libc_hidden_weak(sigaction)
 #define RESTORE(name, syscall) RESTORE2(name, syscall)
 #define RESTORE2(name, syscall) \
 __asm__ (						\
+	"	nop\n"					\
 	".text\n"					\
 	"__" #name ":\n"				\
 	"	movq	$" #syscall ", %rax\n"		\