POV-Ray : Newsgroups : povray.unofficial.patches : [MegaPOV 1.2beta] Bug with macros that alter arguments Server Time
14 May 2024 04:55:35 EDT (-0400)
  [MegaPOV 1.2beta] Bug with macros that alter arguments (Message 1 to 2 of 2)  
From: Tom York
Subject: [MegaPOV 1.2beta] Bug with macros that alter arguments
Date: 7 Jun 2005 07:05:01
Message: <web.42a57da3ace53836e0d101b60@news.povray.org>
This bug was first cleanly identified in the thread "Differences in
rendering 3.50c vs. 3.6.1", which was started in povray.general by Jakob
Hunsballe on November 24th 2004. The problem exists in the official 3.6.1
release of POVRay, and is currently present in MegaPOV as well. In that
thread Mike Williams posted the first minimal scene showing the bug, and
Thorsten Froehlich identified the cause of the bug in the 3.6.1 sources.

The nature of the bug is this: in macros that change the values of variables
passed to them as arguments, the value of the argument is sometimes left
unaltered. It seems that only vector and scalar identifiers are affected.
The result is that in a small number of calls these macros have no
effect upon their arguments. The number of failures depends on the number
and disposition of parser tokens in the scene.

A minimal scene follows:

// BEGINNING of SDL

#macro TestMacro(RefVar)
  #declare RefVar = -10.0;
#end

#declare I = 0;
#declare Nerr = 0;
#while(I<10000)
  #declare TestValue = 10.0;
  TestMacro(TestValue)
  #if(TestValue > 0.0)
    #declare Nerr = Nerr + 1;
  #end

  #declare I = I + 1;
#end

#warning concat("Errors: ", str(Nerr,0,0), "/", str(I,0,0))

// END of SDL

The variable Nerr keeps track of the number of times variable TestValue
was left unchanged by the macro TestMacro. I get 0 errors out of 10000
loops in POVRay 3.5, and 6/10000 in MegaPOV 1.2 beta (and POVRay 3.6.1, of
course).


Post a reply to this message

From: Christoph Hormann
Subject: Re: [MegaPOV 1.2beta] Bug with macros that alter arguments
Date: 7 Jun 2005 09:25:02
Message: <d84750$8ie$1@chho.imagico.de>
Tom York wrote:
> This bug was first cleanly identified in the thread "Differences in
> rendering 3.50c vs. 3.6.1", which was started in povray.general by Jakob
> Hunsballe on November 24th 2004. The problem exists in the official 3.6.1
> release of POVRay, and is currently present in MegaPOV as well. In that
> thread Mike Williams posted the first minimal scene showing the bug, and
> Thorsten Froehlich identified the cause of the bug in the 3.6.1 sources.

There has never been a fix for this applied to the 3.6 sources so it 
would need to be backported.  Not a big deal probably but i can't 
promise this will be possibe till the 1.2 release.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 03 May. 2005 _____./\/^>_*_<^\/\.______


Post a reply to this message

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