So here's an update - I don't think it was the volatile keyword all along - I was powering the test function generator from a PC while running the datalogger. When they were both plugged into the same computer, it would work fine. I transferred JUST the datalogger to a laptop running off of batteries, and it would start to have corruption issues. When I moved the signal generator to the laptop as well, everything works fine again, so I'm apparently picking up noise on the ground connection even though the laptop is un-grounded. Weird, but at least I have the source.