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
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);
}
{
G *newg;
byte *stk;
-
+
if(StackTop < sizeof(Stktop)) {
runtime·printf("runtime: SizeofStktop=%d, should be >=%d\n", (int32)StackTop, (int32)sizeof(Stktop));
runtime·throw("runtime: bad stack.h");
runtime·panicstring(int8 *s)
{
Eface err;
-
+
if(m->gcing) {
runtime·printf("panic: %s\n", s);
runtime·throw("panic during gc");
{
String *s;
int32 i;
-
+
// for windows implementation see "os" package
if(Windows)
return;
{
String *s;
int32 i, n;
-
+
for(n=0; argv[argc+1+n] != 0; n++)
;
runtime·throw("float32nan2");
if(!(i != i1))
runtime·throw("float32nan3");
-
- runtime·initsig();
}
void