[cfarm-users] gcc110 crash

zatrazz zatrazz at gmail.com
Thu Feb 14 13:43:57 CET 2019


Hi all,

I think I hit a nasty kernel bug testing rt_sigreturn syscall while trying
to understand why it was failing on powerpc64. 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.

-- 
"Tradition is not the worship of ashes, but the preservation of fire."
- Gustav Mahler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tetaneutral.net/pipermail/cfarm-users/attachments/20190214/f4a36bc0/attachment.html>


More information about the cfarm-users mailing list