[GRASS-dev] GRASS 6.2.2: gis.m crashes when there are more than one map with same name in path

Hello,

I don't know if this is a problem with just my installation (compiled Debian 6.2.2 package with source code from Debian site) but it seems that that an important bug which (AFAIK) is fixed in 6.3, is still present in 6.2.2:

In spearfish:

1) g.copy vect=fields@PERMANENT,fields

2) Select 'fields' as vector file to display and in Map Display "Zoom to selected map".

=> gis.m crashes and in terminal you see:

WARNING: 'vector/fields' was found in more mapsets (also found in user1).

If another bugfix release of 6.2 is foreseen can this be backported ?

Moritz

Re-launching this question since we will begin GIS classes soon with 6.2.2 and I would like to resolve this before.

Can someone confirm this bug ? If yes, could someone point me to the fix in 6.3, so that I can at least locally backport it to 6.2.2 ?

Thanks,

Moritz

On 12/10/07 19:16, Moritz Lennert wrote:

Hello,

I don't know if this is a problem with just my installation (compiled Debian 6.2.2 package with source code from Debian site) but it seems that that an important bug which (AFAIK) is fixed in 6.3, is still present in 6.2.2:

In spearfish:

1) g.copy vect=fields@PERMANENT,fields

2) Select 'fields' as vector file to display and in Map Display "Zoom to selected map".

=> gis.m crashes and in terminal you see:

WARNING: 'vector/fields' was found in more mapsets (also found in user1).

If another bugfix release of 6.2 is foreseen can this be backported ?

Moritz

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

Moritz,

no big deal to make a 6.2.3 release.

I am afraid that you need to use gdb or ddd (see Wiki for instructions)
to debug a bit.

Markus

On Tue, Oct 16, 2007 at 11:16:07AM +0200, Moritz Lennert wrote:

Re-launching this question since we will begin GIS classes soon with
6.2.2 and I would like to resolve this before.

Can someone confirm this bug ? If yes, could someone point me to the fix
in 6.3, so that I can at least locally backport it to 6.2.2 ?

Thanks,

Moritz

On 12/10/07 19:16, Moritz Lennert wrote:
> Hello,
>
> I don't know if this is a problem with just my installation (compiled
> Debian 6.2.2 package with source code from Debian site) but it seems
> that that an important bug which (AFAIK) is fixed in 6.3, is still
> present in 6.2.2:
>
> In spearfish:
>
> 1) g.copy vect=fields@PERMANENT,fields
>
> 2) Select 'fields' as vector file to display and in Map Display "Zoom to
> selected map".
>
> => gis.m crashes and in terminal you see:
>
> WARNING: 'vector/fields' was found in more mapsets (also found in user1).
>
> If another bugfix release of 6.2 is foreseen can this be backported ?
>
> Moritz

------------------
ITC -> dall'1 marzo 2007 Fondazione Bruno Kessler
ITC -> since 1 March 2007 Fondazione Bruno Kessler
------------------

On 16/10/07 11:40, Maris Nartiss wrote:

Hi,
IMHO You are interested in this (removed G_warning):
http://freegis.org/cgi-bin/viewcvs.cgi/grass6/lib/gis/find_file.c.diff?r1=text&tr1=1.4&r2=1.8%3AHEAD&tr2=1.4&diff_format=h

Thanks, but that's not it. But I think I found it now:

http://freegis.org/cgi-bin/viewcvs.cgi/grass6/gui/tcltk/gis.m/mapcanvas.tcl.diff?r1=1.72&r2=1.73

Moritz

On 16/10/07 11:40, Markus Neteler wrote:

Moritz,

no big deal to make a 6.2.3 release.

I am afraid that you need to use gdb or ddd (see Wiki for instructions)
to debug a bit.

No this is a tcltk gis.m issue. I think I found it now (at least it seems to work here):

http://freegis.org/cgi-bin/viewcvs.cgi/grass6/gui/tcltk/gis.m/mapcanvas.tcl.diff?r1=1.72&r2=1.73

But maybe Michaal can just confirm, and more generally say which gis.m bugfixes in CVS should go to a 6.2.3 release.

Moritz

On 16/10/07 13:58, Maris Nartiss wrote:

Hi,
sorry, but You are wrong. There two sides of this problem:
1) lib/gis/find_file.c prints warning but it shouldn't (it also
affects other places - d.m; g.remove et.al.)

Why shouldn't it print a warning ?
We had a discussion concerning this warning on the dev list, but I currently don't have the time to go looking for it.

2) gis.m (and d.m) unproperly handle errors.

My suggestion - first - fix find_file.c after line 58 and only then
look for tcl interface errors.

Well, I think that the tcl-side correction is much less invasive and corrects a real problem with gis.m, i.e. that the whole gui crashes just because it encounters this warning. As we don't know if there might be other such warnings which might cause the same problem, I prefer fixing gis.m, as the discussion concerning whether the warning should be printed or not seems more fundamental to me.

But thanks for all your help !

Moritz

Moritz Lennert wrote:

