Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57345

Reading a line over 128mb with QTextReader from a file crashes with bad alloc with 32bit application

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.0
    • Core: I/O
    • Windows

    Description

      When reading a long line (128mb+) from a file with QTextReader, the 32bit application crashes with bad alloc. 64bit application does not crash in this situation.

      The stacktrace of crash is:
      1 RaiseException KERNELBASE 0x7576c54f
      2 CxxThrowException VCRUNTIME140D 0xf5990a2
      > 3 qBadAlloc qglobal.cpp 3044 0x66ada83c
      4 QString::reallocData qstring.cpp 1772 0x66ba5026
      5 QString::resize qstring.cpp 1686 0x66b9df04
      6 QString::setUnicode qstring.cpp 4853 0x66ba4403
      7 QTextStream::readLineInto qtextstream.cpp 1729 0x66c76283
      8 QTextStream::readLine qtextstream.cpp 1680 0x66c76182
      9 main main.cpp 12 0x11e1540

      Steps to reproduce:

      • Run attached sample
      • EXPECTED: Line is properly read from the file
      • ACTUAL: Application crashes

      Attachments

        1. qtbug57345.zip
          241 kB
        2. qtbug57345.zip
          200 kB
        3. qtbug57345_valgrind_log.txt
          1 kB
        4. qtbug57345_stack.txt
          4 kB
        5. qtbug57345_diag.diff
          1 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              laknoll Lars Knoll
              jussi_witick Jussi Witick
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes