Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3676 closed defect (fixed)

Errors when running r.li.* modules

Reported by: veroandreo Owned by: grass-dev@…
Priority: normal Milestone: 7.4.2
Component: Raster Version: svn-trunk
Keywords: r.li, landscape Cc:
CPU: x86-64 Platform: Linux

Description

I get different errors when trying to run different r.li.* modules. Here some examples:

r.li.shannon --overwrite input=landclass96 at PERMANENT config=forest_mov_win
output=forest_mov_win_sh
munmap_chunk(): invalid pointer

The map is created but cannot be read or displayed:

Failed to run command 'd.rast map=forest_mov_win_sh@user1'. Details:           
                                                                               
GRASS_INFO_WARNING(12641,1): LZ4 decompression error                           
GRASS_INFO_END(12641,1)                                                        
                                                                               
GRASS_INFO_ERROR(12641,2): Error uncompressing null data for row 474 of <forest_mov_win_sh>
GRASS_INFO_END(12641,2)                                                        

GRASS 7.7.svn (nc_spm_08_grass7):~ > r.univar forest_mov_win_sh
WARNING: LZ4 decompression error
ERROR: Error uncompressing null data for row 474 of <forest_mov_win_sh>

Further attempts:

r.mapcalc "forest = if(landclass96 == 5, 1, null())"
r.li.edgedensity input=forest config=forest_mov_win output=forest_edge_mw
double free or corruption (!prev) <<<--- THIS
Aborted (core dumped)

... but map is created and no error related to compression.

Instead, if I do something equivalent:

r.li.edgedensity --verbose input=landclass96@PERMANENT config=forest_mov_win output=forest_edge patch_type=5
munmap_chunk(): invalid pointer <<<--- THIS
Aborted (core dumped)

r.univar forest_edge
WARNING: LZ4 decompression error
ERROR: Error uncompressing null data for row 474 of <forest_edge>

I attach the config file for reproducibility. And here's the thread in grass-dev: https://lists.osgeo.org/pipermail/grass-dev/2018-October/090155.html with Markus' valgrind test.

Attachments (1)

forest_mov_win (93 bytes ) - added by veroandreo 5 years ago.
config file created with g.gui.rlisetup

Download all attachments as: .zip

Change History (8)

by veroandreo, 5 years ago

Attachment: forest_mov_win added

config file created with g.gui.rlisetup

comment:1 by veroandreo, 5 years ago

Here the results using grass74 relbranch:

GRASS 7.4.2svn (nc_spm_08_grass7):~ > r.li.shannon --overwrite input=landclass96@PERMANENT config=forest_mov_win output=forest_mov_win_sh
munmap_chunk(): invalid pointer
Aborted (core dumped)

GRASS 7.4.2svn (nc_spm_08_grass7):~ > d.rast forest_mov_win_sh
WARNING: LZ4 decompression error
ERROR: Error uncompressing null data for row 473 of <forest_mov_win_sh>

GRASS 7.4.2svn (nc_spm_08_grass7):~ > r.mapcalc "forest = if(landclass96 == 5, 1, null())" --o
GRASS 7.4.2svn (nc_spm_08_grass7):~ > r.li.edgedensity input=forest config=forest_mov_win output=forest_edge_mw --o
corrupted size vs. prev_size
Aborted (core dumped)

r.li.edgedensity --verbose input=landclass96@PERMANENT config=forest_mov_win output=forest_edge patch_type=5 --o
r.li.edgedensity complete. Raster map <forest_edge> created.

The last one worked... no idea

comment:2 by mmetz, 5 years ago

In 73488:

r.li: fix segfault in r.li.shannon (see #3676)

comment:3 by mmetz, 5 years ago

In 73489:

r.li: fix segfault in r.li.shannon (see #3676, backport trunk r73488)

comment:4 by mmetz, 5 years ago

In 73490:

r.li: fix segfault in r.li.shannon (see #3676, backport trunk r73488)

comment:5 by mmetz, 5 years ago

The reason was that excessive rows were written to the output, causing memory corruption. Valgrind output is now clean for the mentioned test case and test commands, including the test commands with r.li.edgedensity.

comment:6 by veroandreo, 5 years ago

Resolution: fixed
Status: newclosed

Tested in trunk and 74 relbranch, no more errors. Thanks! Closing

comment:7 by martinl, 5 years ago

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