[GRASS5] nviz problem
Glynn Clements
glynn at gclements.plus.com
Thu Jan 6 17:29:33 EST 2005
Bob Covill wrote:
> The original reason I had changed nviz to run directly as nvwish was the
> error handling. All errors seemed to generate the same unhelpful output
> when passed through the original script. Somthing along the line of ...
>
> .............
> child killed: segmentation violation
> while executing
> "exec /usr/local/grass5/etc/nviz2.2/NVWISH2.2 -f
> /usr/local/grass5/etc/nviz2.2/scripts/nviz2.2_script -q -name NVIZ
> >&@stdout"
> ("eval" body line 1)
Right. The easiest solution to that issue is to rewrite the "nviz"
script as a Bourne-shell script instead of a Tcl script.
Bourne shell doesn't print anything if an external command fails.
> Interestingly, when I started looking into this I notice that v.digit is
> written as a modified wish (I think?).
v.digit uses the "form" library (as does d.what.vect). Most of the
functions in that library just send data to an external program, which
is a modified wish (sort of; it tries to do too much in C, which is
probably why it isn't particularly reliable).
> What would be the best front-end to nviz? It needs to satisfy G_gui(),
> allow errors to handled more cleanly, and allow by-passing G_parser when
> in script mode.
The error messages can be fixed by using /bin/sh instead of Tcl.
The G_gui() issues can be fixed by either:
a) having NVWISH2.2 force the program name to "nviz" (this may require
the addition of e.g. G_set_program_name() to parser.c, but that's
trivial), or
b) making the "nviz" script use g.parser (so, in the G_gui() case, the
re-execution is performed before NVWISH2.2 gets involved).
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list