[GRASS-dev] still togl problems in NVIZ for volume

Hi,

NVIZ volume is still crashing, apparently this was
introduced with the TOGL update or a related change
(since it worked earlier):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182934096192 (LWP 10174)]
0x0000002a9559c3c7 in gvl_read_char (pos=59, data=0x0) at gvl_calc.c:603
603 return data[pos];
(gdb) bt full
#0 0x0000002a9559c3c7 in gvl_read_char (pos=59, data=0x0) at gvl_calc.c:603
No locals.
#1 0x0000002a9559dbe9 in gvld_isosurf (gvl=0x62ac90) at gvld.c:248
        tx = 0.00224719103
        ty = 0.00224719103
        tz = 0.0224719103
        cols = 890
        rows = 510
        depths = 6
        x = 59
        y = 0
        z = 0
        i = 1
        iv = 42
        xc = 29500
        yc = 254500
        zc = 0
        xres = 500
        yres = 500
        zres = 500
        j = -1788023744
        p = 0
        num = 17760
        c_ndx = 0
        crnt_ev = -1788023744
        n = {0, 0, -1.05018851e-20}
        pt = {-4.78461888e-26, 5.88545355e-44, 1.66341751e-38, 0}
        n_i = 1
        check_color = (int *) 0xb696b0
        check_transp = (int *) 0xb679f0
        check_material = (int *) 0xb4f6d0
        check_emis = (int *) 0x9af9e0
        check_shin = (int *) 0x9adc70
        kem = (float *) 0xb57370
        ksh = (float *) 0xb67c80
        pkem = 1
        pksh = 1
        ktrans = (unsigned int *) 0xb62360
        curcolor = (unsigned int *) 0xb1b400
        pktransp = 0
        pos = (int *) 0xb4c160
        nz = (int *) 0x5b66a0
        e_dl = (int *) 0xb69b30
        tmp_pos = 42
        edge_pos = {-994655516, -994655500, -994655412, -994655428, 0, 0, 536870912, 1082638125,
  536870912, 1082638125, -445205505, 59}
        modelMatrix = {0.0014787534018978477, -0.00034826830960810184, 0.0016558578936383128, 0,
  0.0016920862253755331, 0.00030435970984399319, -0.0014470925088971853, 0, 0, 0.021990776062011719,
  0.0046252096071839333, 0, -544.1253662109375, 14.187896728515625, -2496.742919921875, 1}
        projMatrix = {3.794135570526123, 0, 0, 0, 0, 2.7474775314331055, 0, 0, 0, 0,
  -1.0020020008087158, -1, 0, 0, -20.02001953125, 0}
        viewport = {0, 0, 400, 552}
        window = {1567, -1015, -1015, 1415}
        isosurf = (geovol_isosurf *) 0xb52150
#2 0x0000002a9559d143 in gvld_vol (gvl=0x62ac90) at gvld.c:38
No locals.
#3 0x0000002a95594c90 in GVL_draw_vol (vid=81721) at GVL2.c:287
        gvl = (geovol *) 0x62ac90
#4 0x00000000004246c1 in vol_draw_all_cmd (data=0x534aa0, interp=0x53e3a0, argc=1, argv=0x7fbfffe880)
    at togl_flythrough.c:761
        i = 0
        nvols = 1
        vol_list = (int *) 0x5ef840
#5 0x00000000004248cc in Ndraw_all_together_cmd (data=0x534aa0, interp=0x53e3a0, argc=1,
    argv=0x7fbfffe880) at togl_flythrough.c:807
        buf_surf = 0x595a80 "1"
        buf_vect = 0x595a80 "1"
        buf_site = 0x595a80 "1"
        buf_vol = 0x595a80 "1"
        buf_north_arrow = 0x54c750 "0"
        arrow_x = 0xab31f0 "999"
        buf_label = 0x54c750 "0"
        buf_legend = 0x54c750 "0"
        buf_fringe = 0x54c750 "0"
        buf_is_drawing = 0x5ef840 "9?\001"
#6 0x0000002a96c1bc5b in TclInvokeStringCommand () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#7 0x0000002a96c1d4c2 in TclEvalObjvInternal () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#8 0x0000002a96c1ea5d in Tcl_EvalEx () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#9 0x0000002a96c1ee05 in Tcl_Eval () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#10 0x000000000042128e in display_cb (togl=0x6dfb00) at togl_cb.c:73
No locals.
#11 0x000000000041d8ab in Togl_Render (clientData=0x6dfb00) at togl.c:1163
        togl = (Togl *) 0x6dfb00
