Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. reading file line by line crashes

reading file line by line crashes

Scheduled Pinned Locked Moved Solved General and Desktop
qt 4.8qtextstreamreadline
17 Posts 5 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mourad_bilog
    wrote on last edited by
    #4

    First, Thanks for reply.

    @jsulm it's a memory crash. Below the error occured :

    Exception de première chance à 0x0fcbd5be (msvcr80d.dll) dans TheriaqueUpdater.exe : 0xC0000005: Violation d'accès lors de l'écriture à l'emplacement 0x2804e000.
    Exception non gérée à 0x0fcbd5be (msvcr80d.dll) dans TheriaqueUpdater.exe : 0xC0000005: Violation d'accès lors de l'écriture à l'emplacement 0x2804e000.
    

    @J-Hilk the crash occus on in.readLine. The recod data has 6 entries and it's shown evey time.
    I've commented the eventLoop but the application still crashes.

    Note that line data lengths can be around 1 milion carachtars.

    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • M mourad_bilog

      First, Thanks for reply.

      @jsulm it's a memory crash. Below the error occured :

      Exception de première chance à 0x0fcbd5be (msvcr80d.dll) dans TheriaqueUpdater.exe : 0xC0000005: Violation d'accès lors de l'écriture à l'emplacement 0x2804e000.
      Exception non gérée à 0x0fcbd5be (msvcr80d.dll) dans TheriaqueUpdater.exe : 0xC0000005: Violation d'accès lors de l'écriture à l'emplacement 0x2804e000.
      

      @J-Hilk the crash occus on in.readLine. The recod data has 6 entries and it's shown evey time.
      I've commented the eventLoop but the application still crashes.

      Note that line data lengths can be around 1 milion carachtars.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #5

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M mourad_bilog

        First, Thanks for reply.

        @jsulm it's a memory crash. Below the error occured :

        Exception de première chance à 0x0fcbd5be (msvcr80d.dll) dans TheriaqueUpdater.exe : 0xC0000005: Violation d'accès lors de l'écriture à l'emplacement 0x2804e000.
        Exception non gérée à 0x0fcbd5be (msvcr80d.dll) dans TheriaqueUpdater.exe : 0xC0000005: Violation d'accès lors de l'écriture à l'emplacement 0x2804e000.
        

        @J-Hilk the crash occus on in.readLine. The recod data has 6 entries and it's shown evey time.
        I've commented the eventLoop but the application still crashes.

        Note that line data lengths can be around 1 milion carachtars.

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #6

        @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";
        

        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        2
        • M Offline
          M Offline
          mourad_bilog
          wrote on last edited by
          #7

          @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.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mourad_bilog
            wrote on last edited by
            #8

            @J-Hilk
            I've commented that line but the same occurs.

            J.HilkJ 1 Reply Last reply
            0
            • M mourad_bilog

              @J-Hilk
              I've commented that line but the same occurs.

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #9

              @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 ?


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              M 1 Reply Last reply
              0
              • J.HilkJ J.Hilk

                @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 ?

                M Offline
                M Offline
                mourad_bilog
                wrote on last edited by
                #10

                @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.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mourad_bilog
                  wrote on last edited by
                  #11

                  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 ?

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    @mourad_bilog said in reading file line by line crashes:

                    1 200 000

                    really one line?

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mourad_bilog
                      wrote on last edited by
                      #13

                      @Christian-Ehrlicher there's many lines witch everyone exceed 1 milion charactars.
                      Is this a problem ? That can exceed what QTextStream buffer contains ?

                      1 Reply Last reply
                      0
                      • Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote on last edited by
                        #14

                        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)

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        2
                        • M Offline
                          M Offline
                          mourad_bilog
                          wrote on last edited by
                          #15

                          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 ?

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #16

                            Hi,

                            Did you monitor your application RAM usage ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            1
                            • M Offline
                              M Offline
                              mourad_bilog
                              wrote on last edited by
                              #17

                              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

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved