diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-03 03:18:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-03 03:18:49 +0000 |
commit | 24bcd4ce67f2e59b051a7224379b259484411790 (patch) | |
tree | f94ed8382baf496d73460c325d24f76937e8bb59 /signal.c | |
parent | d7de38ff62f15ab0d205a83b49ae037648fc8d28 (diff) | |
download | ruby-24bcd4ce67f2e59b051a7224379b259484411790.tar.gz |
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
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 |