#12 0x0000002a96c73e2b in TclServiceIdle () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#13 0x0000002a96c65182 in Tcl_DoOneEvent () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#14 0x000000381c43b138 in Tk_MainLoop () from /usr/lib64/libtk8.4.so
No symbol table info available.
#15 0x000000381c4463c4 in Tk_MainEx () from /usr/lib64/libtk8.4.so
No symbol table info available.
#16 0x000000000041d155 in main (argc=4, argv=0x7fbffff068) at nvizMain.c:50
        i = 0

I used the Slovakia3d dataset and launched it as
nviz el=dem500 vol=precip3d.500z50

The error appears randomly, sometimes at startup,
or when I add a new isosurface or the second or...

Any ideas?

Markus

I'm using NVIZ in GRASS 6.3, built by William Kyngesbury on 18 August. I'm
running it on an iMac G5 with Gb RAM and a 2.1 GHz PPC processor (i.e., a
newish, but not supercharged system).

I'm currently displaying a volume with 44+ million voxels. It gets real slow
when I drop the polygon resolution below 8 or so. But otherwise seems to be
fine. Changing lighting is also slow, even when the display is not slow
otherwise.

Of course it could still crash in the next few minutes....

Michael

__________________________________________
Michael Barton, Professor of Anthropology
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

From: Markus Neteler <neteler@itc.it>
Date: Tue, 22 Aug 2006 14:46:52 +0200
To: GRASS developers list <grass-dev@grass.itc.it>
Subject: [GRASS-dev] still togl problems in NVIZ for volume

Hi,

NVIZ volume is still crashing, apparently this was
introduced with the TOGL update or a related change
(since it worked earlier):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182934096192 (LWP 10174)]
0x0000002a9559c3c7 in gvl_read_char (pos=59, data=0x0) at gvl_calc.c:603
603 return data[pos];
(gdb) bt full
#0 0x0000002a9559c3c7 in gvl_read_char (pos=59, data=0x0) at gvl_calc.c:603
No locals.
#1 0x0000002a9559dbe9 in gvld_isosurf (gvl=0x62ac90) at gvld.c:248
        tx = 0.00224719103
        ty = 0.00224719103
        tz = 0.0224719103
        cols = 890
        rows = 510
        depths = 6
        x = 59
        y = 0
        z = 0
        i = 1
        iv = 42
        xc = 29500
        yc = 254500
        zc = 0
        xres = 500
        yres = 500
        zres = 500
        j = -1788023744
        p = 0
        num = 17760
        c_ndx = 0
        crnt_ev = -1788023744
        n = {0, 0, -1.05018851e-20}
        pt = {-4.78461888e-26, 5.88545355e-44, 1.66341751e-38, 0}
        n_i = 1
        check_color = (int *) 0xb696b0
        check_transp = (int *) 0xb679f0
        check_material = (int *) 0xb4f6d0
        check_emis = (int *) 0x9af9e0
        check_shin = (int *) 0x9adc70
        kem = (float *) 0xb57370
        ksh = (float *) 0xb67c80
        pkem = 1
        pksh = 1
        ktrans = (unsigned int *) 0xb62360
        curcolor = (unsigned int *) 0xb1b400
        pktransp = 0
        pos = (int *) 0xb4c160
        nz = (int *) 0x5b66a0
        e_dl = (int *) 0xb69b30
        tmp_pos = 42
        edge_pos = {-994655516, -994655500, -994655412, -994655428, 0, 0,
536870912, 1082638125,
  536870912, 1082638125, -445205505, 59}
        modelMatrix = {0.0014787534018978477, -0.00034826830960810184,
0.0016558578936383128, 0,
  0.0016920862253755331, 0.00030435970984399319, -0.0014470925088971853, 0, 0,
0.021990776062011719,
  0.0046252096071839333, 0, -544.1253662109375, 14.187896728515625,
-2496.742919921875, 1}
        projMatrix = {3.794135570526123, 0, 0, 0, 0, 2.7474775314331055, 0, 0,
0, 0,
  -1.0020020008087158, -1, 0, 0, -20.02001953125, 0}
        viewport = {0, 0, 400, 552}
        window = {1567, -1015, -1015, 1415}
        isosurf = (geovol_isosurf *) 0xb52150
#2 0x0000002a9559d143 in gvld_vol (gvl=0x62ac90) at gvld.c:38
No locals.
#3 0x0000002a95594c90 in GVL_draw_vol (vid=81721) at GVL2.c:287
        gvl = (geovol *) 0x62ac90
#4 0x00000000004246c1 in vol_draw_all_cmd (data=0x534aa0, interp=0x53e3a0,
argc=1, argv=0x7fbfffe880)
    at togl_flythrough.c:761
        i = 0
        nvols = 1
        vol_list = (int *) 0x5ef840
