From 10fc8a24fcba822656b5679dd34b149c817d3101 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Thu, 13 Nov 2014 14:57:23 +0100 Subject: [PATCH] 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 --- src/tools/psim.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tools/psim.cc b/src/tools/psim.cc index 6ea5a5dbf65e..3022b1c15042 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); -- 2.47.3