POV-Ray : Newsgroups : povray.off-topic : You lose some... : Re: You lose some... Server Time
6 Sep 2024 21:23:21 EDT (-0400)
  Re: You lose some...  
From: Slime
Date: 4 Oct 2008 18:27:56
Message: <48e7edec$1@news.povray.org>
>  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.

True; sometimes you have to step carefully through the program to see what 
it's doing and figure out where your memory management is going wrong. In 
this case though, the error is

"Unhandled exception at 0x00414166 in Huffman01.exe: 0xC0000005: Access
violation reading location 0x00000004."

Access violation reading location 0x00000004 means it's very likely you're 
dereferencing a NULL pointer somewhere, because of how close 4 is to 0. (The 
program is taking a NULL pointer, treating it as a struct or class of some 
sort, and trying to get the member that is 4 bytes into it.) So, if you just 
hit F5 and run the program as usual, it will tell you right where it is when 
it crashes by pointing at the line. You can also look at the call stack pane 
to see how it got there. It will probably be easy to see what the NULL 
pointer is.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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