[GRASS-dev] [grass-code I][355] A lot of <defunct> processes around while working

Glynn Clements glynn at gclements.plus.com
Wed Apr 4 15:06:54 EDT 2007


Michael Barton wrote:

> >> frankie   5484     1  2 16:49 pts/11   00:00:32 wish
> >> /usr/lib/grass/etc/gm/gm.tcl -name gm_tcl
> >> frankie   5525  5484  0 16:49 pts/11   00:00:00 [g.region] <defunct>
> >> frankie   5527  5484  0 16:50 pts/11   00:00:00 [g.region] <defunct>
> >> frankie   5529  5484  0 16:50 pts/11   00:00:00 [g.region] <defunct>
> > 
> > [snip]
> > 
> > AFAICT, this is due to MapCanvas::set_wind; it should be using "exec"
> > rather than "open |...".
> 
> This is because of the need to run g.region -gp and read the results back,
> in order to get current region information.

Nope. The code in question is:

	proc MapCanvas::set_wind {mon args overwrite} {
		variable zoom_attrs
		global devnull
	
		set values [MapCanvas::currentzoom $mon]
	
		set options {}
		foreach attr $zoom_attrs value $values {
			if {$attr != "rows" && $attr != "cols"} {
				lappend options "$attr=$value"
			}		
		}
	
		if {$overwrite == 1} {
			open [concat "|g.region --o" $options $args "2> $devnull"]
		} else {
			open [concat "|g.region" $options $args "2> $devnull"]
		}
	}

Nothing is using the returned descriptor. More importantly, nothing is
closing it, so the process will remain a zombie forever.

This should be using exec, not open.

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




More information about the grass-dev mailing list