[GRASS5] d.legend and d.out.png

Glynn Clements glynn.clements at virgin.net
Fri Aug 27 19:08:59 EDT 2004

Moritz Lennert wrote:

> > The next step is to try to debug the child process. Try running
> > d.what.vect but don't interact with it. Use "ps" to check whether the
> > child process ($GISBASE/etc/form/form) is still running at this point.
> > If it is, try attaching to it with gdb, e.g.
> >
> > 	$ gdb $GISBASE/etc/form/form
> > 	> attach <pid>
> >
> > where <pid> is the PID of the etc/form/form process.
> >
> > Or use "strace -p <pid>".
> Ok, the form process appears once I click on the map, not before. When
> everything works fine I can see the form process appear normally. When
> d.what.vect doesn't work (i.e. no reaction after the first click) a
> defunct form process appears:
> $ ps -A | grep form
>  5820 pts/27   00:00:00 form <defunct>

The "<defunct>" means that it's a "zombie" process, i.e. it has
terminated, but the parent hasn't called wait() (or waitpid() etc) for
it, so its entry remains in the process table (until the parent has
called wait() or similar, essentially, its PID cannot be reused, and
its exit status has to be stored somewhere).

> This disappears when d.what.vect terminates silently after the second
> left-click. Next time around it reappears but with a different pid.
> When I try to attach in gdb or use strace -p I get:
> (gdb) attach 5849
> Attaching to process 5849
> ptrace: Op&#65533;ration non permise.
> and
> $ strace -p 5849
> attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
> be it as normal user or as root.

Note that you have to do this before it has died. Once it is in the
<defunct> state, you can't trace it or debug it.

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list