Hi Glynn and everyone else
Glynn Clements wrote:
Until recently, the most likely reason would have been the use of
G_put_map_row(), which treats zero as null unless G_zeros_r_nulls(0)
is called first.
However, Markus recently replaced all of uses of this function with
G_put_raster_row() (or similar), which doesn't treat zero as null.
There is one reference to G_put_map_row_random() in
src/imagery/i.ortho.photo/photo.rectify/write.c; this function also
uses the zeros_r_nulls setting. Are you using i.ortho.photo?
Apart from that, something would have to be explicitly setting zero
cells to null using G__put_null_value_row() (or even lower level
functions).
I looked into this further and it appears that the original map was
imported using Grass 4.3 and then copied to a Grass 5 database.
Obviously there would not be a null file in this case. If the file is
imported using r.in.tiff in Grass5, the null file is automatically
created. What threw me was that the first time I ran d.rast, the file
displayed normally. The second time it was run, the null values
appeared. As mentioned in my previous post, the solution is to run
r.support to create a null file. Thus, I no longer think that this is a
show stopper.
However, I would still propose that we eliminate this null file and
never treat 0 as "no data". It has been pointed out that this was
originally implemented for Grass 4.x users who still wanted 0 to mean
"no data" in Grass 5. But with a simple r.mapcalc command, these users
can transform the 0 data to proper NULL values. Thus, there is no need
for the null file.
So, if there are no objections, I will post a proposal to the Grasslist
mailing list to eliminate the null file. If that meets with a positive
response, I will add this to the TODO file.
By the way, I think we should change the output of d.what.rast for 5.0,
since regardless of whether 0 is interpreted as "no data" or not, the
program lists it as no data. If there are no objections I'll make this
change.
Thank you to those who made suggestions, it helped me track this thing
down.
--
Sincerely,
Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
People who think they know everything are very irritating to those
of us who do. ---Anonymous
Jazz and Trek Rule!!!
From neteler Mon Jun 11 14:05:50 2001
Return-Path: <neteler>
Received: by hgeo02.geog.uni-hannover.de (SMI-8.6/SMI-SVR4)
id OAA23159; Mon, 11 Jun 2001 14:05:50 +0100
Date: Mon, 11 Jun 2001 14:05:50 +0100
From: Markus Neteler <neteler@geog.uni-hannover.de>
To: Glynn Clements <glynn.clements@virgin.net>
Cc: grass5 developers list <grass5@geog.uni-hannover.de>
Subject: Re: [GRASS5] Driver Update
Message-ID: <20010611140550.Q15422@hgeo02.geog.uni-hannover.de>
Mail-Followup-To: Glynn Clements <glynn.clements@virgin.net>,
grass5 developers list <grass5@geog.uni-hannover.de>
References: <15083.644.576215.930324@cerise.nosuchdomain.co.uk> <20010510164735.C20265@hgeo02.geog.uni-hannover.de> <15100.591.495664.493609@cerise.nosuchdomain.co.uk> <20010511172543.A29624@hgeo02.geog.uni-hannover.de> <15100.33453.372858.117251@cerise.nosuchdomain.co.uk> <20010527104025.I12157@hgeo02.geog.uni-hannover.de> <15121.14708.979191.289876@cerise.nosuchdomain.co.uk> <20010601153714.G12814@hgeo02.geog.uni-hannover.de> <15128.6607.537624.62145@cerise.nosuchdomain.co.uk> <15131.24138.606527.722069@cerise.nosuchdomain.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <15131.24138.606527.722069@cerise.nosuchdomain.co.uk>; from glynn.clements@virgin.net on Mon, Jun 04, 2001 at 11:09:14AM +0100
Sender: grass5-admin@geog.uni-hannover.de
Errors-To: grass5-admin@geog.uni-hannover.de
X-BeenThere: grass5@geog.uni-hannover.de
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:grass5-request@geog.uni-hannover.de?subject=help>
List-Post: <mailto:grass5@geog.uni-hannover.de>
List-Subscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=subscribe>
List-Id: GRASS 5 Developers mailing list <grass5.geog.uni-hannover.de>
List-Unsubscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=unsubscribe>
List-Archive: <http://www.geog.uni-hannover.de/pipermail/grass5/>
Status: O
Content-Length: 2164
Lines: 53
Hi Glynn,
sorry for the delay, was abroad.
On Mon, Jun 04, 2001 at 11:09:14AM +0100, Glynn Clements wrote:
Glynn Clements wrote:
> > while working with the current Xdriver I found a side effect
> > on KDE: If you are displaying a larger raster map and try to
> > resize, the Xdriver redraws immediately, even if the mouse
> > button is not released yet. This leads to a sort
> > of impossibility to resize (sorry, in the past I was always
> > voting for the immediate redraw...).
> >
> > As I remember you cannot find out if the mouse button is released
> > or not. So the only solution might be a little sleep before
> > redrawing to catch the full ongoing resize event. At time on
> > KDE the resize event is interrupted by the redraw.
>
> Two possible solutions, either or both of which could be implemented:
>
> 1. Delay the resize until after a given interval has elapsed with no
> further redraw events being received (I presume that this is what you
> are proposing). How long should the interval be?
>
> 2. Don't disable resize while a redraw is in progress. Redraw commands
> shouldn't be interactive (or, put another way, interactive commands
> shouldn't be passed to D_add_to_list()).
>
> Option 2 may make option 1 unnecessary. Option 1 has the drawback that
> there will always be a delay before redraw occurs; I'm reluctant to
> make non-KDE users suffer for KDE's flaws.
I've implemented option 2; let me know if you have any problems with
it.
now the monitor resize seems to work perfect on KDE.
I also added an explicit check to the Get_location_with_* functions
just in case they are called during a redraw. However, this won't help
if a program which waits for keyboard input gets added to the list.
Ideally we should check any programs which call D_add_to_list() to
ensure that they never add themselves to the redraw list if they are
run in a way which will require user interaction.
I will continue to test and report any problems. It seems your improvements
catch most (all?) cases. My students will find the others 
Thanks for the fix,
Markus
From neteler Mon Jun 11 14:12:25 2001
Return-Path: <neteler>
Received: by hgeo02.geog.uni-hannover.de (SMI-8.6/SMI-SVR4)
id OAA23243; Mon, 11 Jun 2001 14:12:19 +0100
Date: Mon, 11 Jun 2001 14:12:18 +0100
From: Markus Neteler <neteler@geog.uni-hannover.de>
To: ziyadin <cakirz@itu.edu.tr>
Cc: grass5 developers list <grass5@geog.uni-hannover.de>
Subject: Re: [GRASS5] compiling grass5.0.0pre1
Message-ID: <20010611141218.A23183@hgeo02.geog.uni-hannover.de>
Mail-Followup-To: ziyadin <cakirz@itu.edu.tr>,
grass5 developers list <grass5@geog.uni-hannover.de>
References: <3B14FF96.220EF7E9@itu.edu.tr> <3B15848A.BD51236D@nb.sympatico.ca> <3B15ED16.25718017@itu.edu.tr> <20010531122307.K26010@hgeo02.geog.uni-hannover.de> <3B164363.A26ED951@itu.edu.tr> <20010531155839.U26010@hgeo02.geog.uni-hannover.de> <3B1B7CD1.DFE5FEF1@itu.edu.tr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <3B1B7CD1.DFE5FEF1@itu.edu.tr>; from cakirz@itu.edu.tr on Mon, Jun 04, 2001 at 03:19:29PM +0300
Sender: grass5-admin@geog.uni-hannover.de
Errors-To: grass5-admin@geog.uni-hannover.de
X-BeenThere: grass5@geog.uni-hannover.de
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:grass5-request@geog.uni-hannover.de?subject=help>
List-Post: <mailto:grass5@geog.uni-hannover.de>
List-Subscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=subscribe>
List-Id: GRASS 5 Developers mailing list <grass5.geog.uni-hannover.de>
List-Unsubscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=unsubscribe>
List-Archive: <http://www.geog.uni-hannover.de/pipermail/grass5/>
Status: O
Content-Length: 1479
Lines: 46
Dear Ziya,
On Mon, Jun 04, 2001 at 03:19:29PM +0300, ziyadin wrote:
Dear Markus,
I have finally manage to compile all the modules that come with
grass5.0.0pre1. There was only one left (src/raster/wildfire) but
I compiled it manually. The problem with this was that Gmake and
some other files (e.g. src) of this module did not exist.
mhh, that's surprising. Here I have a Gmakefile in
src/raster/wildfire/
you should be able to compile from there.
The problem with the other modules (apart from my missing
libraries) that I could not compile was that there is a problem either
with my tar program or with grass5.0.0pre1.tar.gz file;
when I gunzip and untar the file tree directories are missing. These are
../src/sites
../src/scripts
src.contrib
Are you sure? I have just checked the tarball, the directories are in.
Perhaps you have been looking in the wrong directory.
I later obtained these from snap_shots source file on your server.
I have also made a test and compiled this version. It works.
o.k.
I have one problem now; when I invoke nviz I get this error mesage
Mapset <PERMANENT> in Location <spearfish>
GRASS 5.0.0pre1 > nviz
/usr/local/grass5/bin/nviz: tclsh: not found
I would be happy if you could give some suggestions about this.
Check for the file tclsh8.0 (or tclsh8.1 or tclsh8.2...) and set
a link to tclsh:
ln -s tclsh8.1 tclsh
Then it should start.
Good luck,
Markus
From neteler Mon Jun 11 14:24:09 2001
Return-Path: <neteler>
Received: by hgeo02.geog.uni-hannover.de (SMI-8.6/SMI-SVR4)
id OAA23376; Mon, 11 Jun 2001 14:24:09 +0100
Date: Mon, 11 Jun 2001 14:24:09 +0100
From: Markus Neteler <neteler@geog.uni-hannover.de>
To: GRASS <grass@geni.cemtlo.com>
Cc: grass5 developers list <grass5@geog.uni-hannover.de>
Message-ID: <20010611142409.C23183@hgeo02.geog.uni-hannover.de>
Mail-Followup-To: GRASS <grass@geni.cemtlo.com>,
grass5 developers list <grass5@geog.uni-hannover.de>
References: <20010529132445.G18447@hgeo02.geog.uni-hannover.de> <200106051039.f55AdGZ28715@geni.cemtlo.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <200106051039.f55AdGZ28715@geni.cemtlo.com>; from grass@geni.cemtlo.com on Tue, Jun 05, 2001 at 07:39:16PM +0900
Subject: [GRASS5] Re: r.sunmask - memory leakage in GRASS lib
Sender: grass5-admin@geog.uni-hannover.de
Errors-To: grass5-admin@geog.uni-hannover.de
X-BeenThere: grass5@geog.uni-hannover.de
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:grass5-request@geog.uni-hannover.de?subject=help>
List-Post: <mailto:grass5@geog.uni-hannover.de>
List-Subscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=subscribe>
List-Id: GRASS 5 Developers mailing list <grass5.geog.uni-hannover.de>
List-Unsubscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=unsubscribe>
List-Archive: <http://www.geog.uni-hannover.de/pipermail/grass5/>
Status: O
Content-Length: 4810
Lines: 156
Hi Huidae,
hi all, (as this might be interesting for all)
thanks for looking into the memory leakage in
r.sunmask -
src/libes/gis/get_row.c
On Tue, Jun 05, 2001 at 07:39:16PM +0900, GRASS wrote:
Hi Markus,
Sorry for my late response.
From: Markus Neteler <neteler@geog.uni-hannover.de>
> Hi Huidae, hi Justin,
>
> Justin: many thanks for below comments! I try to involve Huidae 
>
> Huidae: the r.sunmask still contains the memory leakage which appears
> with bigger DEMs - it leads to a partially system crash. Justin has
> been investigating, but didn't find the leakage yet. May I ask you
> for assistance? I am willing to learn how to debug such problems,
> but I am out of references/tutorials.
> Perhaps this problem indicates a memory leakage in GRASS GIS library
> which would also affect other modules.
>
> Here what Justin found out:
> On Tue, May 29, 2001 at 05:32:10PM +0700, Justin Hickey wrote:
> > Hi Markus
> >
> > The latest update is not too good but I have a little bit of
> > information. A debugger I have on our SGI can do a memory leak trace,
> > unfortunately it dumps core trying to run r.sunmask. I don't know why.
> > The error message doesn't make any sense to me.
> >
> > So I played around a bit and determined the following. The memory is
> > being allocated every so often inside the
> >
> > while (col1<window.cols)
> >
> > loop (line 385). The "top" program indicates that it increments in 32K
> > chunks every 40 - 50 iterations through that loop. The number of
> > iterations is not accurate due to timing differences between top and the
> > debugger. The only place I found an allocation was in a call to
> > G_zlib_read() from src/libes/gis/flate.c The call stack is
> >
> > G_get_raster_row()
> > get_map_row_nomask()
> > read_data()
> > read_data_fp_compressed()
> > G_zlib_read()
> >
> > However, it appears that this memory is freed properly and thus should
> > not be the cause of the leak. 
> >
> > This doesn't mean that it is the only allocation function, in fact the
> > evidence indicates that there must be another one somewhere. However,
> > I'm not sure where it is and you would have to trace through the
> > possible calls to find it.
> >
> > One thing to keep in mind is that the figures I mentioned above could be
> > dependent on the data. That is, the chunk size and number of iterations
> > could be very different for different data.
> >
> > I'm sorry, but I can't spend any more time on this. My suggestion would
> > be to start with the G_get_raster_row() function since it seems to be
> > the only thing in that loop which might do some memory allocation. Then
> > you trace through each function call inside G_get_raster_row() and try
> > to find memory allocated but not freed. You might want to look into
> > Linux debugging tools that could help you with this.
> >
> > Anyway, I hope this helps a little bit and good luck with the hunt!
> > Sorry I couldn't be of much help.
> >
> > --
> > Sincerely,
> >
> > Jazzman (a.k.a. Justin Hickey) e-mail: jhickey@hpcc.nectec.or.th
> [...]
>
> As I need the module for a project, I have to get it running. Therefore
> I am bothering you... my apologies!
>
> If you run the module with on a 2000x2000 DEM (or more), you can see
> the memory consumption.
>
I've tested r.sunmask.
The memory leakage appears in
col = data_buf;
pair = readamount / (n+1);
while (pair-- > 0) {
repeat = *cmp++;
while(repeat--)
for (k = 0; k < n; k++)
*col++ = cmp[k]; /**********/
cmp += n;
}
in read_data_compressed()
in src/libes/gis/get_row.c
I've experienced the following case with 2000*2000 map:
COMPRESSED = 1
readamount = 18 // size of cmp when reading
n = 1
DATA_NCOLS = 2000
so
if (COMPRESSED < 0 || readamount < n * DATA_NCOLS)
is true,
cmp structure is..
pair1: REPEAT | repeat1 | repeat2 | ... | repeatREPEAT
pair2: REPEAT | repeat1 | repeat2 | ... | repeatREPEAT
...
pairP: REPEAT | repeat1 | repeat2 | ... | repeatREPEAT
repeatn structure is..
cmp1 | cmp2 | ... | cmpn one byte per each section
...
Anyway, I met a memory leakage only if
*col++ = cmp[k];
is active.
I think a compressed data structure is somewhat different from an
uncompressing algorithm. I'm not sure :-).
I don't have much idea on a compression algorithm.
I'll continue to investigate.
Yours,
Huidae Cho
Perhaps Eric Miller can suggest as he worked on the compression?
It seems we are close the the problem now.
Thanks for investigating, Huidae,
Markus
From neteler Mon Jun 11 14:44:00 2001
Return-Path: <neteler>
Received: by hgeo02.geog.uni-hannover.de (SMI-8.6/SMI-SVR4)
id OAA23549; Mon, 11 Jun 2001 14:44:00 +0100
Date: Mon, 11 Jun 2001 14:44:00 +0100
From: Markus Neteler <neteler@geog.uni-hannover.de>
To: grass5@geog.uni-hannover.de
Subject: Re: [GRASS5] Darwin Pre1 NVIZ
Message-ID: <20010611144400.B23503@hgeo02.geog.uni-hannover.de>
Mail-Followup-To: grass5@geog.uni-hannover.de
References: <F97OONwIidWZe2BS7QT0000e753@hotmail.com> <15133.33019.929881.777086@cerise.nosuchdomain.co.uk> <20010605194015.D23813@calico.local> <15133.41062.452043.244362@cerise.nosuchdomain.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <15133.41062.452043.244362@cerise.nosuchdomain.co.uk>; from glynn.clements@virgin.net on Wed, Jun 06, 2001 at 04:15:50AM +0100
Sender: grass5-admin@geog.uni-hannover.de
Errors-To: grass5-admin@geog.uni-hannover.de
X-BeenThere: grass5@geog.uni-hannover.de
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:grass5-request@geog.uni-hannover.de?subject=help>
List-Post: <mailto:grass5@geog.uni-hannover.de>
List-Subscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=subscribe>
List-Id: GRASS 5 Developers mailing list <grass5.geog.uni-hannover.de>
List-Unsubscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=unsubscribe>
List-Archive: <http://www.geog.uni-hannover.de/pipermail/grass5/>
Status: O
Content-Length: 772
Lines: 21
On Wed, Jun 06, 2001 at 04:15:50AM +0100, Glynn Clements wrote:
[...]
Anyway, all of this is moot unless g3d finds its way back into the
source tree.
So, should I get rid of the GLw checks altogether? Or is g3d's absence
likely to be only temporary?
Glynn,
this g3d absence *is* only temporary unless the bugs are fixed. Jaro
Hofierka offered to look into them, probably he will find the time.
Or, Helena, could you provide some help?
Basic bug is the 3D coordinates system confusion: The 3D coordinates system
should be similar to GRASS 2D, just with a 3rd dimension. At time some
modules read bottom-up, other top-down etc. Maybe much of the problems
can be cleaned out without too much work, only someone has to fully
understand the g3d concept.
Markus
From neteler Mon Jun 11 15:44:43 2001
Return-Path: <neteler>
Received: by hgeo02.geog.uni-hannover.de (SMI-8.6/SMI-SVR4)
id PAA24129; Mon, 11 Jun 2001 15:44:43 +0100
Date: Mon, 11 Jun 2001 15:44:43 +0100
From: Markus Neteler <neteler@geog.uni-hannover.de>
To: grass5@geog.uni-hannover.de
Subject: Re: [GRASS5] Darwin Pre1 gtty stty errors
Message-ID: <20010611154443.E23925@hgeo02.geog.uni-hannover.de>
Mail-Followup-To: grass5@geog.uni-hannover.de
References: <15132.13310.868959.945983@cerise.nosuchdomain.co.uk> <200106050522.WAA07011@avocet.mail.pas.earthlink.net> <15132.30517.624912.72271@cerise.nosuchdomain.co.uk> <15133.44162.682393.984594@cerise.nosuchdomain.co.uk> <20010605213631.E28461@calico.local> <15133.49359.961007.76658@cerise.nosuchdomain.co.uk> <20010605235706.A29570@calico.local> <15133.58130.485743.341112@cerise.nosuchdomain.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <15133.58130.485743.341112@cerise.nosuchdomain.co.uk>; from glynn.clements@virgin.net on Wed, Jun 06, 2001 at 09:00:18AM +0100
Sender: grass5-admin@geog.uni-hannover.de
Errors-To: grass5-admin@geog.uni-hannover.de
X-BeenThere: grass5@geog.uni-hannover.de
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:grass5-request@geog.uni-hannover.de?subject=help>
List-Post: <mailto:grass5@geog.uni-hannover.de>
List-Subscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=subscribe>
List-Id: GRASS 5 Developers mailing list <grass5.geog.uni-hannover.de>
List-Unsubscribe: <http://www.geog.uni-hannover.de/mailman/listinfo/grass5>,
<mailto:grass5-request@geog.uni-hannover.de?subject=unsubscribe>
List-Archive: <http://www.geog.uni-hannover.de/pipermail/grass5/>
Status: O
Content-Length: 1044
Lines: 27
On Wed, Jun 06, 2001 at 09:00:18AM +0100, Glynn Clements wrote:
[...]
> > BTW, this doesn't really apply to d.colors, which is almost entirely
> > interface.
>
> Probably d.colors will disappear eventually. 24bit displays are pretty
> common...
That doesn't really relate to the issue of assigning colours to raster
maps. A raster cell stores either a discrete category or scalar value,
not a colour. Regardless of display hardware, colour tables
("palettes") are still an essential part of the process, so a means to
edit them is still necessary.
It seems more likely that d.colors would simply be replaced with a GUI
version. It doesn't seem likely that anyone would want to
interactively edit colour tables without being able to see the results
(which implies running XDRIVER, which implies being able to run a GUI
tool).
It seems that a GUI (tcl/tk) version is already present:
src/tcltkgrass/todo/r.colortool
It offers RGB sliders etc. Only it needs a bit of update... Volunteers?
Cheers
Markus