[PATCH] Re: {make,set,swap}context broken on powerpc32
Steven Munroe
munroesj@us.ibm.com
Thu Dec 14 19:06:00 GMT 2006
Jakub Jelinek wrote:
>On Wed, Dec 13, 2006 at 09:47:57AM +0100, Jakub Jelinek wrote:
>
>>>Could you strace your test program and see whether it is using
>>>sys_swapcontext or sys_rt_sigreturn?
>>>
>>It uses sys_swapcontext to fill it up (i.e. in getcontext calls)
>>and apparently sys_rt_sigreturn in setcontext (sorry I haven't noticed that),
>>will look why:
>>
>
>The reason for this is a bug in glibc, while getcontext/swapcontext both
>include kernel-features.h and thus __ASSUME_SWAPCONTEXT_SYSCALL is defined
>in --enable-kernel=2.6.9 builds, setcontext does not and therefore it
>always uses other methods. Sorry for thinking it was making a swapcontext
>syscall even the third time, I saw it is making some syscall under gdb
>and looking at the source I it appeared it would use swapcontext.
>While this cures the testcase I posted (r2 is no longer restored by
>swapcontext), I still don't like the realignment. Either the kernel
>has a bug and should always align, or makecontext needs to memmove when it
>realigns.
>
>
This patch is more complete where it forces alignment for of uc_regs for
__ASSUME_SWAPCONTEXT_SYSCALL version of __getcontext and swapcontext
and allows makecontext to assume the uc_regs is set and aligned. This
version passes Jakub's test case on on the 2.6 kernels I have tried so far.
We still need to verify that on ppc970 the kernel is aligning the
uc_regs pointer when VMX regs are present.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ppc32-assume-context-20061213.txt
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20061214/f519c8d6/attachment.txt>
More information about the Libc-alpha
mailing list