|
![](/i/fill.gif) |
On Wed, 5 Aug 1998 15:44:27 -0500, Mark Arrasmith
<arr### [at] math twsu edu> wrote:
>I have an scene that always crashes POV-Ray 3.01 and 3.02 on AlphaNT,
>Alpha/Linux, and Digital Unix. It is only 4KB (two files) and is at
>ftp://arrow.math.twsu.edu/pub/crash
>
>This scene runs just fine on an x86 box and SGI R10000 IRIX64 6.2 IP28.
>The crash appears when you hit an object perpendicular to the scan line. I
>compiled pov-win 3.01 for AlphaNT using VC++ to get debug info and I get a
>division by zero at line 2209 of HField.c.
>
>2209>> if((k1<k2 - EPSILON / maxdv) && (k1>0.0))
maxdv is set to the max of dx or dz near the beginning of that function:
maxdv = (dx > dz) ? dx : dz;
Clearly, if dx and dz are both zero, maxdv is zero as well, but this instance
is handled by a special case first thing. The problem occurs when dz is
negative and dx is zero. When dx is zero, the variable dx_zero gets set
to true, causing k1 to be explicitly set to BOUND_HUGE, which means it
should fail both of the tests that divide by maxdv.
So if you rewrite line 2209 to
if ((!dx_zero) && (k1 < k2 - EPSILON / maxdv) && (k1>0.0))
and line 2220 to
if ((!dx_zero) && (k1 < k2 + EPSILON / maxdv) && (k1 > 0.0))
it should fix your problem.
Why doesn't this fault on Intel processors? Who knows. It's probably a
compiler thing.
Post a reply to this message
|
![](/i/fill.gif) |