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

Segmentation fault on exit caused by virtual keyboard

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.15.2
    • Fix Version/s: 5.15.8, 6.2.0 Beta4
    • Component/s: Virtual Keyboard
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      5688e580b5becdb96bc83aaa13a13341ec2a86e7 (qt/qtvirtualkeyboard/6.2.0) a7f8a81d71 (qt/tqtc-qtvirtualkeyboard/5.15.8)

      Description

      I get consistent segfault crashes upon exiting my app under specific circumstances.

      While specific actions required to trigger it are still in the process of testing, I can already say for sure that it has something to do with the Qt Virtual Keyboard, focus management, and maybe a QtQuick Window's overlay.

      Basically, I have two instances of a virtual keyboard input panel on two pages which replace each other (login & password), and after showing modal overlay on a second page (click Login after entering a password), closing the modal, and returning focus to the password text field, the app end up in a state when closing it via Alt+F4, Ctrl+C or any other means consistently leads to a segmentation fault. Going back up the stack view, or entering correct password and thus unloading the page by replacing it resets this buggy state to normal, i.e. application can be closed normally.

      Here are the "last words" of my app with all the logging enabled via QT_LOGGING_RULES="*=true":

      qt.scenegraph.renderloop: update from item ApplicationWindow_QMLTYPE_16(0x55e7313a6500, visibility=QWindow::Hidden, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowStaysOnTopHint), geometry=0,0 768x1016)
      qt.scenegraph.renderloop: - on render thread
      qt.scenegraph.renderloop: update from item ApplicationWindow_QMLTYPE_16(0x55e7313a6500, visibility=QWindow::Hidden, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowStaysOnTopHint), geometry=0,0 768x1016)
      qt.scenegraph.renderloop: - on render thread
      qt.scenegraph.renderloop: update from item ApplicationWindow_QMLTYPE_16(0x55e7313a6500, visibility=QWindow::Hidden, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowStaysOnTopHint), geometry=0,0 768x1016)
      qt.scenegraph.renderloop: - on render thread
      qt.scenegraph.renderloop:                     (RT) - invalidating scene graph
      qt.scenegraph.renderloop:                     (RT) - invalidated OpenGL
      qt.scenegraph.renderloop:                     (RT) --- done processEventsAndWaitForMore()
      qt.scenegraph.renderloop:                     (RT) run() completed
      qt.scenegraph.renderloop:  - waiting for render thread to exit ApplicationWindow_QMLTYPE_16(0x55e7313a6500, visibility=QWindow::Hidden, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowStaysOnTopHint), geometry=0,0 768x1016)
      qt.scenegraph.renderloop:  - render thread finished ApplicationWindow_QMLTYPE_16(0x55e7313a6500, visibility=QWindow::Hidden, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowStaysOnTopHint), geometry=0,0 768x1016)
      qt.scenegraph.renderloop: done windowDestroyed() ApplicationWindow_QMLTYPE_16(0x55e7313a6500, visibility=QWindow::Hidden, flags=QFlags<Qt::WindowType>(Window|FramelessWindowHint|WindowStaysOnTopHint), geometry=0,0 768x1016)
      qt.quick.focus: QQuickWindowPrivate::clearFocusInScope():
      qt.quick.focus:     scope: QQuickItem(0x55e7313ca350)
      qt.quick.focus:     item: QQuickContentItem(0x55e731814080, name = "ApplicationWindow")
      qt.quick.focus:     activeFocusItem: QQuickTextInput(0x55e731edee10)
      qt.virtualkeyboard: PlatformInputContext::commit()
      qt.virtualkeyboard: QVirtualKeyboardInputContext::commit()
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QQuickItem(0x55e7313ca350)
      [1]    26756 segmentation fault (core dumped)  QT_LOGGING_RULES="*=true" ./app
      

      I checked the output of InputPanel's Component.onCompleted and Component.onDestruction loggers, and it seems like the mere existence of two keyboards at the same time is not an issue here. Actually, never mind. I checked with only password page, and it still crashes even with a single keyboard.

      I am concerned, because segfaults should never happen (obviously), but also because they may lead to (and often caused by) undefined behaviour which — who knows — may lead to a data loss or worse.

      Will check on Windows and update the issue if required.

        Attachments

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

          Activity

            People

            Assignee:
            jakoivik Jarkko Koivikko
            Reporter:
            ratijas ivan tkachenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes