[GRASS5] d.legend and d.out.png
glynn.clements at virgin.net
Wed Sep 22 17:00:02 EDT 2004
Moritz Lennert wrote:
> >> I only get a form process when d.what.vect works. When it doesn't work
> >> (i.e. silently dies after two clicks), I never see the form process come
> >> up, so I can't attach to it.
> > AFAICT, the form process is started at the end of the first pass
> > through the loop, i.e. after the first click.
> > This would explain why it dies after two clicks. After each click,
> > F_open() is called. On the first call, it starts the form process, and
> > sets a flag to indicate that it is running. On subsequent calls, it
> > will use the existing process.
> > If the form window never appears, that suggests that it dies shortly
> > after startup, which is going to make it hard to debug. The only thing
> > which I can suggest is to add a sleep() call to the top of main() in
> > lib/form/form.c, so that you get a chance to attach a debugger to it.
> Ok, I tried using sleep, but now I can't reproduce the error, except when
> using sleep(0). sleep(1) and upward all make the error disappear. This
> does not solve my problem on how to debug ;-), but might it be an
> explanation by itself ?
Another option is to re-compile lib/gis with GDEBUG defined, then set
the DEBUG and GRASS_DEBUG_FILE environment variables (see
One thing which stands out is that lib/form/form.c reads from stdin
using both read() and the ANSI stdio functions, which may well result
in timing-dependent bugs. Also, I'm unsure whether Tcl may use the
Maybe Radim could weigh in this discussion?
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev