I'm working on a program that reads in a file to get data. I have no problems with the program until the user-specified file starts to get really large. When testing with a 68MB text file, ifstream fails on the first attempt (if(!fin) passes, where "fin" is the ifstream variable), but if you give it the same file name a second time around (without quitting out of the program), it core dumps. To add to the mystery, it doesn't necessarily core dump in the same place each time, and it never cores on anything dealing with the ifstream... it usually cores on something completely unrelated like a simple assignment a few lines down in the code.
Again, it works fine with smaller files (I've tested up to 6MB with no problem), even if you read them over and over, or if you switch files while the program is still running...
I have the program echoing back a messsage to the user if the ifstream fails with the name of the file it failed on... this message comes up with a '!' appended to the end of the file name (I'm baffled by this) when ifstream fails on this very large file.
The code has been compiled an run on Linux 7.1 and Windows NT4.0, yielding the same results. The Linux machine has 1GB of RAM, the Windows machine has 96MB.