Apparently on Solaris 10 a SA_SIGINFO signal handler can be invoked with
a nil info argument. I would not have believed it but I've now seen it
happen, and the sigaction man page actually says "If the second argument
is not equal to NULL, it points to a siginfo_t structure...." So, if
that happens, don't crash.
Also fix another case where we want to make sure that &T{} does not
allocate.
Reviewed-on: https://go-review.googlesource.com/33150
From-SVN: r242403
-3c8d91cff0ad3d233ebd268f88a3749d38a0aac1
+eb716b515356166d3177e6244619be5901f31162
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
ctxt unsafe.Pointer
}
-func (c *sigctxt) sigcode() uint64 { return uint64(c.info.si_code) }
+func (c *sigctxt) sigcode() uint64 {
+ if c.info == nil {
+ // This can happen on Solaris 10. We don't know the
+ // code, just avoid a misleading value.
+ return _SI_USER + 1
+ }
+ return uint64(c.info.si_code)
+}
//go:nosplit
func sigblock() {
// get here anyhow.
return
}
- badsignal(uintptr(sig), &sigctxt{info, ctx})
+ c := sigctxt{info, ctx}
+ badsignal(uintptr(sig), &c)
return
}
Location loc[1];
int32 n;
- ret.sigaddr = (uintptr)(info->si_addr);
+ if (info == nil) {
+ ret.sigaddr = 0;
+ } else {
+ ret.sigaddr = (uintptr)(info->si_addr);
+ }
ret.sigpc = 0;
// There doesn't seem to be a portable way to get the PC.