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

Carlos O'Donell carlos_odonell@mentor.com
Thu Jul 12 13:38:00 GMT 2012


On 7/12/2012 8:19 AM, Andreas Krebbel wrote:
>> Do we have a testcase that covers this failure?
>>
>> If we don't, could you try to work one up?
> 
> stdlib/tst-makecontext already calls makecontext with uc_link == NULL
> but the function invoked in the context does explicitly call exit (0).
> Removing this enables the testcase to cover that problem as well.
> 
> I've added this to my patch.
> 
> Bye,
> 
> -Andreas-
> 
> 
> 2012-07-12  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.
> 	* stdlib/tst-makecontext.c: Remove explicit exit call.

Excellent. The testcase changes look good to me and match what
SuSv2 says about a returning from a context where uc_link is
zero e.g. "the thread will exit when this context returns."

I'm happy with this, thanks for enhancing the testcase to cover
the failure scenario.

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026




More information about the Libc-alpha mailing list