reading file line by line crashes
-
@mourad_bilog said in reading file line by line crashes:
Note that line data lengths can be around 1 milion carachtars
How long is the line you're reading when the app is crashing?
-
@mourad_bilog said in reading file line by line crashes:
@J-Hilk the crash occus on in.readLine. The recod data has 6 entries and it's shown evey time.
do not base this solely on faith:
if(record_data.size()> 3) qDebug() << "Fin lecture d'une ligne n°" << QString::number(++nb_cmd) << record_data[3] << QTime::currentTime().toString("hh:mm") << endl ; else qDebug() << "would have crashed";
-
@jsulm said in reading file line by line crashes:
How long is the line you're reading when the app is crashing?
About 1 200 000 charactars.
-
@J-Hilk
I've commented that line but the same occurs. -
@mourad_bilog alight thanks thumbs up
question , is this Qt4?
and is this a multi threaded project, and is do you read and write to that file from different places ? -
@J.Hilk
question , is this Qt4? yes. but the program runs correctly for some years.and is this a multi threaded project, : No, it's one thread.
and is do you read and write to that file from different places : No, I just read from that file. I just open it in "ReadOnly" mode.
-
I've read in a post how has similar problem that he has solved the problem using file.readLine no QTextStream.readLine(). What is the difference between the 2 functions ?
-
-
@Christian-Ehrlicher there's many lines witch everyone exceed 1 milion charactars.
Is this a problem ? That can exceed what QTextStream buffer contains ? -
At least I would consider this - it's a 2.4MB huge QString, should be ok but who knows. I would simply try QFile::readLine(), split the QByteArray and convert to QString as late as possible (if needed at all)
-
Checking Windows events journal, it indicates that msvcr causes this crash, that's true ?
Nom de l’application défaillante Updater.exe, version : 2.7.4.0, horodatage : 0x5a018f88 Nom du module défaillant : MSVCR80.dll, version : 8.0.50727.9445, horodatage : 0x5a7bc74c Code d’exception : 0xc0000005 Décalage d’erreur : 0x0001508e ID du processus défaillant : 0x19a0 Heure de début de l’application défaillante : 0x01d4d8a5bb99dd52 Chemin d’accès du module défaillant: C:\WINDOWS\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.9445_none_d08c58b4442ba54f\MSVCR80.dll ID de rapport : 6c470b7e-a3b2-4584-b404-3d7957545ead Nom complet du package défaillant : ID de l’application relative au package défaillant :
I've re-installed Visual redistribuable 2005 but the problem persists. Note that I dont found msvcr80 in the system32 not like other versions msvcr71, msvcr10, etc.
Does this the problem ?
-
Hi,
Did you monitor your application RAM usage ?
-
Finally I changed reading mode to read directly from the data file. It's most faster and just I was care to encode data when reading to keep special charcatars.
Thanks all for your ideas