#5 0x00000000004248cc in Ndraw_all_together_cmd (data=0x534aa0,
interp=0x53e3a0, argc=1,
    argv=0x7fbfffe880) at togl_flythrough.c:807
        buf_surf = 0x595a80 "1"
        buf_vect = 0x595a80 "1"
        buf_site = 0x595a80 "1"
        buf_vol = 0x595a80 "1"
        buf_north_arrow = 0x54c750 "0"
        arrow_x = 0xab31f0 "999"
        buf_label = 0x54c750 "0"
        buf_legend = 0x54c750 "0"
        buf_fringe = 0x54c750 "0"
        buf_is_drawing = 0x5ef840 "9?\001"
#6 0x0000002a96c1bc5b in TclInvokeStringCommand () from
/usr/lib64/libtcl8.4.so
No symbol table info available.
#7 0x0000002a96c1d4c2 in TclEvalObjvInternal () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#8 0x0000002a96c1ea5d in Tcl_EvalEx () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#9 0x0000002a96c1ee05 in Tcl_Eval () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#10 0x000000000042128e in display_cb (togl=0x6dfb00) at togl_cb.c:73
No locals.
#11 0x000000000041d8ab in Togl_Render (clientData=0x6dfb00) at togl.c:1163
        togl = (Togl *) 0x6dfb00
#12 0x0000002a96c73e2b in TclServiceIdle () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#13 0x0000002a96c65182 in Tcl_DoOneEvent () from /usr/lib64/libtcl8.4.so
No symbol table info available.
#14 0x000000381c43b138 in Tk_MainLoop () from /usr/lib64/libtk8.4.so
No symbol table info available.
#15 0x000000381c4463c4 in Tk_MainEx () from /usr/lib64/libtk8.4.so
No symbol table info available.
#16 0x000000000041d155 in main (argc=4, argv=0x7fbffff068) at nvizMain.c:50
        i = 0

I used the Slovakia3d dataset and launched it as
nviz el=dem500 vol=precip3d.500z50

The error appears randomly, sometimes at startup,
or when I add a new isosurface or the second or...

Any ideas?

Markus

And, this OSX NVIZ is running thru X11, and uses TclTk 8.4.13.

On Aug 22, 2006, at 12:16 PM, Michael Barton wrote:

I'm using NVIZ in GRASS 6.3, built by William Kyngesbury on 18 August. I'm
running it on an iMac G5 with Gb RAM and a 2.1 GHz PPC processor (i.e., a
newish, but not supercharged system).

I'm currently displaying a volume with 44+ million voxels. It gets real slow
when I drop the polygon resolution below 8 or so. But otherwise seems to be
fine. Changing lighting is also slow, even when the display is not slow
otherwise.

Of course it could still crash in the next few minutes....

Michael

-----
William Kyngesburye <kyngchaos@kyngchaos.com>
http://www.kyngchaos.com/

"I ache, therefore I am. Or in my case - I am, therefore I ache."

- Marvin

With tcltk <= 8.4.11 it crashes :frowning: Tested on RHEL4 and
Mandriva2006.

Markus

On Tue, Aug 22, 2006 at 01:07:43PM -0500, William Kyngesburye wrote:

And, this OSX NVIZ is running thru X11, and uses TclTk 8.4.13.

On Aug 22, 2006, at 12:16 PM, Michael Barton wrote:

>I'm using NVIZ in GRASS 6.3, built by William Kyngesbury on 18
>August. I'm
>running it on an iMac G5 with Gb RAM and a 2.1 GHz PPC processor
>(i.e., a
>newish, but not supercharged system).
>
>I'm currently displaying a volume with 44+ million voxels. It gets
>real slow
>when I drop the polygon resolution below 8 or so. But otherwise
>seems to be
>fine. Changing lighting is also slow, even when the display is not
>slow
>otherwise.
>
>Of course it could still crash in the next few minutes....
>
>Michael
>

-----
William Kyngesburye <kyngchaos@kyngchaos.com>
http://www.kyngchaos.com/

"I ache, therefore I am. Or in my case - I am, therefore I ache."

- Marvin

On Tue, Aug 22, 2006 at 09:56:10PM +0200, Markus Neteler wrote:

With tcltk <= 8.4.11 it crashes :frowning: Tested on RHEL4 and
Mandriva2006.

