From 62e4cdea62791c8b03fd4c47cadfd59bcb867908 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Mon, 3 Jan 2011 12:22:56 -0800 Subject: [PATCH] common: print thread ID in sig handlers and assert Signed-off-by: Colin McCabe --- src/common/assert.cc | 3 ++- src/config.cc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/assert.cc b/src/common/assert.cc index ca28bbf776794..e80cb36297268 100644 --- a/src/common/assert.cc +++ b/src/common/assert.cc @@ -13,7 +13,8 @@ void __ceph_assert_fail(const char *assertion, const char *file, int line, const BackTrace *bt = new BackTrace(1); _dout_lock.Lock(); - *_dout << file << ": In function '" << func << "':" << std::endl; + *_dout << file << ": In function '" << func << "', " + << "In thread " << pthread_self() << std::endl; *_dout << file << ":" << line << ": FAILED assert(" << assertion << ")" << std::endl; bt->print(*_dout); *_dout << " NOTE: a copy of the executable, or `objdump -rdS ` is needed to interpret this." << std::endl; diff --git a/src/config.cc b/src/config.cc index 12b135b75838a..cf0333511bb00 100644 --- a/src/config.cc +++ b/src/config.cc @@ -243,6 +243,7 @@ void handle_fatal_signal(int signum) { *_dout << "*** Caught signal (" << sys_siglist[signum] << ") ***" << std::endl; + *_dout << "in thread " << pthread_self() << std::endl; BackTrace bt(0); bt.print(*_dout); _dout->flush(); -- 2.39.5