Commit 0097d30c authored by Shenghou Ma's avatar Shenghou Ma

runtime: unblock signals when we try to core dump

Fixes #6988.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/44070046
parent cbc565a8
......@@ -517,3 +517,9 @@ runtime·signalstack(byte *p, int32 n)
st.ss_flags = SS_DISABLE;
runtime·sigaltstack(&st, nil);
}
void
runtime·unblocksignals(void)
{
runtime·sigprocmask(SIG_SETMASK, &sigset_none, nil);
}
......@@ -23,6 +23,7 @@ int32 runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
typedef uint32 Sigset;
void runtime·sigprocmask(int32, Sigset*, Sigset*);
void runtime·unblocksignals(void);
struct Sigaction;
void runtime·sigaction(uintptr, struct Sigaction*, struct Sigaction*);
......@@ -39,4 +40,3 @@ void runtime·setitimer(int32, Itimerval*, Itimerval*);
#define SIG_BLOCK 1
#define SIG_UNBLOCK 2
#define SIG_SETMASK 3
......@@ -280,3 +280,9 @@ runtime·signalstack(byte *p, int32 n)
st.ss_flags = SS_DISABLE;
runtime·sigaltstack(&st, nil);
}
void
runtime·unblocksignals(void)
{
runtime·sigprocmask(&sigset_none, nil);
}
......@@ -12,6 +12,7 @@ void runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
struct sigaction;
void runtime·sigaction(int32, struct sigaction*, struct sigaction*);
void runtime·sigprocmask(Sigset *, Sigset *);
void runtime·unblocksignals(void);
void runtime·setitimer(int32, Itimerval*, Itimerval*);
int32 runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
......
......@@ -288,3 +288,9 @@ runtime·signalstack(byte *p, int32 n)
st.ss_flags = SS_DISABLE;
runtime·sigaltstack(&st, nil);
}
void
runtime·unblocksignals(void)
{
runtime·sigprocmask(&sigset_none, nil);
}
......@@ -12,6 +12,7 @@ void runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
struct sigaction;
void runtime·sigaction(int32, struct sigaction*, struct sigaction*);
void runtime·sigprocmask(Sigset *, Sigset *);
void runtime·unblocksignals(void);
void runtime·setitimer(int32, Itimerval*, Itimerval*);
int32 runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
......
......@@ -331,3 +331,9 @@ runtime·signalstack(byte *p, int32 n)
st.ss_flags = SS_DISABLE;
runtime·sigaltstack(&st, nil);
}
void
runtime·unblocksignals(void)
{
runtime·rtsigprocmask(SIG_SETMASK, &sigset_none, nil, sizeof sigset_none);
}
......@@ -28,6 +28,7 @@ struct Sigset
uint32 mask[2];
};
void runtime·rtsigprocmask(int32, Sigset*, Sigset*, int32);
void runtime·unblocksignals(void);
#define SIG_SETMASK 2
#define RLIMIT_AS 9
......
......@@ -326,3 +326,9 @@ runtime·signalstack(byte *p, int32 n)
st.ss_flags = SS_DISABLE;
runtime·sigaltstack(&st, nil);
}
void
runtime·unblocksignals(void)
{
runtime·sigprocmask(SIG_SETMASK, &sigset_none, nil);
}
......@@ -18,6 +18,7 @@ void runtime·setitimer(int32, Itimerval*, Itimerval*);
void runtime·sigaction(int32, struct sigaction*, struct sigaction*);
void runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
void runtime·sigprocmask(int32, Sigset*, Sigset*);
void runtime·unblocksignals(void);
int32 runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
extern void runtime·lwp_tramp(void);
......
......@@ -300,3 +300,9 @@ runtime·signalstack(byte *p, int32 n)
st.ss_flags = SS_DISABLE;
runtime·sigaltstack(&st, nil);
}
void
runtime·unblocksignals(void)
{
runtime·sigprocmask(SIG_SETMASK, &sigset_none);
}
......@@ -18,6 +18,7 @@ void runtime·setitimer(int32, Itimerval*, Itimerval*);
void runtime·sigaction(int32, struct sigaction*, struct sigaction*);
void runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
Sigset runtime·sigprocmask(int32, Sigset);
void runtime·unblocksignals(void);
int32 runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
#define NSIG 33
......
......@@ -113,6 +113,7 @@ runtime·crash(void)
return;
#endif
runtime·unblocksignals();
runtime·setsig(SIGABRT, SIG_DFL, false);
runtime·raise(SIGABRT);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment