POV-Ray : Newsgroups : povray.beta-test : crash with "recursion" in functions Server Time
1 Nov 2024 21:21:34 EDT (-0400)
  crash with "recursion" in functions (Message 1 to 6 of 6)  
From:
Subject: crash with "recursion" in functions
Date: 4 Mar 2002 05:48:40
Message: <uoj68uk5m391emvphovqfbg5vl0en7h2q6@4ax.com>
POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB

Following script causes crash in POV-Ray 3.5 b 11.

Two notes:
1) When I remove "u0,v0," from parameters and calls (becouse it's not used at
all in posted example) then this not crash.
2) When I replace "Pattern(u1,v1,0)" with "u1+v1" in Sub[0] assigment then
this not crash.

Could it be becouse all entries of array of functions have to have the same
number of parameters ?

Any confirmation ?

// START
#local Level=6;
#local Dist=1/(2^Level-1);
#local Pattern=function{pattern{agate}}
#local Sub=array[Level];
#local Sub[0]=function(u0,v0,u1,v1){Pattern(u1,v1,0)};
#local Sub[1]=function(u0,v0,u1,v1,u2,v2){
  min(
    Sub[0](u0,v0,u1,v1),
    Sub[0](u0,v0,u1,v2),
    Sub[0](u0,v0,u2,v1),
    Sub[0](u0,v0,u2,v2)
  )
};
#local C=2;
#while (C<Level)
  #local Sub[C]=function(u0,v0,u1,v1,u2,v2){
    min(
      Sub[C-1](
        u0,v0,
        u1,v1,
        (u1+u2)/2-Dist,(v1+v2)/2-Dist
      ),
      Sub[C-1](
        u0,v0,
        u1,(v1+v2)/2+Dist,
        (u1+u2)/2-Dist,v2
      ),
      Sub[C-1](
        u0,v0,
        (u1+u2)/2+Dist,v1,
        u2,(v1+v2)/2-Dist
      ),
      Sub[C-1](
        u0,v0,
        (u1+u2)/2+Dist,(v1+v2)/2+Dist,
        u2,v2
      )
    )
  };
  #local C=C+1;
#end
#local F=function{Sub[Level-1](x,y,x-1,y-1,x+1,y+1)};
plane{
  z 0
  pigment{function{F(x,y,z)}}
  translate z*4
  finish{ambient 1}
}
// END

ABX


Post a reply to this message

From:
Subject: Re: crash with "recursion" in functions
Date: 5 Mar 2002 03:23:05
Message: <nmu88u42ea9akjithuu0famgo9c5kmre9p@4ax.com>

wrote:
> POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB
>
> Following script causes crash in POV-Ray 3.5 b 11.

It not produce crash it POV-Ray 3.5 b 12 icl on the same machine. But it
doesn't mean it works properly. Now it display dialog window with message "The
POV-Ray core rendering code caused an access violation exception. It is
STRONGLY RECOMMENDED that you save your work and exit the program before
attempting the render again."

Anyway last night I experimented a lot with this source at home with beta 11
and found following:

1) Changing content of Sub[0] caused different results. For example it stopped
rendering displayed with unexpected message for example "wrong Warp type
number 1234" (I recall message from memory) or "Reached maximum number of
recursion in functions". Particularly second message was strange: first
becouse there wasn't such maximum number listed in limits list posted
yesterday, second - becouse message about recursion surprized when recursion
is afaik impossible at this moment.

2) When I removed array usage at all and used combination of Prev/Next
functions then all problems gone so I suppose crash was connected with
refferences in array. Now it works this way:

#local Prev=function(...){...} // previously Sub[0]
#local Next=function(...){...} // previously Sub[1]
#local C=2;
#while (C<Level)
  #local Prev=function(...){Next(...)} // previously Sub[C-1]
  #local Next=function(...){...} // previously Sub[C]
  #local C=C-1;
#end

This is sufficient for me except I'm not sure assigning of Prev not slow down
calculations (is it optimized when Ident1=function{Ident2} ?).

Note: I didn't used #undef to Prev and Next - is this no more necessary ?
Then apriopriate note could be removed from 6.1.6.2.

> Any confirmation ?

I ask again.

ABX


Post a reply to this message

From:
Subject: Re: crash with "recursion" in functions
Date: 6 Mar 2002 02:38:45
Message: <6phb8uk67jihdmdqvb8hj1216p5q8dm3f0@4ax.com>

wrote:

> wrote:
> > Any confirmation ?
>
> I ask again.

