ostringstream tss;
tss << ceph_clock_now();
- char buf[8096];
+ g_assert_condition = "abort";
+ g_assert_file = file;
+ g_assert_line = line;
+ g_assert_func = func;
+ g_assert_thread = (unsigned long long)pthread_self();
+ ceph_pthread_getname(pthread_self(), g_assert_thread_name,
+ sizeof(g_assert_thread_name));
+
BackTrace *bt = new BackTrace(1);
- snprintf(buf, sizeof(buf), "%s: In function '%s' thread %llx time %s\n"
+ snprintf(g_assert_msg, sizeof(g_assert_msg),
+ "%s: In function '%s' thread %llx time %s\n"
"%s: %d: abort()\n", file, func, (unsigned long long)pthread_self(),
tss.str().c_str(), file, line);
- dout_emergency(msg);
+ dout_emergency(g_assert_msg);
// TODO: get rid of this memory allocation.
ostringstream oss;
dout_emergency(oss.str());
if (g_assert_context) {
- lderr(g_assert_context) << buf << std::endl;
+ lderr(g_assert_context) << g_assert_msg << std::endl;
*_dout << oss.str() << dendl;
// dump recent only if the abort signal handler won't do it for us
ostringstream tss;
tss << ceph_clock_now();
- char buf[8096];
- BufAppender ba(buf, sizeof(buf));
+ g_assert_condition = "abort";
+ g_assert_file = file;
+ g_assert_line = line;
+ g_assert_func = func;
+ g_assert_thread = (unsigned long long)pthread_self();
+ ceph_pthread_getname(pthread_self(), g_assert_thread_name,
+ sizeof(g_assert_thread_name));
+
+ BufAppender ba(g_assert_msg, sizeof(g_assert_msg));
BackTrace *bt = new BackTrace(1);
ba.printf("%s: In function '%s' thread %llx time %s\n"
"%s: %d: abort()\n",
ba.vprintf(msg, args);
va_end(args);
ba.printf("\n");
- dout_emergency(buf);
+ dout_emergency(g_assert_msg);
// TODO: get rid of this memory allocation.
ostringstream oss;
dout_emergency(oss.str());
if (g_assert_context) {
- lderr(g_assert_context) << buf << std::endl;
+ lderr(g_assert_context) << g_assert_msg << std::endl;
*_dout << oss.str() << dendl;
// dump recent only if the abort signal handler won't do it for us