whitebread

1.23.2009

Advice to the C coder

When valgrind reports that you’re using an uninitialized value, and you’re absolutely certain you initialized the variable it’s reporting, know this:

Valgrind is LYING TO YOU.

What to do:
Look at the lines of code preceding the one valgrind is complaining about, and you’ll probably find your uninitialized value.

On a separate issue, if anyone can tell me what is going on here I would be most grateful:

==13298== —- Attach to debugger ? — [Return/N/n/Y/y/C/c] —- y
==13298== starting debugger with cmd: /usr/bin/gdb -nw /proc/13299/fd/1014 13299
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “i486-linux-gnu”…
(no debugging symbols found)
Attaching to program: /proc/13299/fd/1014, process 13299
Cannot access memory at address 0×5c893818
A program is being debugged already. Kill it? (y or n) y
/proc/13299/fd/1014: Permission denied.

One Response to “Advice to the C coder”

  1. Pop Says:

    You are a geek!

Leave a Reply

 

The views and opinions expressed in this page are strictly those of the page author.
The contents of this page have not been reviewed or approved by the University of Minnesota.