[GRASS5] calculating averages on raster map patches?

Markus Neteler neteler at itc.it
Wed Aug 24 12:04:13 EDT 2005


On Tue, Aug 23, 2005 at 11:05:45PM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > On a 64bit box I get a segfault from r.stats (called by r.average) after this
> > message:
> > 
...
> > Any ideas?
> 
> Was this compiled without optimisation? If you enable optimisation
> (e.g. -O2, which is added by default unless you manually specify
> CFLAGS when configuring), output from gdb is often meaningless.

Sorry, disabled now. BTW: It's hard to tell configure to disable the
optimization:

./conf_grass61_64bit.sh
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc -g -Wall -Werror-implicit-function-declaration -fno-common -mcpu=nocona -mtune=nocona -m64 -minline-all-stringops ) works... yes
checking whether the C compiler (gcc -g -Wall -Werror-implicit-function-declaration -fno-common -mcpu=nocona -mtune=nocona -m64 -minline-all-stringops ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
...

grep OPTI include/Make/Platform.make
CFLAGS_OPTIMIZE     = -O2
LDFLAGS_OPTIMIZE    =

It still get's in.
Anyway.

Manually resolved, now recompiled from scratch.

(gdb) r -anC input='areecampione125m,modis_vi250m20010712.250m_16_days_EVI' fs=space
Starting program: /hardmnt/eden0/ssi/software/cvsgrass61/dist.x86_64-unknown-linux-gnu/bin/r.stats -anC input='areecampione125m,modis_vi250m20010712.250m_16_days_EVI' fs=space
Detaching after fork from child process 6288.
Detaching after fork from child process 6289.
WARNING: r.stats: cats for modis_vi250m20010712.250m_16_days_EVI are either
         missing or have no explicit labels. Using nsteps=255

Program received signal SIGSEGV, Segmentation fault.
0x0000000000402b7f in main (argc=4, argv=0x7fbffff498) at main.c:242
242         for (i = 0; name = option.cell->answers[i]; i++)
(gdb) bt full
#0  0x0000000000402b7f in main (argc=4, argv=0x7fbffff498) at main.c:242
        to_screen = 0x404c28 " output to screen "
        fd = (int *) 0x5090a0
        i = 2
        name = 0x508ec0 "modis_vi250m20010712.250m_16_days_EVI"
        mapset = 0x509300 "modisNDVI_v004"
        verbose = 1
        raw_data = 0
        with_coordinates = 0
        with_xy = 0
        with_percents = 0
        with_counts = 0
        with_areas = 1
        with_labels = 0
        fmt = "\030�\177\000\000\000Y\221]4\000\000\000\000\000\000"
        dp = -1
        range = {min = 1, max = 40, first_time = 0}
        fp_range = {min = -0.247, max = 1, first_time = 0}
        q = {truncate_only = 0, round_only = 0, defaultDRuleSet = 0, defaultCRuleSet = 0, infiniteLeftSet = 0,
  infiniteRightSet = 0, cRangeSet = 1572922248, maxNofRules = 0, nofRules = 0, defaultDMin = 3.4584595208887258e-323,
  defaultDMax = 9.0363178007857629e-313, defaultCMin = -1786485176, defaultCMax = 42, infiniteDLeft = 2.7108496073851862e-312,
  infiniteDRight = 2.0729848267200353e-317, infiniteCLeft = 24641422, infiniteCRight = 0, dMin = -0.247, dMax = 1, cMin = 1,
  cMax = 255, table = 0x50e770, fp_lookup = {vals = 0x7fbffff3b0, rules = 0x177ff8e, nalloc = 4199404, active = 0, inf_dmin = 0,
    inf_dmax = 1.1111882213708365e-312, inf_min = -1786485176, inf_max = 42}}
       min = 1
        max = 255
        null_set = 1
        dmin = -0.247
        dmax = 1
        module = (struct GModule *) 0x2a9571d4b0
        flag = {A = 0x5089d0, a = 0x508a20, c = 0x508a70, p = 0x508ac0, l = 0x508b10, q = 0x508b60, n = 0x508bb0, N = 0x508c00,
  one = 0x2a9571d3e0, x = 0x508ca0, g = 0x508c50, i = 0x508d90, r = 0x508d40, C = 0x508cf0}
        option = {cell = 0x3535323d737065, fs = 0x508730, nv = 0x5087c0, output = 0x508850, nsteps = 0x508900}

This looks similar (but hopefully more reasonable) to the first report.
http://grass.itc.it/pipermail/grass5/2005-August/019354.html

Markus




More information about the grass-dev mailing list