grass
grass copied to clipboard
[Bug] Potential memory leak in r.random.surface
Describe the bug
This is a followup to "[GRASS-user] v.rast.stats error: "Unable to seek"":
Hypothesis: memory leak in r.random.surface
See: https://lists.osgeo.org/pipermail/grass-user/2021-May/082433.html
To Reproduce Steps to reproduce the behavior:
GRASS GIS 7.8.6dev (d58024373)
grass78 /mnt/data/grassdata/nc_spm_08_grass7/user1
g.region n=10000000 s=0 w=0 e=10000000 nsres=300 ewres=300 -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 10000000
south: 0
west: 0
east: 10000000
nsres: 300.00300003
ewres: 300.00300003
rows: 33333
cols: 33333
cells: 1111088889
# https://grasswiki.osgeo.org/wiki/GRASS_Debugging#Using_Valgrind
CMD="r.random.surface output=random seed=420 distance=1000 --overwrite"
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes $CMD --o
==337854== Memcheck, a memory error detector
==337854== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==337854== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==337854== Command: r.random.surface output=random seed=420 distance=1000 --overwrite --o
...
100%
Writing raster map <random>...
100%
r.random.surface complete.
==337854==
==337854== HEAP SUMMARY:
==337854== in use at exit: 17,779,869,154 bytes in 67,028 blocks
==337854== total heap usage: 237,482 allocs, 170,454 frees, 42,389,338,619 bytes allocated
==337854==
[...]
==337854== 266,664 bytes in 1 blocks are still reachable in loss record 79 of 85
==337854== at 0x483C7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890140: G__malloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x10B938: Init (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854== by 0x10A982: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== 266,672 bytes in 1 blocks are still reachable in loss record 80 of 85
==337854== at 0x483ED99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890218: G__calloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x4868D46: ??? (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_raster.7.8.so)
==337854== by 0x10A9C3: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== 266,672 bytes in 1 blocks are still reachable in loss record 81 of 85
==337854== at 0x483ED99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890218: G__calloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x4868CD1: ??? (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_raster.7.8.so)
==337854== by 0x10A9C3: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== 266,672 bytes in 1 blocks are still reachable in loss record 82 of 85
==337854== at 0x483ED99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890218: G__calloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x4868D46: ??? (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_raster.7.8.so)
==337854== by 0x10CA61: SaveMap (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854== by 0x10AB33: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== 1,866,760 bytes in 7 blocks are possibly lost in loss record 83 of 85
==337854== at 0x483C7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890140: G__malloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x10AF03: CalcSurface (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854== by 0x10AB16: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== 8,887,911,040 bytes in 33,328 blocks are definitely lost in loss record 84 of 85
==337854== at 0x483C7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890140: G__malloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x10AF03: CalcSurface (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854== by 0x10AB16: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== 8,888,711,112 bytes in 33,333 blocks are still reachable in loss record 85 of 85
==337854== at 0x483C7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==337854== by 0x4890140: G__malloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==337854== by 0x10B979: Init (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854== by 0x10A982: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==337854==
==337854== LEAK SUMMARY:
==337854== definitely lost: 8,887,922,676 bytes in 33,356 blocks
==337854== indirectly lost: 8,450 bytes in 255 blocks
==337854== possibly lost: 1,866,760 bytes in 7 blocks
==337854== still reachable: 8,890,071,268 bytes in 33,410 blocks
==337854== suppressed: 0 bytes in 0 blocks
==337854==
==337854== For lists of detected and suppressed errors, rerun with: -s
==337854== ERROR SUMMARY: 30 errors from 30 contexts (suppressed: 0 from 0)
The same with even more pixels in the current region:
g.region n=10000000 s=0 w=0 e=10000000 nsres=100 ewres=100 -p
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes $CMD --o
[...]
==339803== 23,951,200,000 bytes in 29,939 blocks are still reachable in loss record 985 of 985
==339803== at 0x483C7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==339803== by 0x4890140: G__malloc (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.7.8.so)
==339803== by 0x10B979: Init (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==339803== by 0x10A982: main (in /home/mundialis/software/grass78_git/dist.x86_64-pc-linux-gnu/bin/r.random.surface)
==339803==
==339803== LEAK SUMMARY:
==339803== definitely lost: 800,043 bytes in 3 blocks
==339803== indirectly lost: 0 bytes in 0 blocks
==339803== possibly lost: 0 bytes in 0 blocks
==339803== still reachable: 23,952,327,868 bytes in 31,721 blocks
==339803== suppressed: 0 bytes in 0 blocks
==339803==
==339803== For lists of detected and suppressed errors, rerun with: -s
==339803== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
dmesg
[1339276.916366] Out of memory: Killed process 337202 (r.random.surfac) total-vm:78457296kB, anon-rss:15662724kB, file-rss:2384kB, shmem-rss:0kB, UID:1001 pgtables:153476kB oom_score_adj:0
[1339277.314115] oom_reaper: reaped process 337202 (r.random.surfac), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Including file-swap my test machine has 35 GB of RAM.
System description (please complete the following information):
- Operating System: Ubuntu 20.10
- GRASS GIS version
g.version -rge
version=7.8.6dev
date=2021
revision=d58024373
build_date=2021-05-15
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8
libgis_revision=9aa325a6b
libgis_date=2021-03-26T12:53:51+00:00
proj=7.1.0
gdal=3.1.3
geos=3.8.1
sqlite=3.33.0
The memory allocation in question is here (this and the next line):
https://github.com/OSGeo/grass/blob/802b3c84beaad21ad15056257e50f19ff6cb951c/raster/r.random.surface/calcsurf.c#L37
Randoms gets free’d but not the Randoms[Row]s:
https://github.com/OSGeo/grass/blob/802b3c84beaad21ad15056257e50f19ff6cb951c/raster/r.random.surface/calcsurf.c#L39
Perhaps that’s the culprit?
Randomsgets free’d but not theRandoms[Row]s:https://github.com/OSGeo/grass/blob/802b3c84beaad21ad15056257e50f19ff6cb951c/raster/r.random.surface/calcsurf.c#L39
Perhaps that’s the culprit?
That is a culprit. The major one. However, there are many other areas where memory was allocated, but not freed. I have corrected the majority of the memory leaks and have retested:
g.region n=10000000 s=0 w=0 e=10000000 nsres=300 ewres=300 -p
projection: 99 (NAD83(HARN) / Nevada East)
zone: 0
datum: nad83harn
ellipsoid: grs80
north: 10000000
south: 0
west: 0
east: 10000000
nsres: 300.00300003
ewres: 300.00300003
rows: 33333
cols: 33333
cells: 1111088889
CMD="r.random.surface output=random seed=420 distance=1000 --overwrite"
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes $CMD --o
==11948== Memcheck, a memory error detector
==11948== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==11948== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==11948== Command: r.random.surface output=random seed=420 distance=1000 --overwrite --o
==11948==
Generating raster map <random>...
100%
Writing raster map <random>...
100%
r.random.surface complete.
==11948==
==11948== HEAP SUMMARY:
==11948== in use at exit: 984,212 bytes in 343 blocks
==11948== total heap usage: 237,476 allocs, 237,133 frees, 42,396,840,248 bytes allocated
==11948==
==11948== 1 bytes in 1 blocks are definitely lost in loss record 1 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9FC: Rast_short_history (history.c:236)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 1 bytes in 1 blocks are definitely lost in loss record 2 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486FA10: Rast_short_history (history.c:237)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 1 bytes in 1 blocks are definitely lost in loss record 3 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9FC: Rast_short_history (history.c:236)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 1 bytes in 1 blocks are definitely lost in loss record 4 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486FA10: Rast_short_history (history.c:237)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 5 bytes in 1 blocks are definitely lost in loss record 5 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9BA: Rast_short_history (history.c:233)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 5 bytes in 1 blocks are definitely lost in loss record 6 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9BA: Rast_short_history (history.c:233)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 7 bytes in 1 blocks are still reachable in loss record 7 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48B4FF7: G_add_keyword (parser.c:858)
==11948== by 0x10A6FA: main (main.c:58)
==11948==
==11948== 7 bytes in 1 blocks are still reachable in loss record 8 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48B4FF7: G_add_keyword (parser.c:858)
==11948== by 0x10A712: main (main.c:60)
==11948==
==11948== 7 bytes in 1 blocks are still reachable in loss record 9 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x4871526: open_raster_new (open.c:614)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 7 bytes in 1 blocks are definitely lost in loss record 10 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F990: Rast_short_history (history.c:231)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 7 bytes in 1 blocks are definitely lost in loss record 11 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9CA: Rast_short_history (history.c:234)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 7 bytes in 1 blocks are definitely lost in loss record 12 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F990: Rast_short_history (history.c:231)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 7 bytes in 1 blocks are definitely lost in loss record 13 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9CA: Rast_short_history (history.c:234)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 8 bytes in 1 blocks are still reachable in loss record 14 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48B4FF7: G_add_keyword (parser.c:858)
==11948== by 0x10A706: main (main.c:59)
==11948==
==11948== 10 bytes in 1 blocks are still reachable in loss record 15 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x4871531: open_raster_new (open.c:615)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 10 bytes in 1 blocks are definitely lost in loss record 16 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48A06B7: find_file (find_file.c:147)
==11948== by 0x48B2F35: G__open (open.c:77)
==11948== by 0x48B318B: G_fopen_old (open.c:257)
==11948== by 0x48A2570: G_get_element_window (get_window.c:116)
==11948== by 0x48A2801: G_get_window (get_window.c:69)
==11948== by 0x48CA567: G__init_window (window_map.c:81)
==11948== by 0x48789E4: Rast__init_window (set_window.c:29)
==11948== by 0x487965C: Rast_window_rows (window.c:87)
==11948== by 0x10B9FB: Init (init.c:24)
==11948==
==11948== 10 bytes in 1 blocks are definitely lost in loss record 17 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9A5: Rast_short_history (history.c:232)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 10 bytes in 1 blocks are definitely lost in loss record 18 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48A06B7: find_file (find_file.c:147)
==11948== by 0x4872256: Rast_map_type (open.c:885)
==11948== by 0x4875C36: Rast_write_range (range.c:378)
==11948== by 0x4864AA6: write_support_files (close.c:229)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 10 bytes in 1 blocks are definitely lost in loss record 19 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48A06B7: find_file (find_file.c:147)
==11948== by 0x4871F66: Rast_map_is_fp (open.c:852)
==11948== by 0x4863DCF: write_cats (cats.c:988)
==11948== by 0x4864B52: write_support_files (close.c:274)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 10 bytes in 1 blocks are definitely lost in loss record 20 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F9A5: Rast_short_history (history.c:232)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 10 bytes in 1 blocks are definitely lost in loss record 21 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48A06B7: find_file (find_file.c:147)
==11948== by 0x4871F66: Rast_map_is_fp (open.c:852)
==11948== by 0x4863DCF: write_cats (cats.c:988)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 16 bytes in 3 blocks are still reachable in loss record 22 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48B3D47: set_option (parser.c:1192)
==11948== by 0x48B61D7: G_parser (parser.c:586)
==11948== by 0x10A88A: main (main.c:116)
==11948==
==11948== 17 bytes in 1 blocks are still reachable in loss record 23 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48C22A5: G_set_program_name (progrm_nme.c:66)
==11948== by 0x48A2A4B: G__gisinit (gisinit.c:50)
==11948== by 0x10A6E6: main (main.c:55)
==11948==
==11948== 17 bytes in 1 blocks are still reachable in loss record 24 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48C2309: G_set_program_name (progrm_nme.c:80)
==11948== by 0x48A2A4B: G__gisinit (gisinit.c:50)
==11948== by 0x10A6E6: main (main.c:55)
==11948==
==11948== 17 bytes in 1 blocks are still reachable in loss record 25 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48B5201: G_parser (parser.c:333)
==11948== by 0x10A88A: main (main.c:116)
==11948==
==11948== 24 bytes in 1 blocks are still reachable in loss record 26 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B488D: G_define_option (parser.c:234)
==11948== by 0x10A76A: main (main.c:72)
==11948==
==11948== 24 bytes in 1 blocks are still reachable in loss record 27 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B488D: G_define_option (parser.c:234)
==11948== by 0x10A79E: main (main.c:81)
==11948==
==11948== 24 bytes in 1 blocks are still reachable in loss record 28 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B488D: G_define_option (parser.c:234)
==11948== by 0x10A7D9: main (main.c:89)
==11948==
==11948== 24 bytes in 1 blocks are still reachable in loss record 29 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B488D: G_define_option (parser.c:234)
==11948== by 0x10A80D: main (main.c:98)
==11948==
==11948== 24 bytes in 1 blocks are still reachable in loss record 30 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B488D: G_define_option (parser.c:234)
==11948== by 0x10A836: main (main.c:105)
==11948==
==11948== 24 bytes in 1 blocks are still reachable in loss record 31 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B47A5: G_define_flag (parser.c:178)
==11948== by 0x10A86A: main (main.c:112)
==11948==
==11948== 25 bytes in 1 blocks are still reachable in loss record 32 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x489F18D: G_init_logging.part.0 (error.c:369)
==11948== by 0x489F4B5: print_error (error.c:293)
==11948== by 0x489FB35: vfprint_error (error.c:79)
==11948== by 0x489FB35: G_message (error.c:96)
==11948== by 0x10A903: main (main.c:129)
==11948==
==11948== 25 bytes in 1 blocks are still reachable in loss record 33 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x489D570: G_date (date.c:46)
==11948== by 0x486F973: Rast_short_history (history.c:230)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 25 bytes in 1 blocks are definitely lost in loss record 34 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F980: Rast_short_history (history.c:230)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 25 bytes in 1 blocks are definitely lost in loss record 35 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F85B: Rast_set_history (history.c:196)
==11948== by 0x486F980: Rast_short_history (history.c:230)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 26 bytes in 1 blocks are definitely lost in loss record 36 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48A4E40: G__location_path (location.c:82)
==11948== by 0x48A4E8A: G_location_path (location.c:58)
==11948== by 0x48A2A6D: G__gisinit (gisinit.c:60)
==11948== by 0x10A6E6: main (main.c:55)
==11948==
==11948== 28 bytes in 6 blocks are still reachable in loss record 37 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B5AF7: split_opts (parser.c:1497)
==11948== by 0x48B5AF7: G_parser (parser.c:607)
==11948== by 0x10A88A: main (main.c:116)
==11948==
==11948== 30 bytes in 1 blocks are definitely lost in loss record 38 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4ACA177: __vasprintf_internal (vasprintf.c:71)
==11948== by 0x486F926: Rast_format_history (history.c:207)
==11948== by 0x486F9E8: Rast_short_history (history.c:235)
==11948== by 0x4864A73: write_support_files (close.c:224)
==11948== by 0x4864F96: close_new.isra.0 (close.c:514)
==11948== by 0x10CFA0: SaveMap (save.c:174)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 30 bytes in 1 blocks are definitely lost in loss record 39 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4ACA177: __vasprintf_internal (vasprintf.c:71)
==11948== by 0x486F926: Rast_format_history (history.c:207)
==11948== by 0x486F9E8: Rast_short_history (history.c:235)
==11948== by 0x10CFBA: SaveMap (save.c:175)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 31 bytes in 1 blocks are indirectly lost in loss record 40 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F4AB: Rast_append_history (history.c:32)
==11948== by 0x486FB1D: Rast_command_history (history.c:295)
==11948== by 0x10CFC2: SaveMap (save.c:176)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 33 bytes in 1 blocks are possibly lost in loss record 41 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x4862F2F: Rast_set_d_cat (cats.c:880)
==11948== by 0x4862F2F: Rast_set_d_cat (cats.c:808)
==11948== by 0x4863B55: Rast_sort_cats (cats.c:1306)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 46 bytes in 6 blocks are still reachable in loss record 42 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x489E6C2: set_env.part.0.isra.0 (env.c:246)
==11948== by 0x489E81F: set_env (env.c:198)
==11948== by 0x489E81F: parse_env (env.c:152)
==11948== by 0x489EB77: read_env (env.c:168)
==11948== by 0x489EB77: read_env.isra.0 (env.c:156)
==11948== by 0x489EC18: G_getenv_nofatal (env.c:403)
==11948== by 0x489EC18: G_getenv_nofatal (env.c:398)
==11948== by 0x489DB4B: G_init_debug (debug.c:34)
==11948== by 0x489DB4B: G_init_debug (debug.c:27)
==11948== by 0x489DC1C: G_debug (debug.c:71)
==11948== by 0x48C2326: G_set_program_name (progrm_nme.c:82)
==11948== by 0x48A2A4B: G__gisinit (gisinit.c:50)
==11948== by 0x10A6E6: main (main.c:55)
==11948==
==11948== 48 bytes in 1 blocks are definitely lost in loss record 43 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x4868AC6: add_color_rule (color_rule.c:250)
==11948== by 0x4868F1A: Rast_add_c_color_rule (color_rule.c:79)
==11948== by 0x10D1BD: SaveMap (save.c:213)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 53 bytes in 1 blocks are definitely lost in loss record 44 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48632EA: Rast_set_cats_title (cats.c:1175)
==11948== by 0x486331C: Rast_init_cats (cats.c:1147)
==11948== by 0x4863AFD: Rast_sort_cats (cats.c:1301)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 57 bytes in 6 blocks are still reachable in loss record 45 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x489E60B: set_env.part.0.isra.0 (env.c:203)
==11948== by 0x489E81F: set_env (env.c:198)
==11948== by 0x489E81F: parse_env (env.c:152)
==11948== by 0x489EB77: read_env (env.c:168)
==11948== by 0x489EB77: read_env.isra.0 (env.c:156)
==11948== by 0x489EC18: G_getenv_nofatal (env.c:403)
==11948== by 0x489EC18: G_getenv_nofatal (env.c:398)
==11948== by 0x489DB4B: G_init_debug (debug.c:34)
==11948== by 0x489DB4B: G_init_debug (debug.c:27)
==11948== by 0x489DC1C: G_debug (debug.c:71)
==11948== by 0x48C2326: G_set_program_name (progrm_nme.c:82)
==11948== by 0x48A2A4B: G__gisinit (gisinit.c:50)
==11948== by 0x10A6E6: main (main.c:55)
==11948==
==11948== 60 bytes in 1 blocks are still reachable in loss record 46 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48C6612: G_tempfile_pid (tempfile.c:94)
==11948== by 0x4871734: open_raster_new (open.c:627)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 60 bytes in 1 blocks are still reachable in loss record 47 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x48C6612: G_tempfile_pid (tempfile.c:94)
==11948== by 0x487188F: open_raster_new (open.c:706)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 70 bytes in 1 blocks are indirectly lost in loss record 48 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x486F4AB: Rast_append_history (history.c:32)
==11948== by 0x486FAD5: Rast_command_history (history.c:292)
==11948== by 0x10CFC2: SaveMap (save.c:176)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 80 bytes in 1 blocks are still reachable in loss record 49 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4898347: G__realloc (alloc.c:124)
==11948== by 0x48B5021: G_add_keyword (parser.c:854)
==11948== by 0x10A6FA: main (main.c:58)
==11948==
==11948== 117 (16 direct, 101 indirect) bytes in 1 blocks are definitely lost in loss record 50 of 70
==11948== at 0x4847C73: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4898314: G__realloc (alloc.c:126)
==11948== by 0x486F491: Rast_append_history (history.c:31)
==11948== by 0x486FB1D: Rast_command_history (history.c:295)
==11948== by 0x10CFC2: SaveMap (save.c:176)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 152 bytes in 1 blocks are still reachable in loss record 51 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B485D: G_define_option (parser.c:218)
==11948== by 0x10A76A: main (main.c:72)
==11948==
==11948== 152 bytes in 1 blocks are still reachable in loss record 52 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B485D: G_define_option (parser.c:218)
==11948== by 0x10A79E: main (main.c:81)
==11948==
==11948== 152 bytes in 1 blocks are still reachable in loss record 53 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B485D: G_define_option (parser.c:218)
==11948== by 0x10A7D9: main (main.c:89)
==11948==
==11948== 152 bytes in 1 blocks are still reachable in loss record 54 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B485D: G_define_option (parser.c:218)
==11948== by 0x10A80D: main (main.c:98)
==11948==
==11948== 152 bytes in 1 blocks are still reachable in loss record 55 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B485D: G_define_option (parser.c:218)
==11948== by 0x10A836: main (main.c:105)
==11948==
==11948== 160 bytes in 1 blocks are still reachable in loss record 56 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4898347: G__realloc (alloc.c:124)
==11948== by 0x48A2C73: alloc_handler (handler.c:49)
==11948== by 0x48A2C73: G_add_error_handler (handler.c:72)
==11948== by 0x486FD27: init (init.c:135)
==11948== by 0x486FD27: Rast__init (init.c:69)
==11948== by 0x486FD27: Rast__init (init.c:65)
==11948== by 0x48714B1: open_raster_new (open.c:591)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 480 bytes in 1 blocks are still reachable in loss record 57 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4898347: G__realloc (alloc.c:124)
==11948== by 0x489E758: set_env.part.0.isra.0 (env.c:239)
==11948== by 0x489E81F: set_env (env.c:198)
==11948== by 0x489E81F: parse_env (env.c:152)
==11948== by 0x489EB77: read_env (env.c:168)
==11948== by 0x489EB77: read_env.isra.0 (env.c:156)
==11948== by 0x489EC18: G_getenv_nofatal (env.c:403)
==11948== by 0x489EC18: G_getenv_nofatal (env.c:398)
==11948== by 0x489DB4B: G_init_debug (debug.c:34)
==11948== by 0x489DB4B: G_init_debug (debug.c:27)
==11948== by 0x489DC1C: G_debug (debug.c:71)
==11948== by 0x48C2326: G_set_program_name (progrm_nme.c:82)
==11948== by 0x48A2A4B: G__gisinit (gisinit.c:50)
==11948== by 0x10A6E6: main (main.c:55)
==11948==
==11948== 480 bytes in 6 blocks are still reachable in loss record 58 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48B5A63: split_opts (parser.c:1486)
==11948== by 0x48B5A63: G_parser (parser.c:607)
==11948== by 0x10A88A: main (main.c:116)
==11948==
==11948== 1,012 bytes in 1 blocks are definitely lost in loss record 59 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x4863AB3: Rast_sort_cats (cats.c:1296)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 1,024 bytes in 1 blocks are definitely lost in loss record 60 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x4863090: Rast_set_d_cat (cats.c:876)
==11948== by 0x4863090: Rast_set_d_cat (cats.c:808)
==11948== by 0x4863B55: Rast_sort_cats (cats.c:1306)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 4,168 bytes in 1 blocks are still reachable in loss record 61 of 70
==11948== at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x489826A: G__calloc (alloc.c:81)
==11948== by 0x48718DD: open_raster_new (open.c:731)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 7,200 bytes in 1 blocks are possibly lost in loss record 62 of 70
==11948== at 0x4847C73: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4898314: G__realloc (alloc.c:126)
==11948== by 0x487442B: quant_table_increase (quant.c:352)
==11948== by 0x487442B: Rast_quant_add_rule (quant.c:479)
==11948== by 0x4862E7D: Rast_set_d_cat (cats.c:845)
==11948== by 0x4862E7D: Rast_set_d_cat (cats.c:808)
==11948== by 0x4863B55: Rast_sort_cats (cats.c:1306)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 8,316 bytes in 252 blocks are indirectly lost in loss record 63 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x48C5CA6: G_store (strings.c:96)
==11948== by 0x4862F2F: Rast_set_d_cat (cats.c:880)
==11948== by 0x4862F2F: Rast_set_d_cat (cats.c:808)
==11948== by 0x4863B55: Rast_sort_cats (cats.c:1306)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 10,364 (2,048 direct, 8,316 indirect) bytes in 1 blocks are definitely lost in loss record 64 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x48981BC: G__malloc (alloc.c:39)
==11948== by 0x4863027: Rast_set_d_cat (cats.c:864)
==11948== by 0x4863027: Rast_set_d_cat (cats.c:808)
==11948== by 0x4863B55: Rast_sort_cats (cats.c:1306)
==11948== by 0x4863CAE: write_cats (cats.c:990)
==11948== by 0x10D105: SaveMap (save.c:200)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== 11,296 bytes in 1 blocks are still reachable in loss record 65 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x9B1751B: ??? (in /usr/lib/x86_64-linux-gnu/libde265.so.0.1.1)
==11948== by 0x9AEE989: de265_init (in /usr/lib/x86_64-linux-gnu/libde265.so.0.1.1)
==11948== by 0x6794D35: ??? (in /usr/lib/x86_64-linux-gnu/libheif.so.1.11.0)
==11948== by 0x674DE2C: ??? (in /usr/lib/x86_64-linux-gnu/libheif.so.1.11.0)
==11948== by 0x401196D: call_init.part.0 (dl-init.c:74)
==11948== by 0x4011A57: call_init (dl-init.c:37)
==11948== by 0x4011A57: _dl_init (dl-init.c:121)
==11948== by 0x4001109: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.33.so)
==11948== by 0x5: ???
==11948== by 0x1FFEFFFF1A: ???
==11948== by 0x1FFEFFFF2B: ???
==11948== by 0x1FFEFFFF39: ???
==11948==
==11948== 12,800 bytes in 1 blocks are still reachable in loss record 66 of 70
==11948== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x4898347: G__realloc (alloc.c:124)
==11948== by 0x48713DC: new_fileinfo (open.c:51)
==11948== by 0x4871757: open_raster_new (open.c:637)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 133,332 bytes in 1 blocks are still reachable in loss record 67 of 70
==11948== at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x489826A: G__calloc (alloc.c:81)
==11948== by 0x48717CD: open_raster_new (open.c:655)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 266,672 bytes in 1 blocks are still reachable in loss record 68 of 70
==11948== at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x489826A: G__calloc (alloc.c:81)
==11948== by 0x4871AFD: open_raster_new (open.c:669)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 266,672 bytes in 1 blocks are still reachable in loss record 69 of 70
==11948== at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x489826A: G__calloc (alloc.c:81)
==11948== by 0x4871A6E: open_raster_new (open.c:722)
==11948== by 0x10A8E4: main (main.c:127)
==11948==
==11948== 266,672 bytes in 1 blocks are still reachable in loss record 70 of 70
==11948== at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==11948== by 0x489826A: G__calloc (alloc.c:81)
==11948== by 0x4871AFD: open_raster_new (open.c:669)
==11948== by 0x10CB2D: SaveMap (save.c:22)
==11948== by 0x10AA2D: main (main.c:151)
==11948==
==11948== LEAK SUMMARY:
==11948== definitely lost: 4,439 bytes in 27 blocks
==11948== indirectly lost: 8,417 bytes in 254 blocks
==11948== possibly lost: 7,233 bytes in 2 blocks
==11948== still reachable: 964,123 bytes in 60 blocks
==11948== suppressed: 0 bytes in 0 blocks
==11948==
==11948== For lists of detected and suppressed errors, rerun with: -s
==11948== ERROR SUMMARY: 29 errors from 29 contexts (suppressed: 0 from 0)
This fixes the majority of the leaks, but there are still issues to address. Also, GRASS is increasingly in need of a function that compares available memory against calculated needed. Programs simply dying because they run out of RAM is not a good look.