For some time the debug messages in grass63-cvs are no longer working for me.
`g.gisenv set=DEBUG=5` seems to do its job as `g.gisenv DEBUG` returns "5" but no debug messages are printed when I call a module.
I tried a `make distclean`, even a complete new install of the whole source tree, but the problem is still there.
`./configure` and `make` run without errors...
It works fine in grass6.2.0-RC3 on the same machine, configured and compiled the same way.
Any ideas where the problem lies or what I did wrong?
Thank you,
Florian
--
Florian Kindl
Institute of Geography
University of Innsbruck
For some time the debug messages in grass63-cvs are no longer working for
me.
`g.gisenv set=DEBUG=5` seems to do its job as `g.gisenv DEBUG` returns
"5" but no debug messages are printed when I call a module.
I tried a `make distclean`, even a complete new install of the whole
source tree, but the problem is still there.
`./configure` and `make` run without errors...
It works fine in grass6.2.0-RC3 on the same machine, configured and
compiled the same way.
Any ideas where the problem lies or what I did wrong?
Thank you,
Florian
--
Florian Kindl
Institute of Geography
University of Innsbruck
For some time the debug messages in grass63-cvs are no longer working
for me.
`g.gisenv set=DEBUG=5` seems to do its job as `g.gisenv DEBUG` returns
"5" but no debug messages are printed when I call a module.
I tried a `make distclean`, even a complete new install of the whole
source tree, but the problem is still there.
`./configure` and `make` run without errors...
It works fine in grass6.2.0-RC3 on the same machine, configured and
compiled the same way.
Any ideas where the problem lies or what I did wrong?
I have the same trouble. I don't know why it happens. It works fine for
me in 6.2.
if ((fd = open_env ("r", loc)))
{
- while (G_getl2 (buf, sizeof buf, fd))
+ while (G_getl (buf, sizeof buf, fd))
{
for (name = value = buf; *value; value++)
if (*value == ':')
[snip]
G_getl2() call G_debug() before reading DEBUG value, in the result
static variable grass_debug_level in lib/gis/debug.c is set to 0.
Best, Martin
2006/11/5, Hamish <hamish_nospam@yahoo.com>:
Florian Kindl wrote:
>
> For some time the debug messages in grass63-cvs are no longer working
> for me.
>
> `g.gisenv set=DEBUG=5` seems to do its job as `g.gisenv DEBUG` returns
> "5" but no debug messages are printed when I call a module.
>
> I tried a `make distclean`, even a complete new install of the whole
> source tree, but the problem is still there.
> `./configure` and `make` run without errors...
>
> It works fine in grass6.2.0-RC3 on the same machine, configured and
> compiled the same way.
>
> Any ideas where the problem lies or what I did wrong?
I have the same trouble. I don't know why it happens. It works fine for
me in 6.2.
it seems that the problem is calling G_getl2() function [grass63] in
lib/gis/env.c
[snip]
G_getl2() call G_debug() before reading DEBUG value, in the result
static variable grass_debug_level in lib/gis/debug.c is set to 0.
Thank you, Martin!
I don't know how to repair G_getl2() properly, but commenting out the G_debug() statement in lib/gis/getl.c (veeeery dirty, I know...) fixes it for the moment...
thanks,
-Flo.
--
Florian Kindl
Institute of Geography
University of Innsbruck
> Hi all,
>
> it seems that the problem is calling G_getl2() function [grass63] in
> lib/gis/env.c
>
> [snip]
>
> G_getl2() call G_debug() before reading DEBUG value, in the result
> static variable grass_debug_level in lib/gis/debug.c is set to 0.
>
Thank you, Martin!
I don't know how to repair G_getl2() properly, but commenting out the
G_debug() statement in lib/gis/getl.c (veeeery dirty, I know...) fixes it
for the moment...
thanks,
-Flo.
--
Florian Kindl
Institute of Geography
University of Innsbruck
> I am also not sure, is this patch enough to fix it?
> - G_debug ( 4, "G_getl2: ->%s<-", buf );
> + if (G__getenv ("DEBUG"))
> + G_debug ( 4, "G_getl2: ->%s<-", buf );
>
here, it works ...
yes, I meant -- when you do not set up DEBUG variable and call
G_getl2() function no debug message (inside the function) will be
printed. It is not nice solution.
Cheers, Martin
--
Florian Kindl
Institute of Geography
University of Innsbruck
> > I am also not sure, is this patch enough to fix it?
> > - G_debug ( 4, "G_getl2: ->%s<-", buf );
> > + if (G__getenv ("DEBUG"))
> > + G_debug ( 4, "G_getl2: ->%s<-", buf );
> >
>
> here, it works ...
yes, I meant -- when you do not set up DEBUG variable and call
G_getl2() function no debug message (inside the function) will be
printed. It is not nice solution.
I would like to kindly ask you -- is it good enough for committing to
CVS? [no objections or feedback ~= can be commited;-).
> > it seems that the problem is calling G_getl2() function [grass63]
> > in lib/gis/env.c
> >
> > [snip]
> >
> > G_getl2() call G_debug() before reading DEBUG value, in the result
> > static variable grass_debug_level in lib/gis/debug.c is set to 0.
> >
>
> Thank you, Martin!
>
> I don't know how to repair G_getl2() properly, but commenting out
> the G_debug() statement in lib/gis/getl.c (veeeery dirty, I know...)
> fixes it for the moment...
Ah I see,
the fn that reads .grassrc6 (lib/gis/env.c) is now calling G_getl2(),
and G_getl2() calls G_debug(), which needs a value from .grassrc6.
Do we have to worry about .grassrc6 getting DOS newlines in it?
(user shouldn't be copying that between systems and should not be
editing it)
-> back to using G_getl()
Does G_getl2() really need to call G_debug? I don't think so, the module
that calls it can add G_debug(5, "input line=", buff); if they want
that info.
--> I suggest removing G_debug() from G_getl2() altogether.
Martin's patch fixes this case, but we would need to always audit env.c
and everything it calls, and everything those calls call, to check it
doesn't have any g.gisenv reqs..
> > > I am also not sure, is this patch enough to fix it?
> > > - G_debug ( 4, "G_getl2: ->%s<-", buf );
> > > + if (G__getenv ("DEBUG"))
> > > + G_debug ( 4, "G_getl2: ->%s<-", buf );
> > >
> >
> > here, it works ...
>
> yes, I meant -- when you do not set up DEBUG variable and call
> G_getl2() function no debug message (inside the function) will be
> printed. It is not nice solution.
I would like to kindly ask you -- is it good enough for committing to
CVS? [no objections or feedback ~= can be commited;-).
the fn that reads .grassrc6 (lib/gis/env.c) is now calling G_getl2(),
and G_getl2() calls G_debug(), which needs a value from .grassrc6.
Do we have to worry about .grassrc6 getting DOS newlines in it?
(user shouldn't be copying that between systems and should not be
editing it)
-> back to using G_getl()
not sure, on the other hand it is always better to take care about
various newlines...
Does G_getl2() really need to call G_debug? I don't think so, the module
that calls it can add G_debug(5, "input line=", buff); if they want
that info.
--> I suggest removing G_debug() from G_getl2() altogether.
That's the issue (for me), is there any reason why G_getl2() calls
G_debug() [G_getl() does not call G_debug()]. These two functions
(i.e. G_getl() and G_getl2()) are very similar (the second one only
cares about various newlines). So we should remove G_debug() calling
from G_getl2() or similarly to add G_debug () to G_getl().
From simple point of view I also suggest *removing* G_debug() from G_getl2().
Martin
Martin's patch fixes this case, but we would need to always audit env.c
and everything it calls, and everything those calls call, to check it
doesn't have any g.gisenv reqs..
> > > > I am also not sure, is this patch enough to fix it?
> > > > - G_debug ( 4, "G_getl2: ->%s<-", buf );
> > > > + if (G__getenv ("DEBUG"))
> > > > + G_debug ( 4, "G_getl2: ->%s<-", buf );
> > > >
> > >
> > > here, it works ...
> >
> > yes, I meant -- when you do not set up DEBUG variable and call
> > G_getl2() function no debug message (inside the function) will be
> > printed. It is not nice solution.
>
> I would like to kindly ask you -- is it good enough for committing
> to CVS? [no objections or feedback ~= can be commited;-).
>
> Debug messages are still broken in grass63.
commited to CVS...
Thank you very much for finding and fixing this Martin. After thinking
about it some more I came to the conclusion that G_debug() doesn't
belong in a low-level fn like G_getl2() at all, so I've removed it. It
is the module's choice to spit out a debug message with the result if
wanted. And solving the problem by adding more G_* calls might lead to
the same flavour of bug happening again (in fact G__getenv() calls
read_env() which calls G_getl2() - more circles!).
Also, G_getl2() is used in loops to read huge files, so any chance to
make it simpler (& thus faster) should be taken.