[cfarm-users] gcc110 crash

Segher Boessenkool segher at kernel.crashing.org
Thu Feb 14 16:59:04 CET 2019


Hi Adhemerval,

On Thu, Feb 14, 2019 at 10:43:57AM -0200, zatrazz via cfarm-users wrote:
> I think I hit a nasty kernel bug testing rt_sigreturn syscall while trying
> to understand why it was failing on powerpc64.

Thanks for letting use know.

> If anyone is curious I
> changed the way swapcontext is done for powerpc64 to pass the new context
> as r9:
> 
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
> b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
> index af5b108..dcd97ca 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S
> @@ -787,7 +787,7 @@ L(error_exit):
>       R1 pointing at the dummy frame) state.  We do have the ucontext
>       address in R3, so simply copy R3 to R1 before the syscall.  */
>  L(do_sigret):
> -  mr   r1,r3,
> +  mr   r9,r3,
>    li   r0,SYS_ify(rt_sigreturn)
>    sc
>    /* No return.  */
> 
> And issue a program that calls swapcontext in a signal handler using the
> third argument (configured with SA_SIGINFO). This seems to be an issue with
> certain specific kernel version since newer kernels handle the context
> information without resorting in syscall argument handling.
> 
> Anyway just a heads up that this is probably a nasty issue affecting
> CentOS7.

Please tell linuxppc-dev@?

Please don't do such experiments on the cfarm systems (or any other shared
systems), btw...  If you expect it may crash the system, don't do it, there
are other users that want to use the systems, too.  But don't feel to bad,
this stuff happens, just take better care next time :-)


Segher


More information about the cfarm-users mailing list