From e5ef0ddb7e1f5d308f03a3a7f3cba7a187a2ddaa Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 6 Jan 2023 17:59:00 +0100 Subject: [PATCH] A service to generate artificialy SIGSEGV to test robustness of high level layers --- src/KernelHelpers/KernelServices.cxx | 9 +++++++++ src/KernelHelpers/KernelServices.hxx | 1 + src/KernelHelpers/KernelServices.i | 1 + 3 files changed, 11 insertions(+) diff --git a/src/KernelHelpers/KernelServices.cxx b/src/KernelHelpers/KernelServices.cxx index e2ef5b3a4..3d571e847 100644 --- a/src/KernelHelpers/KernelServices.cxx +++ b/src/KernelHelpers/KernelServices.cxx @@ -33,3 +33,12 @@ std::string RetrieveCompoInternal(const std::string& compoName) CORBA::String_var ior = orb->object_to_string(obj); return std::string(ior.in()); } + +/*! + * This method generates a SIGSEGV to test robustness of higher level layers. + */ +void GenerateViolentMemoryFaultForTestPurpose() +{ + double *a = nullptr; + *a = 0; +} diff --git a/src/KernelHelpers/KernelServices.hxx b/src/KernelHelpers/KernelServices.hxx index f41efaf73..9495a8b52 100644 --- a/src/KernelHelpers/KernelServices.hxx +++ b/src/KernelHelpers/KernelServices.hxx @@ -22,4 +22,5 @@ void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR); std::string RetrieveCompoInternal(const std::string& compoName); +void GenerateViolentMemoryFaultForTestPurpose(); #endif diff --git a/src/KernelHelpers/KernelServices.i b/src/KernelHelpers/KernelServices.i index bef3f1613..8f148b6cd 100644 --- a/src/KernelHelpers/KernelServices.i +++ b/src/KernelHelpers/KernelServices.i @@ -58,6 +58,7 @@ public: { void RegisterCompoInternal(const std::string& compoName, const std::string& compoIOR); std::string RetrieveCompoInternal(const std::string& compoName); + void GenerateViolentMemoryFaultForTestPurpose(); } %pythoncode %{ -- 2.39.2