From: Anthony Geay Date: Fri, 6 Jan 2023 16:59:00 +0000 (+0100) Subject: A service to generate artificialy SIGSEGV to test robustness of high level layers X-Git-Tag: V9_11_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5ef0ddb7e1f5d308f03a3a7f3cba7a187a2ddaa;p=modules%2Fkernel.git A service to generate artificialy SIGSEGV to test robustness of high level layers --- 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 %{