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

QProcess behaves strangely



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


      Lately there have been several reports about situations where debugging with Qt Creator 3.0/Qt 5.2 "does not work".

      The setup is QProcess (or a QProcess based class starts gdb, gdb sets breakpoint, starts the debuggee, and the breakpoints are not hit. The
      observable effect for small test cases is that debuggee runs successfully to the end and gdb reports "During startup program exited normally."

      Starting gdb on the commandline on the same debuggee works as expected.

      Directly inserting a trap in the code with asm("int $3") instead of using
      gdb to set the breakpoint yields the same behaviour, the trap is also
      present in the generated code, but it does not stop execution when run
      in the QProcess/gdb/debuggee combination.

      I can reproduce this 100% on my current desktop machine (Stock Ubuntu 13.10 64 bit, gdb 7.6.1) after a distribution change by running the dumper autotest (e.g. tests/auto/debugger/tst_dumpers dumper:QByteArray1)

      I have not seen the issue before the upgrade with the same version(s) of Qt and Qt Creator before the upgrade, and neither on any other machine.

      The problem seems independent of the version of Creator (current 3.0 or master "work" when comand GDB.

      Bisecting Qt leads to the following commit

      866a5d0c28f458d50ab9e4f011fc7a94822ce6eb is the first bad commit
      commit 866a5d0c28f458d50ab9e4f011fc7a94822ce6eb
      Author: Corentin Jabot <corentinjabot@gmail.com>
      Date:   Sun Feb 17 14:05:57 2013 +0100
          Make QProcess startable with open()
          Add setProgram() and setArguments() methods to the QProcess api.
          Add a convenient start(QIODevice::OpenMode) method.
          Move the implementation of QProcess::start() to QProcess::open()
          unifying the QProcess api with other QIODevice subclasses.
          Change-Id: Id1af57da05f750fe8d526d391589c05ee8037bca
          Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
      :040000 040000 2f99dd3dcb60341f3f38579817e7330b4985b403
      e8de1e13df369d73c666a945122d136179e20ca2 M      src
      :040000 040000 7c3e4c3a238f298dd14846f8ca390698dac6ecb6
      da8bb58d5563333c5a807000f4132470883fa160 M      tests

      Before this commit "all works".


        1. debuggee.cpp
          0.1 kB
        2. dummylib.cpp
          0.2 kB
        3. full_test.tgz
          8 kB
        4. main.cpp
          0.7 kB
        5. perf-script.txt
          40 kB
        6. run.sh
          0.9 kB
        7. trace-bad-follow-child.txt
          1.09 MB
        8. trace-bad-toplevel-only.txt
          81 kB
        9. trace-good-follow-child.txt
          1.09 MB
        10. trace-good-toplevel-only.txt
          80 kB

          Issue Links

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



              hjk hjk
              hjk hjk
              0 Vote for this issue
              5 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes