зеркало из https://github.com/mozilla/gecko-dev.git
Bug 720704 - Avoid setting an alternative stack for signals if there is already one. r=ted
This commit is contained in:
Родитель
4e017cf537
Коммит
0119d534ac
|
@ -190,14 +190,18 @@ bool ExceptionHandler::InstallHandlers() {
|
|||
// such a small stack.
|
||||
static const unsigned kSigStackSize = 8192;
|
||||
|
||||
signal_stack = malloc(kSigStackSize);
|
||||
stack_t stack;
|
||||
// Only set an alternative stack if there isn't already one, or if the current
|
||||
// one is too small.
|
||||
if (sys_sigaltstack(NULL, &stack) == -1 || !stack.ss_sp ||
|
||||
stack.ss_size < kSigStackSize) {
|
||||
memset(&stack, 0, sizeof(stack));
|
||||
stack.ss_sp = signal_stack;
|
||||
stack.ss_sp = malloc(kSigStackSize);
|
||||
stack.ss_size = kSigStackSize;
|
||||
|
||||
if (sys_sigaltstack(&stack, NULL) == -1)
|
||||
return false;
|
||||
}
|
||||
|
||||
struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
|
|
|
@ -259,7 +259,6 @@ class ExceptionHandler {
|
|||
const char* next_minidump_id_c_;
|
||||
|
||||
const bool handler_installed_;
|
||||
void* signal_stack; // the handler stack.
|
||||
HandlerCallback crash_handler_;
|
||||
|
||||
// The global exception handler stack. This is need becuase there may exist
|
||||
|
|
Загрузка…
Ссылка в новой задаче