POV-Ray : Newsgroups : povray.programming : media.cpp problem Server Time
5 Jul 2024 15:57:43 EDT (-0400)
  media.cpp problem (Message 1 to 3 of 3)  
From: Drew Kearns
Subject: media.cpp problem
Date: 30 Mar 2003 01:15:03
Message: <web.3e868a715f21c970e8cde3690@news.povray.org>
Hello all.  I am working on a complicated scene which currently causes
POVRay to crash with an application exception.  After spending some time
running the code through MSVC, I've narrowed the problem down to a memory
clobbering that seems to be happening in media.cpp in the function
get_lit_interval (1469).

WHen the clobbering happens, the function is called with:
1 members in light_list
10 members in local_light_list
5 elements in Lit_Interval

At line 1505 in media.cpp, "curr" is set to Lit_Interval[0], "n" is 0 and
"a" is 11.  In the FOR loop started at line 1535, the first IF statement
(s0[i] > prev->s1) evaluates to true for each member.  This causes "curr"
to be incremented twice per loop...and in the third loop starts romping
through RAM as the pointers are now outside of the Lit_Interval bounds.

Could someone who is more familiar with media.cpp take a look at this loop
from this point?  I'm not familiar enough with the code to second guess
what it's doing at this point...but it does seem odd to me that it's
incrementing thru the Lit_Intervals array based on the count of global and
local lights?

Thanks-
-Drew


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: media.cpp problem
Date: 30 Mar 2003 09:48:25
Message: <3e8703b9@news.povray.org>
Drew Kearns wrote:

> Hello all.  I am working on a complicated scene which currently causes
> POVRay to crash with an application exception.  After spending some time
> running the code through MSVC, I've narrowed the problem down to a memory
> clobbering that seems to be happening in media.cpp in the function
> get_lit_interval (1469).
> 
It would probably be helpful if you post the pov scene file which 
triggers the bug. 
(You may try to remove any code from the pov scene file which is 
not needed to trigger the bug.)

Otherwise, the developers may not be able to reproduce the bug. 

Wolfgang


Post a reply to this message

From: Drew Kearns
Subject: Re: media.cpp problem
Date: 30 Mar 2003 22:50:04
Message: <web.3e87b9d79d106d7ee8cde3690@news.povray.org>
Wolfgang Wieser wrote:
>It would probably be helpful if you post the pov scene file which
>triggers the bug.
>(You may try to remove any code from the pov scene file which is
>not needed to trigger the bug.)
>
>Otherwise, the developers may not be able to reproduce the bug.

Heh...I'm still trying to do that!  The problem is that the crash only
happens when I turn on all the objects in my scene...the source is rather
large.  Best clues I'm working with right now is that it has something to
do with a a media filled sphere inside of a light group.

Unfortunately, I haven't yet been able to create a simple scene that then
causes the relevent section of the FOR loop to fire.  I was hoping that
someone who might be familiar with the LIT_INTERVAL struct could give me
some idea on what the ->s0 and ->s1 values are and how they get filled, so
I could get a better idea on what would be needed to repro.  I'll keep
trying...if I can't, I'll just put the whole shebang on the web and post a
link.

Thanks-
-Drew


Post a reply to this message

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