Interfacing with Linux

I am also having this same issue, but only with the newer Arduino MEGA 2560. So far I have not encountered this problem with my older Arduino MEGA 1280. The strange thing is that this rarely happens on my xp system, only linux. I am using the ArduinoIDE0021 and running UBUNTU Linux.

Have you tried to add a delay after the serailRead/Write? I believe that sometimes fixed the problem, although I am not a hundred percent sure as it was a awhile ago since I used that board.