On Mandriva2006 it crashes like this:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1238534432 (LWP 24083)]
0xb7fa09d7 in gvl_read_char (pos=0, data=0x0) at gvl_calc.c:602
602 {
(gdb) bt full
#0 0xb7fa09d7 in gvl_read_char (pos=0, data=0x0) at gvl_calc.c:602
No locals.
#1 0xb7fa1a17 in gvld_isosurf (gvl=0x8158d78) at gvld.c:248
        tx = 0.00224719103
        ty = 0.00224719103
        tz = 0.0224719103
        cols = 593
        rows = 340
        depths = 4
        x = 0
        y = 0
        z = 0
        i = Variable "i" is not available.
(gdb)

Markus

Markus Neteler wrote:

> With tcltk <= 8.4.11 it crashes :frowning: Tested on RHEL4 and
> Mandriva2006.

On Mandriva2006 it crashes like this:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1238534432 (LWP 24083)]
0xb7fa09d7 in gvl_read_char (pos=0, data=0x0) at gvl_calc.c:602
602 {
(gdb) bt full
#0 0xb7fa09d7 in gvl_read_char (pos=0, data=0x0) at gvl_calc.c:602
No locals.
#1 0xb7fa1a17 in gvld_isosurf (gvl=0x8158d78) at gvld.c:248
        tx = 0.00224719103
        ty = 0.00224719103
        tz = 0.0224719103
        cols = 593
        rows = 340
        depths = 4
        x = 0
        y = 0
        z = 0
        i = Variable "i" is not available.

Both of these reports have a NULL data field in the geovol_isosurf
structure. This field is NULL when the structure is initially created,
and initialised by gvl_isosurf_calc() (gvl_calc.c:542).

gvld_vol() calls gvl_isosurf_calc() before calling gvld_isosurf(), so
it appears that gvl_isosurf_calc() is failing to initialise the field
for some reason.

I can only suggest single-stepping through gvl_isosurf_calc() to try
to figure out why the field doesn't get set.

So far as trying to comprehend that code is concerned, fixing the
formatting would probably help, as would fixing the macros at the top
of that file so that they don't refer to local variables.

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

Markus wrote:

With tcltk <= 8.4.11 it crashes :frowning: Tested on RHEL4 and Mandriva2006.

latest 6.3-cvs on Debian/sarge with tcltk 8.4 [threaded] it crashes when
I try to [Add] a new isosurface. First time I tried it happened when
adding the 3rd isosurface, second time it segfaulted on the first surface.

I found this earlier:

=========================

from https://intevation.de/rt/webrt?serial_num=4725

Wed, Jun 28 2006 12:13:10 Mail sent by hbowman

Hi,

"nviz volume=map3d" segfaults.. see bug report for spearfish example.

I've traced it back to incorrect mode in nviz/src/volume.c
slice_get_drawmode()

mode=1969841253 (or so)
when it should be like DM_GOURAUD=256 or DM_FLAT=512

actual segfault seems to happen after slice_get_drawmode()'s
return (TCL_ERROR);
???

called from scripts/panel_vol.tcl line ~450:
    set Nv_(ShadeStyle) [Nvol$curr slice get_drawmode]

I followed "mode" into lib/ogsf/GVL2.c GVL_slice_get_drawmode()
and then *gvl to gvl_get_vol() in lib/ogsf/gvl.c, but then I get lost.

uninit'd variable?

Hamish

Markus Neteler wrote:

> > With tcltk <= 8.4.11 it crashes :frowning: Tested on RHEL4 and
> > Mandriva2006.
>
> On Mandriva2006 it crashes like this:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1238534432 (LWP 24083)]
> 0xb7fa09d7 in gvl_read_char (pos=0, data=0x0) at gvl_calc.c:602
> 602 {
> (gdb) bt full
> #0 0xb7fa09d7 in gvl_read_char (pos=0, data=0x0) at gvl_calc.c:602
> No locals.
> #1 0xb7fa1a17 in gvld_isosurf (gvl=0x8158d78) at gvld.c:248
> tx = 0.00224719103
> ty = 0.00224719103
> tz = 0.0224719103
> cols = 593
> rows = 340
> depths = 4
> x = 0
> y = 0
> z = 0
> i = Variable "i" is not available.

Both of these reports have a NULL data field in the geovol_isosurf
structure. This field is NULL when the structure is initially created,
and initialised by gvl_isosurf_calc() (gvl_calc.c:542).

gvld_vol() calls gvl_isosurf_calc() before calling gvld_isosurf(), so
it appears that gvl_isosurf_calc() is failing to initialise the field
for some reason.

I can only suggest single-stepping through gvl_isosurf_calc() to try
to figure out why the field doesn't get set.

So far as trying to comprehend that code is concerned, fixing the
formatting would probably help, as would fixing the macros at the top
of that file so that they don't refer to local variables.

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

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