POV-Ray : Newsgroups : povray.programming : More POV-Ray crashes on Alpha : Re: More POV-Ray crashes on Alpha Server Time
29 Jul 2024 06:14:15 EDT (-0400)
  Re: More POV-Ray crashes on Alpha  
From: Ron Parker
Date: 5 Aug 1998 18:33:15
Message: <35c8cf9b.0@news.povray.org>
On Wed, 5 Aug 1998 15:44:27 -0500, Mark Arrasmith 
        <arr### [at] mathtwsuedu> 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

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