|
From: Nicholas N. <nj...@cs...> - 2006-02-20 21:02:25
|
On Mon, 20 Feb 2006, Brendan Drew wrote: > First, Valgrind (I'm running 3.1.0 on a dual dual core opteron box in pure > 32bit mode) really doesn't seem to like static (scalar) variables. When I run > code which uses static variables, memcheck complains about invalid reads of > size 4 (not surprising since the variables in question were uint32_t's). The > error messages went away when I got rid of the static variables, which is > consistent with what I've seen elsewhere. Is this related to issues with > static arrays? I don't know the C++ ABI well enough, but I'd expect that > static scalars are allocated in the data section (together with global static > arrays), as opposed to the stack which is used for local variables, so I'm > pretty certain that these issues aren't related. You need to give us more specific information. Do you have a small test case that exhibits the behaviour? What does Valgrind's output look like? > Second question is a bit more troublesome: I get different behavior when > executing a program under Valgrind (specifically, memcheck) than I do when > just executing from the command line. In this case, I get a SIGSEGV which > refers to a null pointer being dereferenced. That's fine --- I get why the > null pointer deref should cause a segfault, the problem is that this doesn't > happen when not running under Valgrind. The program continues executing > normally, which is not the behavior one would expect when deref'ing a null > pointer. Any thoughts? Sometimes bugs can crash a program when running under Valgrind that don't crash it normally, and vice versa. They're still bugs that should be fixed, though. Nick |