[GRASS-dev] r.le--after some fixes still needs work

Brad Douglas rez at touchofmadness.com
Thu Sep 28 14:27:49 EDT 2006


On Thu, 2006-09-28 at 18:13 +0100, Glynn Clements wrote:
> Hamish wrote:
> 
> > > I tried r.le in CVS HEAD after Hamish made some fixes. The fixes took
> > > care of some problems.
> > ..
> > > But, r.le.pixel still crashes with memory bug
> > 
> > G63: spearfish> r.mapcalc elev=elevation.dem # it didn't like @othermapset
> > G63: spearfish> r.le.pixel elev att=b1
> > 
> > PARAMETER CHOICES:
> >         MAP:      elev
> >         SAMPLE:   whole map    
> >         ATTRIBUTE MEASURES:
> >                   mean pixel attribute
> > mkdir: cannot create directory `r.le.out': File exists
> > 
> > R.LE.PIXEL IS WORKING....;
> > 
> > Segmentation fault
> > 
> > 
> > 
> > this happens in G_free(), raster/r.le/r.le.pixel/cellclip.c line 417:
> > 
> >   switch (data_type) {
> >      case CELL_TYPE:
> >         G_free (tmp);
> >         break;
> > 
> > 
> > compile time warnings:
> > 
> > cellclip.c: In function `cell_clip_drv':
> > cellclip.c:82: warning: passing arg 2 of `cell_clip' from incompatible pointer type
> > cellclip.c:129: warning: passing arg 2 of `center_is_not_null' from incompatible pointer type
> 
> null_buf is being allocated with one char per column, but everything
> else assumes that it holds one DCELL per column (although, AFAICT,
> they only check for zero/non-zero).
> 
> The "right" solution is to change everything to treat it as char**;
> the easy solution is to allocate one DCELL per column.

I got everything working last night, but there is one large issue:  I
believe the modules needs segmentation.  The largest region I have been
able to work with is about 150x150 with MAX defined as 100000.  There is
no checking against MAX, so if you run out of allocated memory, it will
segv().


-- 
Brad Douglas <rez touchofmadness com>                      KB8UYR
Address: 37.493,-121.924 / WGS84    National Map Corps #TNMC-3785




More information about the grass-dev mailing list