[GRASS5] Re: [GRASSLIST:2259] Re: NVIZ on Cygwin

On Sat, 17 Jan 2004, Glynn Clements wrote:

Unfortunately, almost everything which could possibly go wrong with
building NVIZ results in exactly this error message (including the
stuff which I've snipped).

The only way to track such problems down is to use a debugger (e.g.
gdb). If you can try the following, it may provide useful information:

  GRASS:~ > eval `g.gisenv`
  GRASS:~ > gdb /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/NVWISH2.2
  > run -f /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/scripts/nviz2.2_script ned_patch -name NVIZ
  [... segmentation fault ...]
  > where

I tried this, with slightly different results from Richard although they
don't look any more informative (see below). I used the 5.3 version of
NVIZ with the latest patches from Bob Covill.

Upon giving the above command, an empty (black) Windows command-line
window appeared; the title bar contained the name of the NVWISH2.2
program. The message
---Type <return> to continue, or q <return> to quit---
then appeared in the terminal where NVIZ was started and on pressing
return, the segmentation fault happened.

What do the two question marks and empty brackets mean? Do the provided
xtcltk libaries have debugging information? Does anything else need to be
compiled with debugging turned on?

Starting program:
/home/administrator/gbldstat/dist.i686-pc-cygwin/etc/nviz2.2/NVWISH2.2 -f
/home/administrator/gbldstat/dist.i686-pc-cygwin/etc/nviz2.2/nviz2.2_script
elevation.dem -name NVIZ
---Type <return> to continue, or q <return> to quit---

Program received signal SIGSEGV, Segmentation fault.
0x3096f700 in ?? ()
(gdb) where
#0 0x3096f700 in ?? ()
#1 0x00000400 in ?? ()
(gdb)

Paul Kelly wrote:

> Unfortunately, almost everything which could possibly go wrong with
> building NVIZ results in exactly this error message (including the
> stuff which I've snipped).
>
> The only way to track such problems down is to use a debugger (e.g.
> gdb). If you can try the following, it may provide useful information:
>
> GRASS:~ > eval `g.gisenv`
> GRASS:~ > gdb /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/NVWISH2.2
> > run -f /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/scripts/nviz2.2_script ned_patch -name NVIZ
> [... segmentation fault ...]
> > where

I tried this, with slightly different results from Richard although they
don't look any more informative (see below). I used the 5.3 version of
NVIZ with the latest patches from Bob Covill.

Yesterday, I finally got around to compiling GRASS (5.3, no more than
a week old) on Cygwin, and NVIZ works for me.

FWIW, the Tcl/Tk libraries which I'm using are:

-rwxrwxr-x 1 root root 568244 Apr 6 2001 libtcl8.0.a
-rwxrwxr-x 1 root root 791790 Apr 6 2001 libtk8.0.a

c3c3068a82675fe65a1481257abee9d4 libtcl8.0.a
e58da4259572da858fe3721f499382f6 libtk8.0.a

which are from:

-rwxrwxr-x 1 root root 2002441 Feb 4 01:06 xtcltk8.0.5-CYGWIN_NT-4.0-20010405-1.tar.gz*

b9e35f4d9f13404dc40384d2cdec0b85 xtcltk8.0.5-CYGWIN_NT-4.0-20010405-1.tar.gz

I have both the 8.0.2 and 8.3.4 libraries installed, but the headers
are those from 8.0.2.

I'll try again with 8.3.4.

Upon giving the above command, an empty (black) Windows command-line
window appeared; the title bar contained the name of the NVWISH2.2
program. The message
---Type <return> to continue, or q <return> to quit---
then appeared in the terminal where NVIZ was started and on pressing
return, the segmentation fault happened.

What do the two question marks and empty brackets mean? Do the provided
xtcltk libaries have debugging information? Does anything else need to be
compiled with debugging turned on?

Starting program:
/home/administrator/gbldstat/dist.i686-pc-cygwin/etc/nviz2.2/NVWISH2.2 -f
/home/administrator/gbldstat/dist.i686-pc-cygwin/etc/nviz2.2/nviz2.2_script
elevation.dem -name NVIZ
---Type <return> to continue, or q <return> to quit---

Program received signal SIGSEGV, Segmentation fault.
0x3096f700 in ?? ()
(gdb) where
#0 0x3096f700 in ?? ()
#1 0x00000400 in ?? ()
(gdb)

The ?? means that the there isn't any function at that address, e.g.
because:

a) the program jumped to a bogus memory location (e.g. through a
   corrupted function pointer or a corrupted return address),
b) the stack pointer is bogus,
c) the stack has been corrupted, or
d) the libraries were compiled with -fomit-frame-pointer.

--
Glynn Clements <glynn.clements@virgin.net>

Glynn Clements wrote:

> > Unfortunately, almost everything which could possibly go wrong with
> > building NVIZ results in exactly this error message (including the
> > stuff which I've snipped).
> >
> > The only way to track such problems down is to use a debugger (e.g.
> > gdb). If you can try the following, it may provide useful information:
> >
> > GRASS:~ > eval `g.gisenv`
> > GRASS:~ > gdb /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/NVWISH2.2
> > > run -f /home/Rich/grass/grass-5.0.3/dist.i686-pc-cygwin/etc/nviz2.2/scripts/nviz2.2_script ned_patch -name NVIZ
> > [... segmentation fault ...]
> > > where
>
> I tried this, with slightly different results from Richard although they
> don't look any more informative (see below). I used the 5.3 version of
> NVIZ with the latest patches from Bob Covill.

Yesterday, I finally got around to compiling GRASS (5.3, no more than
a week old) on Cygwin, and NVIZ works for me.

FWIW, the Tcl/Tk libraries which I'm using are:

-rwxrwxr-x 1 root root 568244 Apr 6 2001 libtcl8.0.a
-rwxrwxr-x 1 root root 791790 Apr 6 2001 libtk8.0.a

c3c3068a82675fe65a1481257abee9d4 libtcl8.0.a
e58da4259572da858fe3721f499382f6 libtk8.0.a

which are from:

-rwxrwxr-x 1 root root 2002441 Feb 4 01:06 xtcltk8.0.5-CYGWIN_NT-4.0-20010405-1.tar.gz*

b9e35f4d9f13404dc40384d2cdec0b85 xtcltk8.0.5-CYGWIN_NT-4.0-20010405-1.tar.gz

I have both the 8.0.2 and 8.3.4 libraries installed, but the headers
are those from 8.0.2.

I'll try again with 8.3.4.

Done that; NVIZ still works.

-r-xr-xr-x 1 root root 749892 Mar 28 2002 libtcl8.3.a*
-r-xr-xr-x 1 root root 985818 Mar 28 2002 libtk8.3.a*

fb69cc3342aa19f3fdb709738f6055e7 libtcl8.3.a
4e60b25c070637250f52aa13d5fcdc47 libtk8.3.a

From:

2983750b94c52b8a5ce1aa3e39e54e45 xtcltk-8.3.4-CYGWIN.tar.gz

> Upon giving the above command, an empty (black) Windows command-line
> window appeared; the title bar contained the name of the NVWISH2.2
> program. The message
> ---Type <return> to continue, or q <return> to quit---
> then appeared in the terminal where NVIZ was started and on pressing
> return, the segmentation fault happened.
>
> What do the two question marks and empty brackets mean? Do the provided
> xtcltk libaries have debugging information? Does anything else need to be
> compiled with debugging turned on?

The xtcltk 8.3.4 libraries don't have debug info, but they weren't
compiled with -fomit-frame-pointer, so you should still get a
backtrace, and functions which are from the NVIZ source code can be
debugged.

Although, if I run NVWISH2.2 under gdb, I get a segfault in libXext,
but not if I run it directly (with identical arguments).

FWIW, the relevant Cygwin components are:

XFree86-bin-4.2.0-3.tar.bz2
XFree86-xserv-4.2.0-37.tar.bz2
binutils-20030307-1.tar.bz2
cygwin-1.3.22-1.tar.bz2
gcc-2.95.3-5.tar.bz2
gdb-20030303-1.tar.bz2
opengl-1.1.0-6.tar.bz2
sunrpc-4.0-1.tar.bz2
zlib-1.1.4-1.tar.bz2

--
Glynn Clements <glynn.clements@virgin.net>

Glynn Clements wrote:

Yesterday, I finally got around to compiling GRASS (5.3, no more than
a week old) on Cygwin, and NVIZ works for me.

FWIW, the Tcl/Tk libraries which I'm using are:

-rwxrwxr-x 1 root root 568244 Apr 6 2001 libtcl8.0.a
-rwxrwxr-x 1 root root 791790 Apr 6 2001 libtk8.0.a

c3c3068a82675fe65a1481257abee9d4 libtcl8.0.a
e58da4259572da858fe3721f499382f6 libtk8.0.a

which are from:

-rwxrwxr-x 1 root root 2002441 Feb 4 01:06 xtcltk8.0.5-CYGWIN_NT-4.0-20010405-1.tar.gz*

b9e35f4d9f13404dc40384d2cdec0b85 xtcltk8.0.5-CYGWIN_NT-4.0-20010405-1.tar.gz

I have both the 8.0.2 and 8.3.4 libraries installed, but the headers
are those from 8.0.2.

I'll try again with 8.3.4.

Done that; NVIZ still works.

-r-xr-xr-x 1 root root 749892 Mar 28 2002 libtcl8.3.a*
-r-xr-xr-x 1 root root 985818 Mar 28 2002 libtk8.3.a*

fb69cc3342aa19f3fdb709738f6055e7 libtcl8.3.a
4e60b25c070637250f52aa13d5fcdc47 libtk8.3.a

From:

2983750b94c52b8a5ce1aa3e39e54e45 xtcltk-8.3.4-CYGWIN.tar.gz

Upon giving the above command, an empty (black) Windows command-line
window appeared; the title bar contained the name of the NVWISH2.2
program. The message
---Type <return> to continue, or q <return> to quit---
then appeared in the terminal where NVIZ was started and on pressing
return, the segmentation fault happened.

What do the two question marks and empty brackets mean? Do the provided
xtcltk libaries have debugging information? Does anything else need to be
compiled with debugging turned on?

The xtcltk 8.3.4 libraries don't have debug info, but they weren't
compiled with -fomit-frame-pointer, so you should still get a
backtrace, and functions which are from the NVIZ source code can be
debugged.

Although, if I run NVWISH2.2 under gdb, I get a segfault in libXext,
but not if I run it directly (with identical arguments).

FWIW, the relevant Cygwin components are:

XFree86-bin-4.2.0-3.tar.bz2
XFree86-xserv-4.2.0-37.tar.bz2
binutils-20030307-1.tar.bz2
cygwin-1.3.22-1.tar.bz2
gcc-2.95.3-5.tar.bz2
gdb-20030303-1.tar.bz2
opengl-1.1.0-6.tar.bz2
sunrpc-4.0-1.tar.bz2
zlib-1.1.4-1.tar.bz2

I have been compiling with gcc 3.3.1. Might that be the root of my
problems?

--
Richard Greenwood
www.greenwoodmap.com

Glynn Clements wrote:

Richard Greenwood wrote:

I have been compiling with gcc 3.3.1. Might that be the root of my problems?

Quite possibly; particularly if the libraries were built with 2.9x
(certainly, the xtcltk-8.3.4 package was built with 2.95).

Simply reverting to gcc 2.95 has not got NVIZ working for me yet, however I can see some other significant version differences between my Cygwin packages and yours. Thanks for your previous post in which you listed your relevant packages and version numbers - it has given me some more likely avenues to pursue.

--
Richard Greenwood
www.greenwoodmap.com

Richard Greenwood wrote:

>>I have been compiling with gcc 3.3.1. Might that be the root of my
>>problems?
>
>
> Quite possibly; particularly if the libraries were built with 2.9x
> (certainly, the xtcltk-8.3.4 package was built with 2.95).

Simply reverting to gcc 2.95 has not got NVIZ working for me yet,
however I can see some other significant version differences between my
Cygwin packages and yours. Thanks for your previous post in which you
listed your relevant packages and version numbers - it has given me some
more likely avenues to pursue.

I suppose that I should also mention:

1. This was on Win98. Cygwin's reliability can vary substantially
depending upon the Windows variant, although NT/2K/XP should be more
stable than 95/98/ME.

2. I added -D__W98__ to CFLAGS to have mon.start use spawn() instead
of exec(), i.e.

  CFLAGS='-g -D__W98__' ./configure ...

--
Glynn Clements <glynn.clements@virgin.net>