tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Go binary panics on amd64-current - SIG*unknown



In article <20180106224309.w2vicky2i6rf6fvu@neva>,
Alexander Nasonov  <alnsn%yandex.ru@localhost> wrote:
>I downloaded IACA tool from intel.com but I couldn't run it:
>
>$ ktrace ./iaca-v3.0-lin64/iaca
>fatal error: rt_sigaction read failure
>
>runtime stack:
>runtime.throw(0x75de24, 0x19)
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/panic.go:596 +0x95
>runtime.getsig(0x40, 0x441c60)
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/os_linux.go:427 +0x92
>runtime.initsig(0xe59d00)
>       
>/nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/signal_unix.go:79
>+0x98
>runtime.mstart1()
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/proc.go:1175 +0xa4
>runtime.mstart()
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/proc.go:1149 +0x64
>
>goroutine 1 [runnable]:
>runtime.main()
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/proc.go:106
>runtime.goexit()
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/asm_amd64.s:2197 +0x1
>
>goroutine 17 [syscall, locked to thread]:
>runtime.goexit()
>        /nfs/iil/disks/kfw/tools/go/go-latest/src/runtime/asm_amd64.s:2197 +0x1
>
>
>$ kdump
>
>  5477   5477 iaca     CALL  rt_sigaction(SIG*unknown 64*,0,0x7f7fffffe580,8)
>  5477   5477 iaca     RET   rt_sigaction -1 errno -22 Invalid argument
>  5477   5477 iaca     CALL  rt_sigaction(SIG*unknown 64*,0,0x7f7fffffe8b8,8)
>  5477   5477 iaca     RET   rt_sigaction -1 errno -22 Invalid argument
> 
>$ uname -a
>NetBSD neva 8.99.7 NetBSD 8.99.7 (GENERIC_KASLR) #0: Sat Nov 18 09:54:53
>GMT 2017 
>alnsn@neva:/home/alnsn/netbsd-current/clean/src/sys/arch/amd64/compile/obj/GENERIC_KASLR amd64
>
>I don't know if it matters but I have PAX protections enabled:
>
>$ sysctl -a |grep -w pax | grep enabled
>security.pax.mprotect.enabled = 1
>security.pax.segvguard.enabled = 1
>security.pax.aslr.enabled = 1

Index: linux_sigaction.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_sigaction.c,v
retrieving revision 1.34
diff -u -u -r1.34 linux_sigaction.c
--- linux_sigaction.c	17 Oct 2008 20:21:34 -0000	1.34
+++ linux_sigaction.c	7 Jan 2018 00:10:43 -0000
@@ -84,6 +84,15 @@
 		linux_old_to_native_sigaction(&nbsa, &nlsa);
 	}
 	sig = SCARG(uap, signum);
+	/*
+	 * XXX: Linux has 33 realtime signals, the go binary wants to
+	 * reset all of them; nothing else uses the last RT signal, so for
+	 * now ignore it.
+	 */
+	if (sig == LINUX__NSIG) {
+		uprintf("%s: setting signal %d ignored\n", __func__, sig);
+		sig--;	/* back to 63 which is ignored */
+	}
 	if (sig < 0 || sig >= LINUX__NSIG)
 		return (EINVAL);
 	if (sig > 0 && !linux_to_native_signo[sig]) {



Home | Main Index | Thread Index | Old Index