<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.10.0">
</HEAD>
<BODY>
Hamish and Glynn, thank you for seeing that with null_buf. In r.le.patch, I did indeed allocate null_buf as DCELL, not char and that worked in there, even though it is not the right solution. Hamish, can you change that allocation statement for null_buf to DCELL and see if that fixes the crash? I'm not set up yet to do anything and can barely figure out CVS at this point. Hope that fixes the crash.<BR>
<BR>
Hamish, as to r.le.setup, at the CHOOSE THE SETUP OPTION step, I choose Setup sampling units, then Use keyboard to enter sampling unit dimensions, then 1 for for How many different SCALES, then 1 for Random nonoverlapping, then &quot;y&quot; for Do you want to sample using rectangles, then &quot;1.0&quot; for Sampling unit SHAPE, then 144 for Recommended maximum SIZE followed by &quot;y&quot; it's OK, then 20<BR>
sampling units. At that point, the program should draw the sampling units in red on the monitor, but nothing is displayed. Not sure where the communication problem is...<BR>
<BR>
Bill<BR>
On Thu, 2006-09-28 at 18:13 +0100, Glynn Clements wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hamish wrote:</FONT>

<FONT COLOR="#000000">&gt; &gt; I tried r.le in CVS HEAD after Hamish made some fixes. The fixes took</FONT>
<FONT COLOR="#000000">&gt; &gt; care of some problems.</FONT>
<FONT COLOR="#000000">&gt; ..</FONT>
<FONT COLOR="#000000">&gt; &gt; But, r.le.pixel still crashes with memory bug</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; G63: spearfish&gt; r.mapcalc elev=elevation.dem # it didn't like @othermapset</FONT>
<FONT COLOR="#000000">&gt; G63: spearfish&gt; r.le.pixel elev att=b1</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; PARAMETER CHOICES:</FONT>
<FONT COLOR="#000000">&gt;         MAP:      elev</FONT>
<FONT COLOR="#000000">&gt;         SAMPLE:   whole map    </FONT>
<FONT COLOR="#000000">&gt;         ATTRIBUTE MEASURES:</FONT>
<FONT COLOR="#000000">&gt;                   mean pixel attribute</FONT>
<FONT COLOR="#000000">&gt; mkdir: cannot create directory `r.le.out': File exists</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; R.LE.PIXEL IS WORKING....;</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Segmentation fault</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; this happens in G_free(), raster/r.le/r.le.pixel/cellclip.c line 417:</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;   switch (data_type) {</FONT>
<FONT COLOR="#000000">&gt;      case CELL_TYPE:</FONT>
<FONT COLOR="#000000">&gt;         G_free (tmp);</FONT>
<FONT COLOR="#000000">&gt;         break;</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; compile time warnings:</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; cellclip.c: In function `cell_clip_drv':</FONT>
<FONT COLOR="#000000">&gt; cellclip.c:82: warning: passing arg 2 of `cell_clip' from incompatible pointer type</FONT>
<FONT COLOR="#000000">&gt; cellclip.c:129: warning: passing arg 2 of `center_is_not_null' from incompatible pointer type</FONT>

<FONT COLOR="#000000">null_buf is being allocated with one char per column, but everything</FONT>
<FONT COLOR="#000000">else assumes that it holds one DCELL per column (although, AFAICT,</FONT>
<FONT COLOR="#000000">they only check for zero/non-zero).</FONT>

<FONT COLOR="#000000">The &quot;right&quot; solution is to change everything to treat it as char**;</FONT>
<FONT COLOR="#000000">the easy solution is to allocate one DCELL per column.</FONT>

</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>