Opened 15 years ago

Closed 14 years ago

#1020 closed defect (fixed)

Display of vector maps fails

Reported by: MilenaN Owned by: grass-dev@…
Priority: blocker Milestone: 6.4.0
Component: Database Version: 6.4.0 RCs
Keywords: wingrass, db.describe, wxGUI Cc:
CPU: x86-64 Platform: MSWindows 7

Description

GRASS freezes when trying to open a vector map. Both Apply and OK buttons has been tested. Raster maps can be opened with no problem.

Change History (28)

comment:1 by martinl, 15 years ago

Priority: normalblocker

comment:2 by marisn, 15 years ago

Works fine on Vista WinGRASS-6.4.SVN-r41749-1.

Could be something like Vista UAC related issues?

comment:3 by marisn, 15 years ago

I also noticed, that enabling DEBUG will make WxGUI to hang (Not responding). MilenaN - can You run "g.gisenv set='DEBUG=0'" in GUI CMD prompt or CMD and then try to display vector map?

in reply to:  description comment:4 by martinl, 15 years ago

Replying to MilenaN:

GRASS freezes when trying to open a vector map. Both Apply and OK buttons has been tested. Raster maps can be opened with no problem.

I have similar problem on MS Windows 2008.

Running GRASS locally from MSYS works, i.e. I can display a vector map.

landa@GEO1 /osgeo4w/usr/src/grass64_release
$ ./bin.i686-pc-mingw32/grass64 -wx

Running installed version, GRASS freezes when displaying a vector map. Reason is db.describe command which is launched on the background.

GUI D1/1: gcmd.Command(): db.describe -c --q table=archsites driver=dbf database=C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/
UPOZORNÌNÍ: Nelze spustit pøíkaz

When running manually from MSYS

GRASS 6.4> db.describe -c --q table=archsites driver=dbf database="C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/"
Bad file descriptor: Files

The same command works when running the command from OSGeo MSYS

db.describe -c --q table=archsites driver=dbf database="C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/"
ncols: 2
nrows: 25
Column 1: cat:INTEGER:11
Column 2: str1:CHARACTER:30

Any pointers?

comment:5 by hamish, 15 years ago

When running manually from MSYS

GRASS 6.4> db.describe -c --q table=archsites driver=dbf \
  database="C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/"
Bad file descriptor: Files

... perhaps stating the obvious, but it looks like we missed quoting a path name variable and the $GISBASE/driver/db/dbf program is being sent as "C:\Program" and then "Files\GRASS64\..." ??

what do the previous debug messages say with DEBUG=5?

Hamish

in reply to:  5 ; comment:6 by martinl, 15 years ago

Replying to hamish:

When running manually from MSYS

> GRASS 6.4> db.describe -c --q table=archsites driver=dbf \
>   database="C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/"
> Bad file descriptor: Files

... perhaps stating the obvious, but it looks like we missed quoting a path name variable and the $GISBASE/driver/db/dbf program is being sent as "C:\Program" and then "Files\GRASS64\..." ??

what do the previous debug messages say with DEBUG=5?

Doesn't seems to be that problem (note that $GISBASE contains a space)

GRASS 6.4> db.describe -c --q table=archsites driver=dbf database="C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/"
D2/5: dbDbmscap(): opendir [c:\osgeo4w\usr\src\grass64 release\dist.i686-pc-mingw32\driver\db\]
D2/5: dbDbmscap(): opendir [c:\osgeo4w\usr\src\grass64 release\dist.i686-pc-mingw32\driver\db\]
D2/5: dbmi_client/start startup: [c:\osgeo4w\usr\src\grass64 release\dist.i686-pc-mingw32\driver\db\dbf.exe]
D2/5: DBF: db__driver_open_database() name = 'C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/'
D2/5: db.name = C:\Users\landa\grass data/spearfish60/PERMANENT/dbf/
...

But

GRASS 6.4> db.describe -c --q table=archsites driver=dbf database="C:\Users\land
D2/5: dbDbmscap(): opendir [c:\Program Files (x86)\GRASS-64-SVN\driver\db\]
D2/5: dbDbmscap(): opendir [c:\Program Files (x86)\GRASS-64-SVN\driver\db\]
D2/5: dbmi_client/start startup: [c:\Program Files (x86)\GRASS-64-SVN\driver\db\
Bad file descriptor: Files

in reply to:  6 ; comment:7 by martinl, 15 years ago

Replying to martinl:

But

> GRASS 6.4> db.describe -c --q table=archsites driver=dbf database="C:\Users\land
> D2/5: dbDbmscap(): opendir [c:\Program Files (x86)\GRASS-64-SVN\driver\db\]
> D2/5: dbDbmscap(): opendir [c:\Program Files (x86)\GRASS-64-SVN\driver\db\]
> D2/5: dbmi_client/start startup: [c:\Program Files (x86)\GRASS-64-SVN\driver\db\
> Bad file descriptor: Files

seems to be problem with _spawnl grass/branches/releasebranch_6_4/lib/db/dbmi_client/start.c@41132#L221

comment:8 by hamish, 15 years ago

is "C:\Program Files (x86)" common for 64bit Windows7 or a local install choice? Including $arch there is something new to me. Is that $arch seen with Vista 64bit too?

seems to be problem with _spawnl grass/branches/releasebranch_6_4/lib/db/dbmi_client/start.c@41132#L221

apparently so.

that is the only place in the 6.4 code that uses _spawnl(), although lib/gis/system.c uses, and comments in g.parser speak of _spawnlp().

one obvious thing is that in the non-osgeo4w install the startup string does is missing an executable name (which must end in .exe for _spawnl() too), it is just the dir. (but where is the closing "]" on that string too?)

Hamish

in reply to:  7 ; comment:9 by glynn, 15 years ago

Replying to martinl:

seems to be problem with _spawnl

Yep. _spawnl() simply concatenates its arguments, with spaces between them; it doesn't perform any quoting.

An example of "correct" quoting can be found in escape_arg() in lib/gis/spawn.c. "correct" in quotes because it's up to the C runtime as to how to parse the command line into individual arguments; the escape_arg() function matches the MSVC behaviour, and is the same algorithm as used by e.g. Python's subprocess module (see list2cmdline() in subprocess.py).

MSDN reference: http://msdn.microsoft.com/en-us/library/17w5ykft.aspx

in reply to:  8 comment:10 by martinl, 15 years ago

Replying to hamish:

is "C:\Program Files (x86)" common for 64bit Windows7 or a local install choice? Including

yes.

one obvious thing is that in the non-osgeo4w install the startup string does is missing an executable name (which must end in .exe for _spawnl() too), it is just the dir. (but where is the closing "]" on that string too?)

sorry, the message has been just truncated...

in reply to:  9 ; comment:11 by martinl, 15 years ago

Replying to glynn:

seems to be problem with _spawnl

Yep. _spawnl() simply concatenates its arguments, with spaces between them; it doesn't perform any quoting.

An example of "correct" quoting can be found in escape_arg() in lib/gis/spawn.c. "correct" in quotes because it's up to the C runtime as to how to parse the command line into individual arguments; the escape_arg() function matches the MSVC behaviour, and is the same algorithm as used by e.g. Python's subprocess module (see list2cmdline() in subprocess.py).

MSDN reference: http://msdn.microsoft.com/en-us/library/17w5ykft.aspx

Couldn't we use simply G_spawn() or G_spawn_ex()?

comment:12 by martinl, 15 years ago

Component: wxGUIDatabase
Keywords: db.describe wxGUI added

in reply to:  11 ; comment:13 by glynn, 15 years ago

Replying to martinl:

Couldn't we use simply G_spawn() or G_spawn_ex()?

Assuming that the current G_spawn_ex() works reliably on Windows, it can be used. Earlier versions didn't support redirection of stdin/stdout on Windows.

The new version made it into RC6, so I'm assuming that it's basically okay.

comment:14 by hamish, 15 years ago

Glynn:

The new version made it into RC6, so I'm assuming that it's basically okay.

..although nothing there actually calls it, the 6.4 lib/gis/spawn.c is identical to the version which is used by g.gui in 6.5, so presumably it's pretty well tested by now.

in reply to:  13 comment:15 by martinl, 14 years ago

Replying to glynn:

Replying to martinl:

Couldn't we use simply G_spawn() or G_spawn_ex()?

Assuming that the current G_spawn_ex() works reliably on Windows, it can be used. Earlier versions didn't support redirection of stdin/stdout on Windows.

The new version made it into RC6, so I'm assuming that it's basically okay.

my wild guess

     G_debug(2, "dbmi_client/start startup: [%s]", startup);
-    pid = _spawnl(_P_NOWAIT, startup, startup, NULL);
+    pid = G_spawn_ex(startup, startup, NULL);

fails. Any hits how to fix this blocker issue.

comment:16 by glynn, 14 years ago

Most of the bottom half of db_start_driver() (the part that's split into distinct Windows/Unix versions) should be replaced with a call to G_spawn_ex().

Try r42651.

in reply to:  16 ; comment:17 by martinl, 14 years ago

Replying to glynn:

Most of the bottom half of db_start_driver() (the part that's split into distinct Windows/Unix versions) should be replaced with a call to G_spawn_ex().

Try r42651.

Thanks! Seems to work, backported in r42654 to devbr6 (available for testing in the next daily build on http://josef.fsv.cvut.cz/wingrass). Martin

in reply to:  17 ; comment:18 by martinl, 14 years ago

Replying to martinl:

Thanks! Seems to work, backported in r42654 to devbr6 (available for testing in the next daily build on http://josef.fsv.cvut.cz/wingrass). Martin

Seems to also work in devbr6. When displaying archsites from spearfish60 I am just getting some warnings

G_spawn: unable to redirect descriptor 4
G_spawn: unable to redirect descriptor 5

Any idea how it could be fixed. Thanks.

in reply to:  18 ; comment:19 by glynn, 14 years ago

Replying to martinl:

Seems to also work in devbr6. When displaying archsites from spearfish60 I am just getting some warnings

G_spawn: unable to redirect descriptor 4
G_spawn: unable to redirect descriptor 5

Any idea how it could be fixed. Thanks.

Backport r40905.

in reply to:  19 ; comment:20 by martinl, 14 years ago

Replying to glynn:

Replying to martinl:

Seems to also work in devbr6. When displaying archsites from spearfish60 I am just getting some warnings

Backport r40905.

Done in r42667 (devbr6) and r42668 (relbr64). Martin

in reply to:  20 ; comment:21 by crazyb0b, 14 years ago

Replying to martinl:

Replying to glynn:

Replying to martinl:

Seems to also work in devbr6. When displaying archsites from spearfish60 I am just getting some warnings

Backport r40905.

Done in r42667 (devbr6) and r42668 (relbr64). Martin

I'm getting this error on x64_64 Linux (Arch Linux) with a newly built r42701 from trunk. Is there any resolution?

in reply to:  21 comment:22 by hamish, 14 years ago

Replying to crazyb0b:

I'm getting this error on x64_64 Linux (Arch Linux) with a newly built r42701 from trunk. Is there any resolution?

what's the exact error message?

in reply to:  21 ; comment:23 by martinl, 14 years ago

Replying to crazyb0b:

Done in r42667 (devbr6) and r42668 (relbr64). Martin

I'm getting this error on x64_64 Linux (Arch Linux) with a newly built r42701 from trunk. Is there any resolution?

Please provide more precise description... Can you reproduce this behaviour also with GRASS 6.4?

Martin

in reply to:  23 ; comment:24 by crazyb0b, 14 years ago

Replying to martinl:

Please provide more precise description...

Martin

Most of the time the GUI just freezes up with the selection box in the clicked position. Other times I receive this message:

The program 'python' received an X Window System error.

This probably reflects a bug in the program. The error was 'BadRequest (invalid request code or no such operation)'.

(Details: serial 2659954 error_code 1 request_code 121 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously;

that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)

Can you reproduce this behaviour also with GRASS 6.4?

I've been using the TCLTK GUI in 6.4 and that seems to work just fine. I'll try later with the wxPython GUI and see if the same issue occurs.

in reply to:  24 ; comment:25 by glynn, 14 years ago

Replying to crazyb0b:

Most of the time the GUI just freezes up with the selection box in the clicked position. Other times I receive this message:

The program 'python' received an X Window System error.

This probably reflects a bug in the program. The error was 'BadRequest (invalid request code or no such operation)'.

(Details: serial 2659954 error_code 1 request_code 121 minor_code 0)

This is an entirely unrelated issue. Please open a new defect for it.

in reply to:  25 ; comment:26 by martinl, 14 years ago

Replying to glynn:

This is an entirely unrelated issue. Please open a new defect for it.

Right, it's seems to me that we can close this ticket.

in reply to:  26 comment:27 by hellik, 14 years ago

Replying to martinl:

Replying to glynn:

This is an entirely unrelated issue. Please open a new defect for it.

Right, it's seems to me that we can close this ticket.

see also #1121.

I've tested this with WinGRASS-6.4.SVN-r42912-1-Setup.exe on WinVista32. I can't reproduce this.

Helmut

comment:28 by martinl, 14 years ago

Resolution: fixed
Status: newclosed

Please reopen the ticket if needed.

Note: See TracTickets for help on using tickets.