Question: I have just purchased a new CF card for my DSLR. I tested it using Xbench (Mac OS X) and it performs as expected. However, I'd like to do a "surface scan" (moving platter term) to check for "bad sectors" (moving platter term). I could bash script a processes using dd, but I get the feeling that there is a better way out there. My goal is to conclusively know that a memory card (CF, SD, etc.) is safe to use on a photo shoot, and that is doesn't need to be returned before the 30 day vendor policy window expires.

I definitely want Mac solutions given here. I would also like to get a few Linux suggestions. Let's even throw a bone to the windows users just so that this one question can meet everyone's needs.

Answer: 
As the controller can move the blocks wherever it wants (see wear leveling), the only chance for a whole read/write-test ist to fill the disk up and then compare. Several times with different patterns of course to be sure.

And still you won't catch faulty regions, as they are hidden too by the controller as long as he has spares.
Reading your comment below the question, I believe [F3](https://github.com/AltraMayor/f3) does exactly what you want. It compiles on Linux/Mac OS X and is also available via Homebrew.