The Memory-Allocating Power of Prayer

Nick’s 12-Step Guide to Fixing Mysterious Memory Errors

  1. Write some code and run it. Fail.
  2. Add a bunch of debug statements and rerun the code. Fail.
  3. Use GDB to find segmentation faults, bus errors, and bad access errors. Fail.
  4. Try to determine why GDB is setting breakpoints in functions that don’t exist. Fail.
  5. Curse GDB and its children, yea, unto the tenth generation!
  6. Rewrite memory allocation code and rerun the code. Fail.
  7. Rearrange contents of data structures and rerun the code. Fail.
  8. Change all variables to 4-byte types. Fail.
  9. Appeal to the superior coding ability of The Bruce. Fail.
  10. Examine the memory at the byte level and watch as your data structure is flipped, split, rearranged, and regurgitated. Wonder if God can exist in a world where bytes change their hexadecimal values on a whim.
  11. Blame Linus Torvalds, Steve Jobs, Reid Simmons, Alan Turing, Charles Babbage, and anyone else but yourself who could have any affect on a computer’s memory.
  12. Finally succumb to the dark powers and sacrifice a squirrel on top of a flaming ergonomic Microsoft keyboard while chanting “Arise, robot! Robot, arise!” repeatedly.

Don’t be terribly surprised that the last step works.

Revolution 1” from The Beatles (The White Album) by The Beatles

2 comments on “The Memory-Allocating Power of Prayer
  1. stepleton says:

    For the love of all things holy, VALGRIND. It’s the best reason to own an Intel machine. If you’re not developing portable code, make it portable to Intel so you can use Valgrind.

    Google it if you don’t know about it. You’ll be glad you did.

  2. metasilk says:

    *chuckle* Whoops. See also ‘s recent post about programming. Heh.

Nurd Up!