[GRASSLIST:9841] r.mapcalc causing segmentation violation

Ralf Gerlich ralf.gerlich at bsse.biz
Sun Jan 15 08:59:59 EST 2006


Hi,

I'm trying to do a shaded relief map using r.shaded.relief and always
get a segmentation violation when r.mapcalc is called.

With today's CVS version I get the following backtrace:

=========================================================================

GRASS 6.1.cvs (utm):~/misc/gis > gdb r.mapcalc
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db
library "/ lib/tls/libthread_db.so.1".

(gdb) run OUT=elev[0,-1]
Starting program:
/home/ralfg/misc/gis/src/grass-6.1.0/dist.i486-pc-linux-gnu/bi
n/r.mapcalc OUT=elev[0,-1]
    0%
Program received signal SIGSEGV, Segmentation fault.
0xb7f63ca3 in G__convert_flags_01 (zero_ones=0x80851f0 "\001\001\001",
     flags=0x0, n=5738) at null_val.c:790
790                     zero_ones[count] = ((*v & ( (unsigned char) 1 <<
k)) != 0);
(gdb) bt
#0  0xb7f63ca3 in G__convert_flags_01 (zero_ones=0x80851f0 "\001\001\001",
     flags=0x0, n=5738) at null_val.c:790
#1  0xb7f5cd7d in get_null_value_row (fd=0, flags=0x80851f0 "\001\001\001",
     row=1, with_mask=1) at get_row.c:1021
#2  0xb7f5d35a in get_map_row (fd=0, rast=0x805f360, row=1, data_type=1,
     null_is_zero=0, with_mask=1) at get_row.c:1067
#3  0x08055b9d in read_row (fd=0, buf=0x805f360 "", row=1, dummy=0)
     at map.c:227
#4  0x08055ccd in read_map (m=<value optimized out>, buf=0x805f360,
     res_type=1, row=0, col=-1) at map.c:295
#5  0x08056620 in get_map_row (idx=0, mod=77, depth=0, row=1, col=-1,
     buf=0x805f360, res_type=7) at map.c:465
#6  0x0804e7a5 in evaluate (e=0x805f300) at evaluate.c:123
#7  0x0804eaec in execute (ee=0x805b170) at evaluate.c:260
#8  0x0804ffc2 in main (argc=2, argv=0xbfaeebe4) at main.c:128
(gdb)

=========================================================================

Note that this happens with "OUT=elev[0,-1]" and any other reference to
negative column numbers, but not with non-negative column numbers.

It seems as if the null-rows in the file-control-block are not initialised.

Any ideas? I'm ready to follow any pointers you give me.

Best regards,
Ralf Gerlich




More information about the grass-user mailing list