This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S/390: Fix makecontext with uc_link == NULL
- From: Carlos O'Donell <carlos at codesourcery dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 10 Jul 2012 09:14:11 -0400
- Subject: Re: [PATCH] S/390: Fix makecontext with uc_link == NULL
- References: <20120710102022.GA5123@bart>
On 7/10/2012 6:20 AM, Andreas Krebbel wrote:
> Hi,
>
> if the uc_link field in ucontext is set to NULL the thread is supposed
> to be exited after returning from the function specfied with
> makecontext. Doing this on s390 currently ends with a segfault when
> trying to access fields of the ucontext given in uc_link.
>
> With the attached patch exit is called if uc_link turns out to be
> NULL.
>
> Tested on s390 and s390x. No regressions.
>
> I'll commit it after waiting a few days for comments.
>
> Bye,
>
> -Andreas-
>
> 2012-07-10 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
>
> * sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c: Move
> __makecontext_ret to ...
> * sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S:
> ... here and call exit if uc_link is NULL. New file.
> * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Add
> __makecontext_ret.S.
> * sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c: Move
> __makecontext_ret to ...
> * sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S:
> ... here and call exit if uc_link is NULL. New file.
> * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Add
> __makecontext_ret.S.
Do we have a testcase that covers this failure?
If we don't, could you try to work one up?
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026