Created
September 13, 2012 20:31
-
-
Save anonymous/3717397 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 4f1abfb33cc4685c52b24a7ac15896ea04703655 Mon Sep 17 00:00:00 2001 | |
From: Josh Durgin <josh.durgin@inktank.com> | |
Date: Thu, 13 Sep 2012 13:01:11 -0700 | |
Subject: [PATCH] librbd: catch sigpfe and print debug info | |
--- | |
src/librbd.cc | 13 +++++++++++++ | |
1 files changed, 13 insertions(+), 0 deletions(-) | |
diff --git a/src/librbd.cc b/src/librbd.cc | |
index e7e0932..11f01c3 100644 | |
--- a/src/librbd.cc | |
+++ b/src/librbd.cc | |
@@ -31,6 +31,7 @@ | |
#include <map> | |
#include <string> | |
#include <vector> | |
+#include <signal.h> | |
#define dout_subsys ceph_subsys_rbd | |
#undef dout_prefix | |
@@ -543,7 +544,19 @@ namespace librbd { | |
start_time = ceph_clock_now(ictx->cct); | |
} | |
+ static void debug_sigfpe(int signo, siginfo_t *info, void *opaque) | |
+ { | |
+ printf("got SIGFPE! si_code = %d address = %p\n", info->si_code, | |
+ info->si_addr); | |
+ assert(0); | |
+ } | |
+ | |
void complete() { | |
+ struct sigaction action; | |
+ action.sa_flags = SA_SIGINFO; | |
+ action.sa_sigaction = debug_sigfpe; | |
+ sigaction(SIGFPE, &action, NULL); | |
+ | |
utime_t elapsed; | |
assert(lock.is_locked()); | |
ldout(ictx->cct, 20) << "start_time sec = " << start_time.tv.tv_sec | |
-- | |
1.7.2.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment