Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-26384

Missing message box when ptrace doesn't permit attaching

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 6.0.0-beta1
    • Qt Creator 5.0.2, Qt Creator 6.0.0-beta1
    • Debugger
    • Ubuntu 20.04 LTS
      gdb 9.2
    • 786dbcb9e86104be12ceded01188f9b4095e47be (qt-creator/qt-creator/6.0)

    Description

      1. Set ptrace_scope to "1".
        Looks like this can be done in /proc/sys/kernel/yama/ptrace_scope . It seems to be the default on Ubuntu 20.04 LTS. At least I cannot remember ever changing it.
      2. Build the manual test "gui".
        It's in tests/manual/debugger/gui/gui.pro of Creator's repository.
        I tried building it with release builds of Qt 5.15.2 and Qt 6.2.0 as well as with a developer build of Qt 6.2.0. All led to the same result.
      3. Run the resulting binary independently of Qt Creator.
      4. If you don't use German locale system-wide, start Creator with German locale, e.g.:
        LC_ALL="de_DE.UTF-8" ./qtcreator-6.0.0-beta1o/bin/qtcreator -tcs
        

        Creator will start with German UI.
        You need to set the locale. Changing Creator's UI to German in its settings is not sufficient for reproducing the problem. Once again, this is the default on Ubuntu 20.04 LTS. Explicitly setting LC_ALL only allows reproducing the problem on systems using a different locale.

      5. From Creator's menu, select "Debuggen" -> "Debuggen" -> "Debugge externe, lokal laufende Anwendung".
      6. Select the process started in step 3 from the list and click "An Prozess anhängen".
        Creator will try launching the debugger and fail silently. In the Application Output view ("Ausgabe der Anwendung") you can read something like:
        22:48:52: Debugging /home/qtrob/dev/src/creator-squish/tests/manual/debugger/build-gui-Desktop-Debug/gui ...
        22:48:52: Debugging of /home/qtrob/dev/src/creator-squish/tests/manual/debugger/build-gui-Desktop-Debug/gui has finished.
        

      The problem is not that debugging fails but that it fails silently. If you follow the above steps using LC_ALL=C instead of LC_ALL="de_DE.UTF-8", then Creator will show a message box that attaching failed because of ptrace settings. This will allow users to fix the situation. Without that message, users are completely helpless.

      I attached the global debugger from the above steps.

      Attachments

        1. left.log
          0.7 kB
        2. right.log
          18 kB
        For Gerrit Dashboard: QTCREATORBUG-26384
        # Subject Branch Project Status CR V

        Activity

          People

            hjk hjk
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes