Delete Velocity Functions ... crashes VA
Brought to you by:
billmenger,
seismick
In VA, if one selects File menu then Delete Velocity Functions...
the default option is delete ALL velocity functions
Clicking on Apply results in a Segmentation Fault.
If you select delete SELECTED velocity function or
delete EMPTY velocity functions,
VA survives. One can even undo the deletion.
This bug was observed in platforms x86_64_gfortran_mpich2 and i686_intel91_mpich2.
The seg fault only seems to happen when the velocity functions have been
loaded from a file. If one loads semblance and CMP files, and picks a few
velocities, then it is possible to delete all velocities without crashing
va. The velocities are deleted and a backup file is written.
Now if the velocity functions came from a file, the backup file is
written, but the abort occurs before the ISO velocity plot is updated.
First crash happens in VaIsoPlotter::getFileParameters,
which tries to access _xlocations and _ylocations, that have been wiped
out. So test if _number_locations_in_file is zero and bail out, but it
only survives briefly, then crashes a few function calls later.
It is necessary to disable the ISO velocity window as well.
So add the following to VaIsoPlotter::getFileParameters in file
va_iso_plotter.cc just before the for loop (line 437 or 438):
/ Jan 2018 - avoid crashing when no functions left to plot /
if(_number_locations_in_file < 1) {
_iso_plot->showIsoWindow(false);
return stat;}