[GRASS-dev] Parser problem in GRASS 7

Hi,

by chance I came across a strange problem:

# wrong param name "inbut":
GRASS 7.0.svn (spearfish60):~ > r.colors inbut=diff col=differences
Aborted

Any wrong name currently leads to "Abort" rather than the expected error
message from the parser. They are generated, then get lost.

Here the backtrace:

(gdb) bt full
#0 0x00007ffff718f925 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007ffff7190f40 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007ffff71cf2f0 in malloc_printerr () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007ffff71d51f3 in realloc_check () from /lib64/libc.so.6
No symbol table info available.
#4 0x00007ffff77579e2 in G__realloc (file=0x7ffff777f478 "parser.c",
line=1373, buf=0x613060, n=9) at alloc.c:112
No locals.
#5 0x00007ffff7767bac in append_error (msg=0x612f50 "Required
parameter <map> not set:\n\t(Name of raster map)")
    at parser.c:1373
No locals.
#6 0x00007ffff7767357 in check_required () at parser.c:1158
        opt = 0x7ffff798ac88
        err = 0x612f50 "Required parameter <map> not set:\n\t(Name of
raster map)"
#7 0x00007ffff7765b3f in G_parser (argc=0, argv=0x7fffffffd718) at parser.c:553
        need_first_opt = 0
        opt_checked = 0
        ptr = 0x7fffffffdc1a "col=differences"
        tmp_name = 0x612748 "r.colors"
        err = 0x0
        i = 74
        opt = 0x0
        force_gui = 0 '\000'
