lpsxsim crashes when loading a saved trace.
jgroote opened this issue · 3 comments
lpsxsim on for instance abp.lps crashes, when after some simulation steps,
the trace is saved, then some more simulation steps are done, and the same
trace is loaded again with a segmentation fault.
This problem occurs in the 2023 release, and also in the current development version.
The problem seems to only occur when the loaded trace is shorter than the trace
in the simulator window.
The problem is caused in the function updateSimulation. If within this function the size of the new trace window at the right was set outside of the current selection, Qt would invoke the routine that the selection was changed, which would in turn call updateSimulation again. During this second call, the size of the new window would be set again, while the internal qt data structures were in disarray. This would subsequently lead to a crash.
The problem is provisionally solved by not allowing updateSimulation to be recursively executed.
Resolved.