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

QProcess truncates output from a crashing test



    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Invalid
    • Affects Version/s: 5.14
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
    • Environment:


      The testlib self-test runs each sub-test in a QProcess which collects the output for comparison with expected versions of the output; in a few cases, there are known variants on the output, so several expected output files are provided. The expected output files live in qtbase/tests/auto/testlib/selftests/.

      One test case is the crashes test which, as its name suggests, crashes (it deliberately dereferences a nullptr as array, asking for its entry at index [1]). One of its example output files, expected_crashes_4.txt, is a truncation of another, expected_crashes_3.txt, leaving off the last twolines (the test summary details). On attempting to merge qtbase's 5.13 branch into dev, we have run into failures for this test due to a further truncation of this example output, leaving off another two lines.

      The truncation only happens on the (Ubuntu) Coin VM, with -no-widgets -force-debug-info passed to configure, along with a -prefix (i.e. not a developer-build, so make install is needed); and may need -nomake test as well (i.e. you'll need to explicitly run qmake on the testlib/selftests/ component after installing). Even so, when I run the compiled crashes/crashes binary, with QTEST_DISABLE_CORE_DUMP=1 and QTEST_DISABLE_STACK_DUMP=1 set in the environment (as the selftest does), from a shell, I get the full expected_crashes_3.txt - so, apparently, the problem is that QProcess is truncating the output, presumably because it learns of the child's death before it collects all the output from it.


          Issue Links

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



              • Assignee:
                thiago Thiago Macieira
                Eddy Edward Welbourne
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created:

                  Gerrit Reviews

                  There are no open Gerrit changes