|
From: Oliver G. <ol...@gm...> - 2007-12-12 21:34:14
|
Hello, attached is a C++ example where an int reference is used which points to freed memory. When starting that program with parameter "x", it will access this (invalid) reference, and Valgrind will show an "Invalid read of size 4" error. However, when starting the program without any parameter, the reference will not be accessed - yet the actual error is still there, waiting for some poor fool like me who starts the program with that tiny little parameter that triggers the error :-( I'm wondering if there's a way to find this invalid reference with Valgrind. Even though it is not dereferenced, it still silently points to an invalid memory location, and it might be used some day. Do you know if there is a way to detect this? Thanks, Oliver Gerlich |