[GRASS5] Driver Update

Glynn Clements glynn.clements at virgin.net
Sat Apr 28 16:40:07 EDT 2001


Markus Neteler wrote:

> > > I have tested some modules:
> > > 
> > > > d.display
> > >  -> not o.k., needs the R_stabilize()
> > 
> > Any specific cases? d.display is quite a large program, which is why I
> > didn't try to fix it there and then.
> 
> Sure, sorry. I loaded a raster map, it was only displayed when "wiping" the
> monitor with another window. If you start it and load a raster map, it won't
> appear.

Odd; I don't get this behaviour. Furthermore, I don't see how it could
occur.

d.display repeatedly opens and closes the driver, doing very little in
between. R_close_driver() calls R_stabilize(), so all output should be
flushed whenever the driver is closed.

Running "fgrep R_ *.c" shows that, in all but three cases, there are
only between one and three statements between R_open_driver() and
R_close_driver(). The exceptions are the code to draw raster maps in
zoom.c and show_cell.c, and the setup code in setup.c (which, if it
weren't for the nine calls to Dnew() to create the frames, would only
have three statements).

The code for displaying a raster map (in show_cell.c; the code in
zoom.c is very similar) is:

	if (R_open_driver() != 0)
		G_fatal_error ("No graphics device selected");

/* Draw cell map */
	G_get_window(&wind) ;
	G_set_window(&wind) ;
	Dchoose(MAP.name) ;
	Derase("black") ;
	fprintf (stdout,"\n\n  Displaying map %s from mapset %s\n", mapname, mapset);
	Dcell(mapname, mapset, 0) ;

/* Draw tiny map */
	G_get_default_window(&wind) ;
	G_set_window(&wind) ;
	Dchoose(REF.name) ;
	Dcell(mapname, mapset, 0) ;
	R_close_driver();

I don't see how this can produce the behaviour which you describe,
unless d.display terminates suddenly (you don't report this as
happening; was d.display still running?).
 
However, premature termination does appear to be a real possibility;
when I tried testing it, attempting to draw elevation.dem (from
spearfish) twice in succession caused d.display to segfault on the
second attempt. The segfault was in realloc(), which suggests heap
corruption.

-- 
Glynn Clements <glynn.clements at virgin.net>

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list