POV-Ray : Newsgroups : povray.unofficial.patches : Bug in pigment object (Chris Huff's patch) : Re: Bug in pigment object (Chris Huff's patch) Server Time
2 Nov 2024 11:24:47 EDT (-0400)
  Re: Bug in pigment object (Chris Huff's patch)  
From: Mark Wagner
Date: 12 Dec 1999 00:30:56
Message: <38533310@news.povray.org>
Thorsten Froehlich wrote in message <384fcfb1@news.povray.org>...
>Chris, maybe these tips help :-)
>
>Not reproducible crashes, especially on the Mac are most likely caused by
>invalid pointers or other out of range addressing. As the Mac OS does not
>have full memory protection (yet) these bugs are hard to catch. However,
>there are several (free) tricks you can use:
>- Use the MacsBug "hs" command to turn on/off heap scrambling.
>- When you free memory a pointer points to, set the pointer to NULL.
>- Init all pointers and data structures you use to NULL before using them
>(even if it looks stupid, i.e. code _should_ always put something into a
>pointer).
>
>In general, you should then see either hard crashes (mostly with "hs" on)
or
>memory access faults when your program tries to write to memory locations
>around 0 which are protected by the system. You will also see failing free
>calls if the pointers are set to NULL and somewhere code tries to free that
>memory again.


Another thing you can do is in config.h uncomment the lines:
#define MEM_TAG     // Enables memory tag debugging
#define MEM_TRACE   // Enables garbage collection and memory tracing

This will cause the program to alert you to such things as memory leaks and
attempts to free memory twice or free invalid memory locations.

Mark


Post a reply to this message

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