Opened 8 years ago

Last modified 4 years ago

#3115 new defect

v.kriging: segfault if a parameter is not set

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Addons Version: unspecified
Keywords: v.kriging required parameter segfault Cc:
CPU: Unspecified Platform: Unspecified

Description

In the v.kriging addon, when I only provide the parameters marked as required (+ the -2 flag for 2D interpolation) I get the following:

v.extract elev_lid792_randpts out=elev_lid792_selected random=500 --o
v.kriging -2 input=elev_lid792_selected@user1 phase=initial icolumn=value
WARNING: Not recommended to process for sparse or spatially heterogeneous
         data. The result can be inaccurate - trying to solve asap...
Reading coordinates...
Segmentation fault

I have to add the report parameter for it to work:

v.kriging -2 input=elev_lid792_selected@user1 phase=initial icolumn=value report=report.txt

At this stage, two unasked-for files are in the same directory: dataE.dat and variogram_hz_tmp.txt.

Required parameters should be declared as such and not lead to a segfault. And any temporary files created during the run of the module should be erased at the end.

Change History (6)

comment:1 by neteler, 8 years ago

Milestone: 7.0.57.0.6

comment:2 by mlennert, 8 years ago

Response from Eva on the ML:

On 04/10/16 22:00, Eva Stopková wrote:

2016-08-04 15:42 GMT+02:00 GRASS GIS <trac@… <mailto:trac@…>>:

#3115: v.kriging: segfault if a parameter is not set -------------------------------------------------+-------------------------

Reporter: mlennert | Owner:

grass-dev@…

Type: defect | Status: new

Priority: normal | Milestone: 7.0.5

Component: Addons | Version: unspecified

Keywords: v.kriging required parameter | CPU:

Unspecified

segfault |

Platform: Unspecified |

-------------------------------------------------+-------------------------

In the v.kriging addon, when I only provide the parameters marked as required (+ the -2 flag for 2D interpolation) I get the following:

     v.extract elev_lid792_randpts out=elev_lid792_selected random=500 --o
     v.kriging -2 input=elev_lid792_selected@user1 phase=initial
    icolumn=value
     WARNING: Not recommended to process for sparse or spatially
    heterogeneous
              data. The result can be inaccurate - trying to solve asap...
     Reading coordinates...
     Segmentation fault

I have to add the report parameter for it to work:

     v.kriging -2 input=elev_lid792_selected@user1 phase=initial
    icolumn=value
     report=report.txt

I have fixed the bug like this: if the report name is missing, just initial phase (preliminary experimental variogram computation) is performed and the user is asked to repeat it with non-empty report parameter if he wish to continue with theoretical variogram and interpolation.

At this stage, two unasked-for files are in the same directory:

dataE.dat

and variogram_hz_tmp.txt.

Required parameters should be declared as such and not lead to a

segfault.

And any temporary files created during the run of the module should be erased at the end.

These temporary files are necessary, as they store settings and results from previous phases to be available in current phase of interpolation. And the process needs to be splitted into phases, because there is an interaction with the user needed (theoretical parameters settings according to experimental variogram). Unfortunatelly, this is not possible to manage interactively during module performance.

As these files are unasked-for indeed, I have added the information about them into command output: If initial phase is successfully accomplished, the user is warned not to erase temporary files <dataE.dat> and <variogram_hz_tmp.txt>. They are deleted in middle (final) phase automatically, but in previous module version, the user had been informed just in case that they were missing accidentally.

Changes are in r69676.

This sounds like a good solution. Thank you !

Another option would be to split the module into three modules. That way for each phase you can clearly define the inputs and outputs. It might make it clearer for the user. On the other hand, I understand the reasoning behind one module for kriging...

IMHO, this really calls for a GUI wrapper above the module (or modules) that makes the different calls, based on interactive input from the user.

Moritz

P.S. When responding to bug tickets, it is always better to do this within the bug tracker, including a reference to the changeset in svn, so that your responses are logged there.

comment:3 by neteler, 6 years ago

Milestone: 7.0.67.0.7

comment:4 by martinl, 5 years ago

Milestone: 7.0.7

comment:5 by martinl, 5 years ago

Remove Milestone from Addons bugreports.

comment:6 by neteler, 4 years ago

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.