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

qtdiag has incomplete text output

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.1
    • 5.5.1
    • Other
    • None
    • Operating system: Windows 10

    Description

      Problem: In some cases, the contents of the output of the "qtdiag" command generated by building Qt is incomplete.
      Steps to reproduce: Open command prompt, run "qtdiag > output.txt" and verify that the contents of "output.txt" differ from the contents that are written on the console when the command "qtdiag" is run by itself.

      It happens only on a few Windows machines, but on those machines it happens very frequently/always. See below for a longer explanation.


      We've identified an issue in some machines where the output of the "qtdiag" is "incomplete". It doesn't happen in all machines but it happens often/all the time in the machines that are affected.

      On those machines, running the command "qtdiag" in a Windows command prompt outputs everything as expected. However, piping the output to a file via, for example, "qtdiag > output.txt" will often result in the output.txt file having only a part of the expected contents. This behavior is also noticed on those machines when calling "qtdiag" programmatically and piping its output - in our specific case, via Python's "subprocess.check_output('qtdiag')".

      We've investigated the issue a bit and noticed that "qtdiag" doesn't explicitly flush its string contents on the source code (seen here at http://code.qt.io/cgit/qt/qttools.git/tree/src/qtdiag/main.cpp). We've created a local version of "qtdiag" that adds a "std::wcout.flush();" line after the text stream write and we confirm that solves the issue, so the current hypothesis is that the stream is not being flushed completely before the process ends, but only on some machines, and only on Windows.

      Attachments

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

        Activity

          People

            laknoll Lars Knoll
            tnobrega Tiago Nobrega
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes