This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Properly terminate FDE in makecontext for ix86 (bug 18635)
- From: Andreas Schwab <schwab at suse dot de>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Stefan Liebler <stli at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Tue, 04 Aug 2015 12:40:43 +0200
- Subject: [PATCH] Properly terminate FDE in makecontext for ix86 (bug 18635)
- Authentication-results: sourceware.org; auth=none
- References: <ml71gu$et2$1 at ger dot gmane dot org> <557AA306 dot 4090208 at redhat dot com> <mleq97$5v2$1 at ger dot gmane dot org> <87eglhvsst dot fsf at igel dot home> <mlm3f3$bbu$1 at ger dot gmane dot org> <559651D0 dot 1030704 at redhat dot com> <CAMe9rOqs_DPaN=h_dnskMEyvSkG6PrVhr2vXJp7+_sejKenXBg at mail dot gmail dot com> <CAMe9rOr+tMWUN8ruaLoA9wT_bEcgJx4dfzjXSEVqSwRh-LK7ng at mail dot gmail dot com> <559C224F dot 2090600 at redhat dot com> <mnj3c8$npj$1 at ger dot gmane dot org> <559D372C dot 9070105 at redhat dot com> <559D3794 dot 3020408 at redhat dot com>
[BZ #18635]
* sysdeps/unix/sysv/linux/i386/makecontext.S: Terminate FDE before
ret.
* sysdeps/i386/i686/Makefile (test-xfail-tst-makecontext): Remove.
---
sysdeps/i386/i686/Makefile | 6 ------
sysdeps/unix/sysv/linux/i386/makecontext.S | 5 ++++-
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/sysdeps/i386/i686/Makefile b/sysdeps/i386/i686/Makefile
index 83517c4..5ce9fc6 100644
--- a/sysdeps/i386/i686/Makefile
+++ b/sysdeps/i386/i686/Makefile
@@ -18,9 +18,3 @@ ASFLAGS-.op += -Wa,-mtune=i686
ASFLAGS-.og += -Wa,-mtune=i686
ASFLAGS-.oS += -Wa,-mtune=i686
endif
-
-ifeq ($(subdir),stdlib)
-# _Unwind_Backtrace from libgcc produces a segmentation fault if it was
-# called within a context created by makecontext. See Bug 18635.
-test-xfail-tst-makecontext = yes
-endif
diff --git a/sysdeps/unix/sysv/linux/i386/makecontext.S b/sysdeps/unix/sysv/linux/i386/makecontext.S
index 8364fb9..bcf8de6 100644
--- a/sysdeps/unix/sysv/linux/i386/makecontext.S
+++ b/sysdeps/unix/sysv/linux/i386/makecontext.S
@@ -83,6 +83,10 @@ ENTRY(__makecontext)
#else
movl $L(exitcode), (%edx)
#endif
+ /* We need to terminate the FDE here instead of after ret because
+ the unwinder looks at ra-1 for unwind information. */
+ cfi_endproc
+
/* 'makecontext' returns no value. */
ret
@@ -92,7 +96,6 @@ ENTRY(__makecontext)
the context 'makecontext' manipulated at the time of the
'makecontext' call. If the pointer is NULL the process must
terminate. */
- cfi_endproc
L(exitcode):
/* This removes the parameters passed to the function given to
'makecontext' from the stack. EBX contains the number of
--
2.5.0
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."