Catch error inside SimulationWrapper::m_executePySimulation to get informative error message instead of failed assertion
In issue #1068 (closed), we had a segfault when ISimulation::simulate was called from the Python fit machinery in example fit/scatter2d/expfit_galaxi.py. By inserting the statement ASSERT(m_sample);
in ISimulation::simulate, the bug took the form of a failed assertion. The same assertion in the ISimulation constructor passed. So there was some memory corruption. The bug was fixed in !2914 (merged) by correcting an invalid constructor call in the Python function get_sample
.
While the immediate problem with fit/scatter2d/expfit_galaxi.py is resolved, the problem with memory corruption and the uniformative failure in ISimulation::simulate
is not. We need a mechanism that catches errors in SimulationWrapper::m_executePySimulation, and yields an informative error message.