зеркало из https://github.com/github/ruby.git
signal.c: fault address
* signal.c (sigbus, sigsegv): show fault address in the bug message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d7de38ff62
Коммит
24bcd4ce67
11
signal.c
11
signal.c
|
@ -641,11 +641,16 @@ check_stack_overflow(const void *addr)
|
|||
#ifdef _WIN32
|
||||
#define CHECK_STACK_OVERFLOW() check_stack_overflow(0)
|
||||
#else
|
||||
#define CHECK_STACK_OVERFLOW() check_stack_overflow(info->si_addr)
|
||||
#define FAULT_ADDRESS info->si_addr
|
||||
#define CHECK_STACK_OVERFLOW() check_stack_overflow(FAULT_ADDRESS)
|
||||
#define MESSAGE_FAULT_ADDRESS " at %p", FAULT_ADDRESS
|
||||
#endif
|
||||
#else
|
||||
#define CHECK_STACK_OVERFLOW() (void)0
|
||||
#endif
|
||||
#ifndef MESSAGE_FAULT_ADDRESS
|
||||
#define MESSAGE_FAULT_ADDRESS
|
||||
#endif
|
||||
|
||||
#ifdef SIGBUS
|
||||
static RETSIGTYPE
|
||||
|
@ -659,7 +664,7 @@ sigbus(int sig SIGINFO_ARG)
|
|||
#if defined __APPLE__
|
||||
CHECK_STACK_OVERFLOW();
|
||||
#endif
|
||||
rb_bug("Bus Error");
|
||||
rb_bug("Bus Error" MESSAGE_FAULT_ADDRESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -696,7 +701,7 @@ sigsegv(int sig SIGINFO_ARG)
|
|||
|
||||
segv_received = 1;
|
||||
ruby_disable_gc_stress = 1;
|
||||
rb_bug("Segmentation fault");
|
||||
rb_bug("Segmentation fault" MESSAGE_FAULT_ADDRESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче