Alright, I get your point. I stripped the program down to what you suggested and ran it with my large (60,000 lines) rawdata.txt file. The program is not segfaulting... This is strange because when reading from the COM port, it does segfault in much shorter time. Why could this be?