#8 0x0000000000402dd3 in edit_colors (argc=3, argv=0x7fffffffd708,
type=1, maptype=0x40473f "raster",
    Maptype=0x404738 "Raster") at edit_colors.c:250
        overwrite = 32767
        is_from_stdin = -149012296
        remove = 1
        have_colors = -163754450
        colors = {version = -134225624, shift = 0, invert =
-134439960, is_float = 32767, null_set = -134438912,
          null_red = 255 '\377', null_grn = 127 '\177', null_blu = 0
'\000', undef_set = 4199142,
          undef_red = 0 '\000', undef_grn = 0 '\000', undef_blu = 0
'\000', fixed = {rules = 0x7ffff716e638,
            n_rules = 4195728, lookup = {red = 0x100000000 <Address
0x100000000 out of bounds>,
              grn = 0x1000007f0 <Address 0x1000007f0 out of bounds>,
blu = 0x7ffff7ffe6b8 "",
              set = 0x7ffff691f000 "\177ELF\002\001\001", nalloc =
-134224768, active = 32767}, fp_lookup = {
              vals = 0x7fffffffd640, rules = 0x0, nalloc = -10648,
active = 32767}, min = 6.9533491656184379e-310,
            max = 6.9533491762080433e-310}, modular = {rules =
0x7ffff7de94db, n_rules = 0, lookup = {
              red = 0x7ffff7fc9be8 "o\023@", grn = 0x1 <Address 0x1
out of bounds>, blu = 0x0,
              set = 0x7fff00000001 <Address 0x7fff00000001 out of
bounds>, nalloc = -134225624, active = 32767},
            fp_lookup = {vals = 0x7ffff6b35b48, rules =
0x7ffff6924ac0, nalloc = -156017696, active = 32767},
            min = 2.7957238160824444e-317, max =
9.436653835567809e-322}, cmin = 0, cmax = 6.9533491762503353e-310,
          organizing = -10768}
        colors_tmp = {version = -134224160, shift =
4.9406564584124654e-324, invert = 1910330751, is_float = 0,
          null_set = -136408605, null_red = 255 '\377', null_grn = 127
'\177', null_blu = 0 '\000', undef_set = 0,
          undef_red = 0 '\000', undef_grn = 0 '\000', undef_blu = 0
'\000', fixed = {rules = 0x1c77555, n_rules = 63,
            lookup = {red = 0x0, grn = 0x7fff00000001 <Address
0x7fff00000001 out of bounds>,
              blu = 0x7ffff7de8955 "\205\300uGH\211\330H\213l$
H\213\\$\030L\213d$(L\213l$0H\203\304\070\303\017\037", set =
0x7fffffffd580 "\b\326\377\377\377\177", nalloc = -11136, active =
32767}, fp_lookup = {vals = 0x7,
              rules = 0x7fffffffd480, nalloc = -134440056, active =
32767}, min = 5.434722104253712e-323,
            max = 2.0410903428666442e-314}, modular = {rules =
0x7ffff7de9165, n_rules = -134224200, lookup = {
              red = 0x3d8f538 <Address 0x3d8f538 out of bounds>,
              grn = 0x7fff0000002e <Address 0x7fff0000002e out of bounds>,
              blu = 0x7ffff7161a08
"/N=\366\316\030L\017\371\304-\327\370ԏӄ\"\233|\204\"\233|%\301\324\361\354\373\300=\260\"\225\303\070\307\031u\377\001\304\022\311BY\020\334\317쵶w\035\rG\336\315%\265V1\375\307r1\035\a;\372L\214\t)\020\t~\222\034\070\265\357\060j\335\371{\004\\H\261ԡ\034\240\002\352\331\017\071\265\357\060X?\227|\030\034s\354T\200\314sقc\002;H\205\033\066\rf\375\062v\340ը\247KἜ#\217\326\036h\233\243\230\313\362\234\002Y1\n\264\006\337\275\350e\235J\032\223\250P\265\250\020\205)%~\016|\030\271\321\070\a\221\222\376\206\357\246:V\323\361I\265$\202\241\067\344Qho",
<incomplete sequence \354>..., set = 0x0, nalloc = -149545984, active
= 32767}, fp_lookup = {vals = 0x7fffffffd5f0,
              rules = 0x7ffff716da80, nalloc = 2, active = 0}, min =
6.9533490665995798e-310,
            max = 6.9533490665487898e-310}, cmin =
6.9533491763230618e-310, cmax = 6.9533558073014134e-310,
          organizing = 0}
        statf = {node = 0x10000009e, tlen = -136410795, N = 32767,
curp = 1, null_data_count = 140737488344080,
          curoffset = -11056}
        have_stats = 0
        range = {min = 6.9533479918786395e-310, max =
6.9533484218393666e-310, first_time = -158203712}
        min = 6.953349165670216e-310
        max = 6.9533491653235795e-310
        name = 0x0
        mapset = 0x0
        style = 0x0
        cmap = 0x0
        cmapset = 0x0
        rules = 0x0
        fp = 0
        module = 0x7ffff798ac28
        flag = {r = 0x7ffff798ac58, w = 0x6110b0, l = 0x6113d0, g =
0x6125c0, a = 0x612630, n = 0x612550,
          e = 0x6126a0}
        opt = {map = 0x7ffff798ac88, colr = 0x611900, rast = 0x612340,
volume = 0x6123f0, rules = 0x6124a0}
        stat = 0
#9 0x0000000000402405 in main (argc=3, argv=0x7fffffffd708) at raster_main.c:25
No locals.
(gdb)

The problem happens somewhere in parser.c, line 1373.

Markus

Markus Neteler wrote:

by chance I came across a strange problem:

# wrong param name "inbut":
GRASS 7.0.svn (spearfish60):~ > r.colors inbut=diff col=differences
Aborted

Any wrong name currently leads to "Abort" rather than the expected error
message from the parser. They are generated, then get lost.

Here the backtrace:

Try r47136.

--
Glynn Clements <glynn@gclements.plus.com>

On Sat, Jul 16, 2011 at 11:29 AM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

by chance I came across a strange problem:

# wrong param name "inbut":
GRASS 7.0.svn (spearfish60):~ > r.colors inbut=diff col=differences
Aborted

Any wrong name currently leads to "Abort" rather than the expected error
message from the parser. They are generated, then get lost.

Here the backtrace:

Try r47136.

Much better, thanks. Just a minor observation:

GRASS 7.0.svn (spearfish60):~ > r.colors inbut=diff col=differences
...
  raster Raster map from which to copy color table
  volume Raster3d map from which to copy color table
   rules Path to rules file
            "-" to read rules from stdin

ERROR:
ERROR: Required parameter <map> not set:
        (Name of raster map)

-> there is a first empty, ERROR, maybe an initialization issue?

Markus

Hi,

2011/7/18 Markus Neteler <neteler@osgeo.org>:

ERROR:
ERROR: Required parameter <map> not set:
(Name of raster map)

-> there is a first empty, ERROR, maybe an initialization issue?

strange, there should be

ERROR: Sorry, <inbut> is not a valid parameter
ERROR: Required parameter <map> not set:
        (Name of raster map)

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Markus Neteler wrote:

> Try r47136.

Much better, thanks. Just a minor observation:

GRASS 7.0.svn (spearfish60):~ > r.colors inbut=diff col=differences
...
  raster Raster map from which to copy color table
  volume Raster3d map from which to copy color table
   rules Path to rules file
            "-" to read rules from stdin

ERROR:
ERROR: Required parameter <map> not set:
        (Name of raster map)

-> there is a first empty, ERROR, maybe an initialization issue?

Not for me:

  ERROR: Sorry, <inbut> is not a valid parameter
  ERROR: Required parameter <map> not set:
    (Name of raster map)

--
Glynn Clements <glynn@gclements.plus.com>