> I don't know if this is a problem with just my installation (compiled
> Debian 6.2.2 package with source code from Debian site) but it seems
> that that an important bug which (AFAIK) is fixed in 6.3, is still
> present in 6.2.2:
>
> In spearfish:
>
> 1) g.copy vect=fields@PERMANENT,fields
>
> 2) Select 'fields' as vector file to display and in Map Display "Zoom to
> selected map".
>
> => gis.m crashes and in terminal you see:
>
> WARNING: 'vector/fields' was found in more mapsets (also found in user1).
>
> If another bugfix release of 6.2 is foreseen can this be backported ?
>
Re-launching this question since we will begin GIS classes soon with
6.2.2 and I would like to resolve this before.

Can someone confirm this bug ? If yes, could someone point me to the fix
in 6.3, so that I can at least locally backport it to 6.2.2 ?

In mapcanvas.tcl, proc MapCanvas::zoom_gregion:

6.2.2:
    if {[catch {close $input} error]} {
      puts $error
      exit
    }
CVS:
    if {[catch {close $input} error]} {
      Gm::errmsg $error [G_msg "Error setting region"]
    }

The quickest fix is to change "exit" to "return" (Gm::errmsg ends with
"uplevel 1 return", which causes its caller to return).

BTW, I note that the top of gm.tcl has been modified to catch errors
and call Gm::errmsg. But Gm::errmsg hasn't been defined at that point.

--
Glynn Clements <glynn@gclements.plus.com>

This bug is a combination of TclTk and non-TclTk issues. The proximate
'cause' is that TclTk treats all data sent to stderr as real errors.

The current fix in 6.3 involves select.tcl (which now adds @[mapset] to all
selected items -- I don't know if this would or would not break other things
in 6.2), changes to quiet extraneous messages like the one below in some of
the GRASS modules, and changes to mapcanvas.tcl (and many other modules) to
greatly improve error trapping. The latter involves new error trapping
routines in gm.tcl.

I agree with Glynn that the easiest fix is to replace exit with return. This
will simply output the "error" message to the terminal and continue on.

I'm not sure how to put this into 6.2.2. Can you do it Moritz?

Michael

On 10/16/07 5:37 AM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Moritz Lennert wrote:

I don't know if this is a problem with just my installation (compiled
Debian 6.2.2 package with source code from Debian site) but it seems
that that an important bug which (AFAIK) is fixed in 6.3, is still
present in 6.2.2:

In spearfish:

1) g.copy vect=fields@PERMANENT,fields

2) Select 'fields' as vector file to display and in Map Display "Zoom to
selected map".

=> gis.m crashes and in terminal you see:

WARNING: 'vector/fields' was found in more mapsets (also found in user1).

If another bugfix release of 6.2 is foreseen can this be backported ?

Re-launching this question since we will begin GIS classes soon with
6.2.2 and I would like to resolve this before.

Can someone confirm this bug ? If yes, could someone point me to the fix
in 6.3, so that I can at least locally backport it to 6.2.2 ?

In mapcanvas.tcl, proc MapCanvas::zoom_gregion:

6.2.2:
if {[catch {close $input} error]} {
puts $error
exit
}
CVS:
if {[catch {close $input} error]} {
Gm::errmsg $error [G_msg "Error setting region"]
}

The quickest fix is to change "exit" to "return" (Gm::errmsg ends with
"uplevel 1 return", which causes its caller to return).

BTW, I note that the top of gm.tcl has been modified to catch errors
and call Gm::errmsg. But Gm::errmsg hasn't been defined at that point.

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Michael Barton wrote:

This bug is a combination of TclTk and non-TclTk issues. The proximate
'cause' is that TclTk treats all data sent to stderr as real errors.

The current fix in 6.3 involves select.tcl (which now adds @[mapset] to all
selected items

Failure to add the @mapset probably results in a bug in the handling
of the case where the current mapset isn't the first one in the mapset
search path (an unqualified map name refers to the first map found
with that name, not necessarily the one in the current mapset).

--
Glynn Clements <glynn@gclements.plus.com>

Moritz Lennert-2 wrote:

On 16/10/07 11:40, Markus Neteler wrote:

Moritz,

no big deal to make a 6.2.3 release.

I am afraid that you need to use gdb or ddd (see Wiki for instructions)
to debug a bit.

No this is a tcltk gis.m issue. I think I found it now (at least it
seems to work here):

http://freegis.org/cgi-bin/viewcvs.cgi/grass6/gui/tcltk/gis.m/mapcanvas.tcl.diff?r1=1.72&r2=1.73

But maybe Michaal can just confirm, and more generally say which gis.m
bugfixes in CVS should go to a 6.2.3 release.

Moritz

Fixed for 6.2.3 as
http://grass.itc.it/pipermail/grass-commit/2007-October/030589.html
which differs from above mentioned patch.

Hope this right now.

Markus

--
View this message in context: http://www.nabble.com/GRASS-6.2.2%3A-gis.m-crashes-when-there-are-more-than-one-map-with-same-name-in-path-tf4614950.html#a13330618
Sent from the Grass - Dev mailing list archive at Nabble.com.