Some users have reported that the iPod app on the iPhone crashes after the iOS 4.0 update. These users report that the app crashes on launch, or while it is running in the background. In other cases, songs will simply stop playing midway, although the iPod app does not crash completely.
Turn off Spotlight for audio files. Navigate to Settings -> General -> Home Button -> Spotlight Search Results and deselect Music, Podcasts and Audiobooks.
Don’t sync podcasts. In some cases, it appears that problematic podcast files may be to blame for this issue. Deselect podcasts for syncing in iTunes, then re-sync your iPhone.
Switch to manual sync. After performing the aforementioned fixes, try switching to manual syncing in iTunes. To do so, select your iPhone from the left-hand pane in iTunes, then click the Summary tab and select “Manually manage music and videos”.
Restore, but not from backup. It appears that bad holdover data from iPhone backups can cause this problem in some cases. Restoring as a new phone will delete contacts and other data, but may resolve this issue. To do so, connect your iPhone or iPod touch to your computer, click “Restore” in iTunes, then choose “setup as new phone.”