Compass problems maybe fixed with iOS 4.0.1
My iPhone 4 compass was essentially pointing random directions, making it entirely useless after the comic effect wears off in about 15 seconds. This is very disturbing to me, because I DO USE the compass. There are several apps that use the compass to good effect, including apps that orient a sky map, apps that show you what store is directly in front of you when you are in a shopping area, apps that tell you which way to go to reach a geocache, etc. The compass is a fun and interesting part of the phone, and it REALLY SUCKS when it doesn't work at all.
I called AppleCare and the technical support person suggested that I upgrade to the latest version of the iOS operating system, which is 4.0.1 (8A306). It takes me about 2 hours to download an upgrade at my home. I commenced it today, without much enthusiasm, and with low expectations for getting the compass problem improved. I can't say for sure how this will work out in the long run, because I have only tested it for a few minutes out in the front yard, but initial indications are cautiously positive. Apps that use the compass are not completely fluid, but at least the compass seems now to be consistently pointing within about 10 degrees of true north, which is at least good enough to be useful again. I will test it out under other circumstances and see how it goes. If you care about the compass, it may be worthwhile to upgrade to the latest version of iTunes and iOS and see how it works out for you. (For those of you who just want to complain about phone flaws and flame Apple, it would be nice if you'd go somewhere else.)