mirror of
https://github.com/golang/go
synced 2024-11-19 21:04:43 -07:00
runtime: do not handle signals before configuring handler
There was a small window during program initialization where a signal could come in before the handling mechanisms were set up to handle it. Delay the signal-handler installation until we're ready for the signals. Fixes #3314. R=golang-dev, dsymonds, mikioh.mikioh CC=golang-dev https://golang.org/cl/5833049
This commit is contained in:
parent
7694da1f3b
commit
2e4a035995
@ -734,6 +734,12 @@ runtime·mstart(void)
|
||||
m->g0->sched.pc = (void*)-1; // make sure it is never used
|
||||
runtime·asminit();
|
||||
runtime·minit();
|
||||
|
||||
// Install signal handlers; after minit so that minit can
|
||||
// prepare the thread to be able to handle the signals.
|
||||
if(m == &runtime·m0)
|
||||
runtime·initsig();
|
||||
|
||||
schedule(nil);
|
||||
}
|
||||
|
||||
|
@ -342,8 +342,6 @@ runtime·check(void)
|
||||
runtime·throw("float32nan2");
|
||||
if(!(i != i1))
|
||||
runtime·throw("float32nan3");
|
||||
|
||||
runtime·initsig();
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user