From: Danny Al-Gaaf Date: Thu, 13 Nov 2014 13:57:23 +0000 (+0100) Subject: tools/psim.cc: catch ceph::buffer::end_of_buffer exception X-Git-Tag: v0.90~25^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=10fc8a24fcba822656b5679dd34b149c817d3101;p=ceph.git tools/psim.cc: catch ceph::buffer::end_of_buffer exception Fix for: CID 717163 (#1 of 1): Uncaught exception (UNCAUGHT_EXCEPT) root_function: In function main(int, char **) an exception of type ceph::buffer::end_of_buffer is thrown and never caught. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/tools/psim.cc b/src/tools/psim.cc index 6ea5a5dbf65..3022b1c1504 100644 --- a/src/tools/psim.cc +++ b/src/tools/psim.cc @@ -1,3 +1,5 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab #include "osd/OSDMap.h" #include "include/buffer.h" @@ -15,7 +17,13 @@ int main(int argc, char **argv) return 1; } OSDMap osdmap; - osdmap.decode(bl); + + try { + osdmap.decode(bl); + } catch (ceph::buffer::end_of_buffer &eob) { + cout << "Exception (end_of_buffer) in decode(), exit." << std::endl; + exit(1); + } //osdmap.set_primary_affinity(0, 0x8000); //osdmap.set_primary_affinity(3, 0);