livedumper: Catch an uncatched exception 79/318679/1 accepted/tizen/unified/20250124.105414 accepted/tizen/unified/x/20250125.012758
authorSung-hun Kim <sfoon.kim@samsung.com>
Wed, 22 Jan 2025 05:35:58 +0000 (14:35 +0900)
committerSung-hun Kim <sfoon.kim@samsung.com>
Wed, 22 Jan 2025 05:35:58 +0000 (14:35 +0900)
Class Guardian can raise std::bad_function_call exception if wrong functions provided.
In this case, the caller should catch the exception (coverity issue number: 1836347).

Change-Id: Ia5ed46fb3d44ff40149a5dc719814b147b405972
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
src/livedumper/livedumper.hpp

index abda9e3668398c02e483d1950c65b5901a9955a1..a59095969f5cf6f03e0a6eab8fbe680708725add 100644 (file)
@@ -227,6 +227,9 @@ class LiveDumper {
                                m_core.SaveStacks(mem_fd, m_core_file, m_tpids, m_registers);
                        }
                        close(mem_fd);
+               } catch (std::bad_function_call &e) {
+                       logger.log_error("DumpCore: %s", e.what());
+                       result = false;
                } catch (std::system_error &e) {
                        logger.log_error("DumpCore: %s", e.what());
                        result = false;