OpenGL graphics crash

Michael Goffioul michael.goffioul at gmail.com
Wed Jul 8 16:54:34 CDT 2009


On Wed, Jul 8, 2009 at 9:26 PM, John W. Eaton<jwe at octave.org> wrote:
> The following
>
>  backend ("fltk")
>  demo slice
>
> causes the following segfault on my system:
>
>  slice example 1:
>   [x, y, z] = meshgrid (linspace (-8, 8, 32));
>   v = sin (sqrt (x.^2 + y.^2 + z.^2)) ./ (sqrt (x.^2 + y.^2 + z.^2));
>   slice (x, y, z, v, [], 0, []);
>   [xi, yi] = meshgrid (linspace (-7, 7));
>   zi = xi + yi;
>   slice (x, y, z, v, xi, yi, zi);
>
>  octave:3>
>  Program received signal SIGSEGV, Segmentation fault.
>  [Switching to Thread 0x7f577720c710 (LWP 2009)]
>  0x00007f5776325d7d in convert_cdata (props=@0x168a910, cdata=@0x7fff7f243bd0,
>      is_scaled=true, cdim=3) at /home/jwe/src/octave/src/graphics.cc:447
>  447         av[i]       = cmapv[idx];
>  Current language:  auto; currently c++
>  (gdb) p idx
>  $1 = -2147483648
>  (gdb) list
>  442         else if (x >= nc)
>  443           x = (nc - 1);
>  444
>  445         octave_idx_type idx = static_cast<octave_idx_type> (x);
>  446
>  447         av[i]       = cmapv[idx];
>  448         av[i+lda]   = cmapv[idx+nc];
>  449         av[i+2*lda] = cmapv[idx+2*nc];
>  450       }
>  451
>  (gdb) p x
>  $2 = nan(0x840f440000000)
>
> The NaN value appears because the slice function sets some elements of
> cdata to NA.  I'm unsure of the intent of the convert_cdata function,
> so I'm not sure what values should be computed for elements of cdata
> that are NA or NaN.
>
> jwe
>

The function convert_cdata computes a real RGB version of CDATA
property. If CDATA is already in RGB format, it returns it, otherwise
it maps the CDATA values to the figure colormap according to the
SCALED property.

That being said, I'm also unsure about what should happen when
CDATA contains NA elements and what's the purpose of having
such values in CDATA...

Michael.



More information about the Octave-maintainers mailing list