summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-03 03:18:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-03 03:18:49 +0000
commit24bcd4ce67f2e59b051a7224379b259484411790 (patch)
treef94ed8382baf496d73460c325d24f76937e8bb59 /signal.c
parentd7de38ff62f15ab0d205a83b49ae037648fc8d28 (diff)
downloadruby-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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/signal.c b/signal.c
index b07a99db15..96277e322c 100644
--- a/signal.c
+++ b/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