POV-Ray : Newsgroups : povray.bugreports : Some known bugs making povray to crash : Re: Some known bugs making povray to crash Server Time
28 Sep 2024 11:08:50 EDT (-0400)
  Re: Some known bugs making povray to crash  
From: Ron Parker
Date: 16 Dec 1998 14:16:37
Message: <36780715.0@news.povray.org>
On 16 Dec 1998 11:52:37 -0500, Nieminen Mika <war### [at] assaricctutfi> wrote:
>  - The documentation says that you can make at most 10 nested #includes
>    (ie. include files which include files which include files and so on).
>    This is acceptable. What is not acceptable is that when you exceed the
>    limit, povray crashes (or at least the dos version does). It should
>    output an error message like "maximum number of nested include files
>    reached" instead and exit normally.

A fix for this has been posted to this group previously.  The problem isn't
that POV doesn't detect the problem, it's that the detection code has a tiny
bug.  Also, if the documentation says 10 then I believe it's incorrect.  
IIRC, the size of the stack is much bigger in 3.1 than in 3.0.

>  - There seems to be also a maximum number of recursive macro calls you can
>    make. Also ok, but again povray crashes when it's reached. It should
>    issue an error message like "maximum macro recursion limit reached"
>    instead.

I believe macros and includes share the same stack, so these two bugs are
actually the same bug.

>    Also a bigger stack is a must. Say, something like 128k instead of the
>    default 8k which watcom makes.

It's worth mentioning that Win32 programs, at least, have dynamic stacks.
POV-Ray for Windows v3.1 reserves 128 pages (512K) for the stack, and commits 
16 pages (64K) at startup.  This means that for a stack fault to occur, the
stack must grow beyond 512K, though it may also be possible to page-fault if 
the stack has grown beyond the initial commit and the stack pointer is 
artificially decremented by 4K or more and then used without accessing the 
intervening page. This could be caused by some common function prologs if 
the functions use too many local (stack) variables.

For what it's worth, I rendered the attached scene on a PII/333 with 128M of
RAM running Windows 98 and the official POVWin 3.1a without a crash (though 
I stopped it after 5 minutes of rendering a single pixel.)  A version with 
max_trace_level 50 and no reflection rendered to completion with no problems, 
as did a version with concentric nonreflecting spheres, and even concentric 
spheres of differing IOR.  All went to the maximum trace level at least once.  
This problem isn't as cut-and-dried as it may appear.

-------- begin scene -------
/* max_trace_level torture test */
light_source {<0, -20, 20> color rgb 1}
camera {location <0,0,-20> look_at <0,0,0>}
global_settings {max_trace_level 100}

#declare i=0;
#while ( i < 100 )
  #declare i=i+1;
  sphere { .1*i*z, .02 
      texture {pigment {color rgbf .99} finish {reflection .9}}}
#end
-------- end scene ---------


Post a reply to this message

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