|
From: Patrick M. <un...@pa...> - 2003-06-03 17:52:32
|
Hi, Ive just started using valgrind, and Im getting odd errors reported by valgrind: "Conditional jump or move depends on uninitialised value(s)" from code that uses a if/else checking if foo == NULL or not "Invalid write of size 1" when freeing. "Use of uninitialised value of size x" when using GLfloat foo = bar; (or any typedefed type for that matter) How do I fix these, or do I just ignore them? -- Patrick "Diablo-D3" McFarland || un...@pa... "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." -- Kristian Wilson, Nintendo, Inc, 1989 |
|
From: David E. <da...@2g...> - 2003-06-03 18:17:30
|
On Tue, 2003-06-03 at 19:51, Patrick McFarland wrote: > Hi, Ive just started using valgrind, and Im getting odd errors reported by > valgrind: > > "Conditional jump or move depends on uninitialised value(s)" from code that > uses a if/else checking if foo == NULL or not Then "foo" hasn't been initialized where it came from. Check the backtrace. > "Invalid write of size 1" when freeing. Maybe freeing the same memory twice? > "Use of uninitialised value of size x" when using GLfloat foo = bar; (or any > typedefed type for that matter) Probably "bar" hasn't been initialized where it came from. Check the backtrace. > How do I fix these, or do I just ignore them? At least don't ignore them if it's your own code :-) -- -\- David Eriksson -/- www.2GooD.nu "I personally refuse to use inferior tools because of ideology." - Linus Torvalds |
|
From: Patrick M. <un...@pa...> - 2003-06-03 22:55:46
|
On 03-Jun-2003, David Eriksson wrote: > On Tue, 2003-06-03 at 19:51, Patrick McFarland wrote: > > Hi, Ive just started using valgrind, and Im getting odd errors reported by > > valgrind: > > > > "Conditional jump or move depends on uninitialised value(s)" from code that > > uses a if/else checking if foo == NULL or not > > Then "foo" hasn't been initialized where it came from. Check the > backtrace. I know it has been initalized. Its being set by a function that either returns a memory pointer _that must be valid_, or NULL. > > "Invalid write of size 1" when freeing. > > Maybe freeing the same memory twice? Double checked, Im not. > > "Use of uninitialised value of size x" when using GLfloat foo = bar; (or any > > typedefed type for that matter) > > Probably "bar" hasn't been initialized where it came from. Check the > backtrace. Double checked this as well. bar always has to be initialized correctly. BTW, has there been any problems with either debian sid's build, or valgrind in conjunction with sid's gcc 3.3.x and/or libc? -- Patrick "Diablo-D3" McFarland || un...@pa... "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." -- Kristian Wilson, Nintendo, Inc, 1989 |