POV-Ray : Newsgroups : povray.bugreports : Bug: divide by zero in scene file causes renderer to hang Server Time
29 Oct 2024 22:48:29 EDT (-0400)
  Bug: divide by zero in scene file causes renderer to hang (Message 1 to 3 of 3)  
From: Tom Galvin
Subject: Bug: divide by zero in scene file causes renderer to hang
Date: 21 Oct 1998 22:40:02
Message: <362e8cf2.0@news.povray.org>
FYI,
I feel silly posting this, but I figured that you would want to know. The
code below will send the renderer into never never land.  .  The Stop button
will not work.  You can still use the editor and closing PovRay will halt
the renderer

     rotate <0,0,360/clock>

I am assuming it is caused by a divide by zero that is not handled
correctly.  I fixed my scene but it took a while to figure out.

Thanks
Tom


Post a reply to this message

From: Philippe Debar
Subject: Re: divide by zero in scene file causes renderer to hang
Date: 28 Oct 1998 13:33:16
Message: <3637636c.0@news.povray.org>
Hi!

I found the same problem (or similar), but as it was generated
by a (faulty) while loop, it took some times for me to find it... I
think (but I did not test) that feeding a 'nan' or an 'inf' (as reported
by the #warning stream) to pov jams the parser in the auto-bounding
process. I believe it is the auto-bounding because (1) that is the status
displayed in the status bar when pov jams; (2) it did not happened
when the auto-bounding wasn't needed (number of objects under
the auto-bounding treshold).

I think the generation of such values should be trapped (weren't they in
earlier versions? I can't remenber...). Or they could be trapped when used
in an object (as degenarated shapes are).

Of course this isn't really a bug: we should try to avoid creating such
values. But it would be more confortable if pov handled them better.



Povingly,


Philippe


Post a reply to this message

From: Jerry  Stratton
Subject: Re: divide by zero in scene file causes renderer to hang
Date: 15 Nov 1998 13:18:30
Message: <jerry-1511981018300001@cx38767-a.dt1.sdca.home.com>
In article <3637636c.0@news.povray.org>, "Philippe Debar"
<phi### [at] hotmailcom> wrote:
>I found the same problem (or similar), but as it was generated
>by a (faulty) while loop, it took some times for me to find it... I

This is possibly related. I'd accidentally switched the numerator and
denominator in:

   #while (current_groove < groove_count)
      object { groove
         rotate <0,current_groove*360/groove_count,0>
      }
      #declare current_groove = current_groove + 1;
   #end

so that it read

   #while (current_groove < groove_count)
      object { groove
         rotate <0,groove_count*360/current_groove,0>
      }
      #declare current_groove = current_groove + 1;
   #end

This was part of a difference; and current_groove starts from zero. There
was no error generated by the divide by zero; the difference object simply
didn't appear in the scene. It took me a bit to find the error because I
was looking for an error in size or translation rather than what I would
normally consider a fatal error in my code.

My fault, of course, but I would expect that divide by zero would generate
some sort of message.

Jerry
jer### [at] hoboescom   
http://www.hoboes.com/jerry/                   e-mail hel### [at] hoboescom
What Your Children Are Doing: http://www.hoboes.com/html/NetLife/Children/


Post a reply to this message

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