POV-Ray : Newsgroups : povray.unofficial.patches : Warp transform crash. Server Time
1 Nov 2024 07:29:14 EDT (-0400)
  Warp transform crash. (Message 1 to 3 of 3)  
From: Fabien Mosen
Subject: Warp transform crash.
Date: 13 Mar 2001 10:35:27
Message: <3AAE3DB0.F0D1EA00@skynet.be>
This little scene make WinMegaPOV 0.7 crash at the end of the 
rendering.  Any other transform within warp causes the crash also.

#version unofficial MegaPov 0.7;

#include "colors.inc"

camera {location <10,10,8> direction z*6 look_at <0,1,0>}

light_source {<50,40,30> White*2}

#declare Pig_Wood = pigment {
  wood
  color_map {[0 Black][1 White]}
  warp {turbulence .1 scale 5}
}

sphere {<0,1,0>,1.7 pigment {Pig_Wood}}


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Warp transform crash.
Date: 14 Mar 2001 06:35:39
Message: <3AAF57AF.A8063E99@aetec.ee>
Fabien Mosen wrote:
> 
> This little scene make WinMegaPOV 0.7 crash at the end of the
> rendering.  Any other transform within warp causes the crash also.
> 
> #version unofficial MegaPov 0.7;
> 
> #include "colors.inc"
> 
> camera {location <10,10,8> direction z*6 look_at <0,1,0>}
> 
> light_source {<50,40,30> White*2}
> 
> #declare Pig_Wood = pigment {
>   wood
>   color_map {[0 Black][1 White]}
>   warp {turbulence .1 scale 5}
> }
> 
> sphere {<0,1,0>,1.7 pigment {Pig_Wood}}

Crash is caused by attempt to release warp's transformation structure
memory twice. And memory is released twice due to incorrect warp copy
implementation:
transformation matrix is copied in the beginning of Copy_Warps function,
but thereafter warp structure is copied with memcpy, so this pointer to
its own transformation matrix is overwritten and will point to
transformation matrix from source and memory, which is allocated for new
copy transformation, is lost.
In order to correct this, transformation copy should be performed after
warp copy, i.e. lines 

#ifdef TransformableWarpsPatch
    New->Warp_Transform = Copy_Transform(Old->Warp_Transform);
#endif
should be after switch block in Copy_Warps.


Post a reply to this message

From: Fabien Mosen
Subject: Re: Warp transform crash.
Date: 14 Mar 2001 08:34:52
Message: <3AAF72EB.3C9DDCEA@skynet.be>
Vahur Krouverk wrote:

> Crash is caused by attempt to release warp's transformation structure
> memory twice. And memory is released twice due to incorrect warp copy
> implementation:
...

Nice !  One more squashed bug !  Thanks.

Mael, if you read this, I'll be immensely grateful if you included
that correction into your next MLPOV release :-)

Fabien.


Post a reply to this message

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