summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorZhang Pu <glen4linux@gmail.com>2014-05-21 00:52:55 +0800
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2014-06-12 17:33:39 +0200
commit1608819110a4f2a40c3781a9c4b8a8f4b2cea69a (patch)
treebb181f397c1ffbc84e9e0c5b94893cab074666c3 /libc
parent8b8ad6ed0fb73ff5c331076ee82ff644d0b8cb07 (diff)
fix pthread_cancel lead to segmentation fault for x86_64.
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: Zhang Pu <glen4linux@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/x86_64/sigaction.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c
index 703b24c51..a4042a9c8 100644
--- a/libc/sysdeps/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/linux/x86_64/sigaction.c
@@ -111,11 +111,19 @@ libc_hidden_weak(sigaction)
signal handlers work right. Important are both the names
(__restore_rt) and the exact instruction sequence.
If you ever feel the need to make any changes, please notify the
- appropriate GDB maintainer. */
+ appropriate GDB maintainer.
+
+ The unwind information starts a byte before __restore_rt, so that
+ it is found when unwinding, to get an address the unwinder assumes
+ will be in the middle of a call instruction. See the Linux kernel
+ (the i386 vsyscall, in particular) for an explanation of the complex
+ unwind information used here in order to get the traditional CFA.
+ */
#define RESTORE(name, syscall) RESTORE2(name, syscall)
#define RESTORE2(name, syscall) \
__asm__ ( \
+ "nop\n" \
".text\n" \
"__" #name ":\n" \
" movq $" #syscall ", %rax\n" \