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

QTextStream::pos() interferes with QTextStream::readLine ()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 4.6.2
    • Core: I/O
    • None

    Description

      Calling QTextStream::pos() causes invalid behaviour of QTextStream::readLine ().
      Somewhere at the boundary of inner QTextStreamPrivate::readBuffer of 16Kb occurs the malfunction of QTextStream::readLine ().

      It may be illustrated by the simple attached project ReadLineBug.pro that processes file test.s19 that is attached also.
      When macro BUG_SWITCHED_ON is defined one would obtain output of INCORRECT behavior that finishes as

      ...
      #348 'S315400015a000000568000005690000056a0000056b3b'
      #349 'S315400015b00000056c0000056d0000056e0000056f1b'
      INVALID VALUE of txpos
      #350 'S0200000443A5C50726F6A656374735C5A6F6E645C64656275675C74312E73313955'
      INVALID VALUE of txpos
      INVALID LINE HAS BEEN READ

      If one would undefine macro BUG_SWITCHED_ON then the program ReadLineBug
      demonstrates correct behavior and its output finishes as

      ...
      #397 'S315400018b00000062c0000062d0000062e0000062f14'
      #398 'S315400018c000000630000006310000063200000633f4'
      #399 'S315400018d000000634000006350000063600000637d4'
      #400 'S315400018e000000638000006390000063a0000063bb4'
      file has been read OK

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            yso Yuri Osipov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes