-4d8e00e730897cc7e73b1582522ecab031cfcaf2
+1d3e0ceee45012a1c3b4ff7f5119a72f90bfcf6a
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
if d.special {
return
}
+
+ // When C code calls a Go function on a non-Go thread, the
+ // deferred call to cgocallBackDone will set g to nil.
+ // Don't crash trying to put d on the free list; just let it
+ // be garbage collected.
+ if getg() == nil {
+ return
+ }
+
mp := acquirem()
pp := mp.p.ptr()
if len(pp.deferpool) == cap(pp.deferpool) {
}
t.flags |= _SigHandling
- setsig(i, funcPC(sigtramp), true)
+ setsig(i, getSigtramp(), true)
}
}
if t.flags&_SigHandling == 0 {
t.flags |= _SigHandling
fwdSig[sig] = getsig(int32(sig))
- setsig(int32(sig), funcPC(sigtramp), true)
+ setsig(int32(sig), getSigtramp(), true)
}
}
}
// We may receive another instance of the signal before we
// restore the Go handler, but that is not so bad: we know
// that the Go program has been ignoring the signal.
- setsig(sig, funcPC(sigtramp), true)
+ setsig(sig, getSigtramp(), true)
}
func crash() {
func schedtrace(bool)
func freezetheworld()
-// Signal trampoline, written in C.
-func sigtramp()
+// Get signal trampoline, written in C.
+func getSigtramp() uintptr
// The sa_handler field is generally hidden in a union, so use C accessors.
func getSigactionHandler(*_sigaction) uintptr
#endif // USING_SPLIT_STACK
+// C function to return the address of the sigtramp function.
+uintptr getSigtramp(void) __asm__ (GOSYM_PREFIX "runtime.getSigtramp");
+
+uintptr
+getSigtramp()
+{
+ return (uintptr)(void*)sigtramp;
+}
+
// C code to manage the sigaction sa_sigaction field, which is
// typically a union and so hard for mksysinfo.sh to handle.