POV-Ray : Newsgroups : povray.programming : More POV-Ray crashes on Alpha Server Time
29 Jul 2024 08:10:22 EDT (-0400)
  More POV-Ray crashes on Alpha (Message 1 to 5 of 5)  
From: Mark Arrasmith
Subject: More POV-Ray crashes on Alpha
Date: 5 Aug 1998 17:44:24
Message: <35c8c428.0@news.povray.org>
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))

I'm guessing that maxdv for some reason on Alpha hardware has become zero.
Now the scene does have a pause on an x86 box when it hits the crash spot,
but it will continue with the scan.  I don't have a good debugger on an x86
system right now, so I can't compare how maxdv is being handled differently
on an x86 box.

Anybody have an idea?  What would be the best way to force this scan to
continue on an Alpha?

Mark Arrasmith
arr### [at] mathtwsuedu


Post a reply to this message

From: Ron Parker
Subject: Re: More POV-Ray crashes on Alpha
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

From: Mark Arrasmith
Subject: Re: More POV-Ray crashes on Alpha
Date: 6 Aug 1998 14:24:33
Message: <35c9e6d1.0@news.povray.org>
>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))
>


Shouldn't that be (dx_zero)?  Anyway with

if ((dx_zero) && (k1 < k2 - EPSILON / maxdv) && (k1>0.0))

and

if ((dx_zero) && (k1 < k2 + EPSILON / maxdv) && (k1 > 0.0))

POV-Ray runs just fine!  WooHoo!  Ron Parker RULES!

Thanks,
mark


Post a reply to this message

From: Mark Arrasmith
Subject: Re: More POV-Ray crashes on Alpha
Date: 6 Aug 1998 18:25:22
Message: <35ca1f41.0@news.povray.org>
AHHH!!!  Where did my mountains go?
I tested this new compile on some old scenes and all of my mountains in the
scene went away (using height field with a fractal *.pot file).  Anyway I
have now tried four forms for the if statement . . .

(!dx_zero)
    this still crashed

(dx_zero)
    this lost the mountains but didn't crash

(dx_zero != 0)
    this lost the mountains but didn't crash

(maxdv != 0)
    mountains are back and it didn't crash

So, I'm going to stick with (maxdv != 0).  With the lines now looking like .
. .
if ((maxdv != 0) && (k1 < k2 - EPSILON / maxdv) && (k1>0.0))
and
if ((maxdv != 0) && (k1 < k2 + EPSILON / maxdv) && (k1 > 0.0))

I really need to look at how dx_zero is implimented.  This just seems odd.

mark arrasmith


Post a reply to this message

From: Ronald L  Parker
Subject: Re: More POV-Ray crashes on Alpha
Date: 6 Aug 1998 22:28:51
Message: <35ca55e7.266421017@news.povray.org>
On Thu, 6 Aug 1998 12:24:37 -0500, "Mark Arrasmith"
<arr### [at] mathtwsuedu> wrote:

>Shouldn't that be (dx_zero)?  Anyway with
>
>if ((dx_zero) && (k1 < k2 - EPSILON / maxdv) && (k1>0.0))

Um.... I don't think so.... You're now saying that you _only_ want to
do those things when dx is zero...  If the problem was exactly as I
stated, you should not only still be crashing, you should be getting
strange results everywhere else as well.  

You're saying that if dx is zero (and thus, when dz is negative, so is
maxdv) you want to divide by maxdv.  That's just not right.  

HOWEVER---

I failed to account for the fact that maxdv can be zero when dz is
zero and dx is negative as well.  Your scene probably tickles dz in
the wrong way instead of dx, and your change has made it not try to
divide in the cases when dz is zero (since dx=dz=0 makes it stop long
before it gets here.)

So what line 2209 should say is:

if (dz_zero || ((!dx_sero) && (k1<k2 - EPSILON / maxdv) && (k1>0.0)))

2220 should still be as I stated in the original post.


Post a reply to this message

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