POV-Ray : Newsgroups : povray.off-topic : You lose some... : Re: You lose some... Server Time
6 Sep 2024 21:19:00 EDT (-0400)
  Re: You lose some...  
From: Warp
Date: 4 Oct 2008 16:47:23
Message: <48e7d65b@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Warp wrote:

> >   I can't see anything wrong with it, and I tried it and there was
> > nothing wrong with it. The error must be somewhere else.

> Right. So maybe I'm passing it a reference to something that doesn't 
> exist anymore then?

  Without seeing the whole program it's impossible to tell.

  Btw, have you been using the at() function rather than operator [] like
I have been suggesting?

> >   If you are running it in linux, try running it using valgrind (if you
> > don't have it, install it; it's essential). In other words:
> > 
> > valgrind ./yourprogram
> > 
> >   If will tell you if you have some out-of-bounds access or memory leaks.

> M$ Visual Studio is telling me something is wrong, but it isn't telling 
> me much beyond that. (I probably need to figure out how to work the 
> debugger first...)

  Just compile in debug mode and run the debugger (F5).

  However, the Visual Studio debugger won't tell you if you have, for
example, a memory leak. The place where the program crashes (which will
be shown by the debugger) is not necessarily the place where the bug is.
It might be able to tell you if you are writing out of bounds or accessing
freed memory, but not necessarily. Valgrind will be able to do that.
Unfortunately, AFAIK, valgrind is not available for Windows or VS projects,
so you'll have to do the testing in linux.

  (Profilers like valgrind which support VS programs in Windows exist,
but I know of no free one.)

-- 
                                                          - Warp


Post a reply to this message

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