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]

Re: [PATCH] S/390: Fix makecontext with uc_link == NULL


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


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