I feel alone with my problem :-(

ABX


Post a reply to this message

From: Kevin Ellis
Subject: Re: crash with "recursion" in functions
Date: 6 Mar 2002 14:22:41
Message: <3c866c81@news.povray.org>

news:uoj68uk5m391emvphovqfbg5vl0en7h2q6@4ax.com...
> POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB
>
> Following script causes crash in POV-Ray 3.5 b 11.

This script does produce 'The POV-Ray core rendering code cused an access
violation exception' message. Click ok and I can render any other scene ok.

But, then when I try to re-render the scene again it gives an illegal
operation message and POV has to be shut down.

In the message pane I get 'Rendering error: Maximum function evaluation
recursion level reached'.

Did try note 2. Replacing the Pattern() function with u1+v1, or any constant
or x or y or x+y, works ok, no crash, seems to be realted to the Pattern()
function itself.

Kev


Post a reply to this message

From:
Subject: Re: crash with "recursion" in functions
Date: 11 Mar 2002 08:25:01
Message: <cvbp8usrplaal3kjioa7vi5uqv0dqsgcbi@4ax.com>

wrote:
> POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB
>
> Following script causes crash in POV-Ray 3.5 b 11.

Right, posted source was far from brief report. I posted it in that form to be
sure that I don't miss any of elements of complexity. It still was a shortcut
of real source. Anyway here is further and shorter investigation.

For L=2 and L=3 it works.
For L=4 it reports parse error "Problem in Evaluate_TPat"
For L=5 and greater it reports access violation exception

Any confirmation ?

Here is script (short enogh ?)

#local L=6;
#local Pattern=function{pattern{agate}}
#local S=array[L];
#local S[0]=function(u0,v0,u1,v1){Pattern(u1,v1,0)};
#local S[1]=function(u0,v0,u1,v1){S[0](u0,v0,u1,v1)};
#local C=2;
#while (C<L)
  #local S[C]=function(u0,v0,u1,v1){S[C-1](u0,v0,u1,v1)};
  #local C=C+1;
#end
#local C=S[L-1](0,0,-1,-1);

ABX


Post a reply to this message

From: Jérôme Grimbert
Subject: Re: crash with "recursion" in functions
Date: 11 Mar 2002 08:37:58
Message: <3C8CB33F.21040955@atosorigin.com>

> 

> wrote:
> > POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB
> >
> > Following script causes crash in POV-Ray 3.5 b 11.
> 
> Right, posted source was far from brief report. I posted it in that form to be
> sure that I don't miss any of elements of complexity. It still was a shortcut
> of real source. Anyway here is further and shorter investigation.
> 
> For L=2 and L=3 it works.
> For L=4 it reports parse error "Problem in Evaluate_TPat"
> For L=5 and greater it reports access violation exception
> 
> Any confirmation ?

Confirmed on P-II, W98SE, 128Mo, 400MHz, pov-3.5beta12
L=2: black image
L=3: Fault on page (sorry, W98 is a french one)


Registres :
EAX=009d81e0 CS=015f EIP=0050a069 EFLGS=00010202
EBX=00000008 SS=0167 ESP=01f8fce8 EBP=009d81e0
ECX=00000268 DS=0167 ESI=8173f0ec FS=539f
EDX=009d81c8 ES=0167 EDI=81748a98 GS=0000

8b 45 f0 ff 0d cc 66 5e 00 85 c0 74 06 8b 4d f4 

009ddb40 0050a0a8 00aeb690 00001dc0 01f8ff88 004f99c2 01f8ff88 004e6a68 00ae46b0
009d89ec 01f8ff88 8173f0ec 00000008 004f98a8 009d89ec 004f93a9 

L=4: parse error
L=5: Access violation
L=6: Access violation
L=7: Access violation
L=8: Fault on page


Registres :
EAX=009d81e0 CS=015f EIP=0050a069 EFLGS=00010202
EBX=00000008 SS=0167 ESP=01f8fce8 EBP=009d81e0
ECX=00000268 DS=0167 ESI=81735bfc FS=327f
EDX=009d81c8 ES=0167 EDI=81748bf8 GS=0000

8b 45 f0 ff 0d cc 66 5e 00 85 c0 74 06 8b 4d f4 

009de6c0 0050a0a8 00ae62a0 00001dc0 01f8ff88 004f99c2 01f8ff88 004e6a68 00aebd60
009d89ec 01f8ff88 81735bfc 00000008 004f98a8 009d89ec 004f93a9 


-- 
Non Sine Numine
http://grimbert.cjb.net/


Post a reply to this message

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