POV-Ray : Newsgroups : povray.advanced-users : Divide by Zero Error ? : Re: Divide by Zero Error ? Server Time
28 Jun 2024 02:22:45 EDT (-0400)
  Re: Divide by Zero Error ?  
From: Thorsten Froehlich
Date: 9 Aug 1999 15:40:42
Message: <37af2eba@news.povray.org>
In article <37aed849@news.povray.org> , par### [at] fwicom (Ron Parker) wrote:

>>> The crash is not a divide by zero error.  I'm not sure what it is, but
>>> it might be a stack fault.  It crashes somewhere deep within the
>>> Visual C++ runtime library for me, in the process of doing a malloc
>>> under a pile of calls to sort_and_split.  In short, I have no idea
>>> what you did here. :)
>>
>>Do you think it's a bug and maybe someone should report it ? You could
>>probably word it in programmerese better than I if you feel it is worth
>>bringing to the teams attention.
>
> Yes, it's a bug.  Anything that crashes is a bug in my book, whether or
> not it's due to bad code.  I've copied in the faulty code below, for the
> sake of the bug hunters. (The loop on Y wasn't necessary to duplicate
> the crash, so I've elided it.)
>
> It may be worth noting that internally POV sets the result of a division by
> zero to HUGE_VAL, which is 1e17 by default.  It's likely that some code
> somewhere in the creation and subdivision of bounding slabs has trouble with
> this huge number, which is something like 2^60.  I don't understand
> sort_and_split all that well, I'm afraid.

I suspect it to be a Windows compiler (or memory allocation library) bug. I
tried the scene up to 450 * 450 spheres without any problems, instabilities
or crashes on my Mac.
With a different Mac compiler we got other bugs like this one (not this
specific one!) deep inside memory allocation code or during complex
operations. Also we did extensive seaching we never found the causes and
maybe the size of POV-Ray just shows lots of the little bugs compilers have
to-date :-(


    Thorsten


____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org





____________________________________________________

Creating bounding slabs.
Scene contains 202500 frame level objects; 0 infinite.

Creating vista buffer.
Creating light buffers.
Displaying...
Rendering...

Done Tracing
untitled.pov Statistics, Resolution 100 x 100
----------------------------------------------------------------------------
Pixels:           10000   Samples:           10000   Smpls/Pxl: 1.00
Rays:             10000   Saved:                 0   Max Level: 1/5
----------------------------------------------------------------------------
Ray->Shape Intersection          Tests       Succeeded  Percentage
----------------------------------------------------------------------------
Sphere                             332             178     53.61
Bounding Box                      3505             333      9.50
Light Buffer                      3539            1053     29.75
Vista Buffer                     43551           24318     55.84
----------------------------------------------------------------------------
Calls to Noise:                  0   Calls to DNoise:             10
----------------------------------------------------------------------------
Shadow Ray Tests:              117   Succeeded:                    0
----------------------------------------------------------------------------
Smallest Alloc:                 26 bytes   Largest:          1620024
Peak memory used:        140421828 bytes
----------------------------------------------------------------------------
Time For Parse:    0 hours  3 minutes  22.0 seconds (202 seconds)
Time For Trace:    0 hours  0 minutes   1.0 seconds (1 seconds)
    Total Time:    0 hours  3 minutes  23.0 seconds (203 seconds)
-- [AnimFrame] file#:'untitled.pict' frame#:0 clock:0
Reclaiming memory
-- [Stack] Total Stack space used = 8320 bytes
-- [Finish]  File=untitled.pov,  Time=09.08.1999  21:29:57 Uhr
----------------------------------------------------------------------------
POV-Ray Mac Memory Cache Statistics
Cache hits:                2513256   Cache misses:              8581
Total calls to malloc:     2521837   Cache hit rate:             99%
---------------------------------------------------------------------------


Post a reply to this message

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