|
From: Tom H. <to...@co...> - 2005-11-17 18:59:37
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> This segfaults on ppc32, even when running natively. Does anyone
> know why this might be? It's not obvious from a 2-minute inspection
> of the code. V says:
>
> ==1168== Process terminating with default action of signal 11 (SIGSEGV)
> ==1168== Bad permissions for mapped region at address 0x4026970
> ==1168== at 0xFEA35D4: vfprintf (in /lib/tls/libc-2.3.5.so)
>
> gdb says (natively):
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0feea5d4 in vfprintf () from /lib/tls/libc.so.6
> (gdb) where
> #0 0x0feea5d4 in vfprintf () from /lib/tls/libc.so.6
> #1 0x0fef2a60 in printf () from /lib/tls/libc.so.6
> #2 0x100007b4 in hello (newc=Cannot access memory at address 0x8
> ) at stack_changes.c:14
> Previous frame inner to this frame (corrupt stack?)
I think the problem is that both makecontext calls claim to provide
two arguments but only provide one.
On x86 and amd64 we are getting away with it because the hello function
never looks for a second argument. On ppc32 it looks like it is getting
confused and getting the wrong argument value somehow.
Try changing 2 to 1 in each of the makecontext calls...
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|