POV-Ray : Newsgroups : povray.beta-test : Spline causing 3.8 beta 2 to crash : Re: Spline causing 3.8 beta 2 to crash Server Time
24 Apr 2024 06:04:18 EDT (-0400)
  Re: Spline causing 3.8 beta 2 to crash  
From: Chris R
Date: 8 Feb 2023 09:55:00
Message: <web.63e3b7a9dd6df1a937a9ec105cc1b6e@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> I have been experiencing crashes running the latest beta of POV-Ray v3.8 (Win64)
> when trying to call a spline.  The narrowed it down to a few lines of code that
> causes the crash:
>
> #macro make_spline()
>     #local _s   = spline {
>         quadratic_spline
>         0, <0, 0, 0>,
>         1, <0, 0, 1>,
>         2, <1, 0, 2>,
>         3, <2, 1, 3>
>     }
>     _s
> #end
>
> #local myspline = spline { make_spline() }
>
> #debug concat("_pt=<", vstr(3, myspline(0), ",", 0, 3), ">\n")
>
> The contents of the spline don't seem to matter nor does the type of spline.
> The result is a memory access violation.
>
> When I run the same code on v3.7 it works fine.
>
> Declaring the spline outside of a macro does not cause the crash:
>
> #local myspline   = spline {
>     natural_spline
>     0, <0, 0, 0>,
>     1, <0, 0, 1>,
>     2, <1, 0, 2>,
>     3, <2, 1, 3>
> }
>
> #debug concat("_pt=<", vstr(3, myspline(0), ",", 0, 3), ">\n")
>
> -- Chris R.

One last observation, the following code also seems to work fine.  This leads me
to believe the problem lies with returning the spline identifier from the macro
and then trying to use it.  It's a kludgy work-around, but I can use it to
continue on my current project.

#macro make_spline_macro()
#declare myspline = spline {
   natural_spline
   0, <0, 0, 0>,
   1, <0, 0, 1>,
   2, <1, 0, 2>,
   3, <2, 1, 3>
}
#end

make_spline_macro()

#debug concat("_pt=<", vstr(3, myspline(0), ",", 0, 3), ">\n")


-- Chris R.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.