Project

General

Profile

Actions

Bug #4733

open

Decode exception descriptions don't show function name

Added by David Zafman about 11 years ago. Updated over 10 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Using in progress import code with a bad data file shows that thrown exception has bad description. The PRETTY_FUNCTION isn't a macro but rather a string.

$ ./ceph_filestore_dump --filestore-path dev/osd1 --journal-path dev/osd1.journal --type import --file badfile
Importing pgid 3.0
do_import threw exception error buffer::malformed_input: PRETTY_FUNCTION decode past end of struct encoding
Corrupt input for import

Example of possible fix for one of the macros:

$ git diff include
diff --git a/src/include/encoding.h b/src/include/encoding.h
index eb445e3..fa66f49 100644
--- a/src/include/encoding.h
+++ b/src/include/encoding.h
@ -718,8 +718,16 @ inline void decode(std::deque<T>& ls, bufferlist::iterator& p)
#define DECODE_ERR_OLDVERSION(func, v) \
"" #func " no longer understand old encoding version < " #v

#if 0
#define DECODE_ERR_PAST(func) \
"" #func " decode past end of struct encoding"
#endif

+inline const char *DECODE_ERR_PAST(const char *func) {
static std::string foo(func);
+ foo = " decode past end of struct encoding";
return foo.c_str();
+}

/**
 * check for very old encoding

$ ./ceph_filestore_dump --filestore-path dev/osd1 --journal-path dev/osd1.journal --type import --file foo.couldabort
Importing pgid 3.0
do_import threw exception error buffer::malformed_input: void pg_stat_t::decode(ceph::buffer::list::iterator&) decode past end of struct encoding
Corrupt input for import

Actions #1

Updated by David Zafman almost 11 years ago

  • Project changed from CephFS to Ceph
Actions #2

Updated by Sage Weil almost 11 years ago

  • Assignee set to David Zafman
  • Priority changed from Normal to High
Actions #3

Updated by Sage Weil almost 11 years ago

  • Priority changed from High to Low
Actions #4

Updated by Ian Colle over 10 years ago

  • Assignee deleted (David Zafman)
Actions

Also available in: Atom PDF