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

[REG 6.8 -> 6.9] Crash when QGuiApplication is static

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.9.0 Beta1
    • GUI: Other
    • Ubuntu 22.04 LTS

    Description

      Run a simple program using a static QGuiApplication:

      #include <QGuiApplication>
      
      int main(int argc, char *argv[])
      {
          static QGuiApplication a(argc, argv);
          return 0;
      }
      

      It will crash:

      1 QGuiApplication::~QGuiApplication qguiapplication.cpp    673 0x7ffff70af35f 
      2 __run_exit_handlers               exit.c                 113 0x7ffff5845495 
      3 __GI_exit                         exit.c                 143 0x7ffff5845610 
      4 __libc_start_call_main            libc_start_call_main.h 74  0x7ffff5829d97 
      5 __libc_start_main_impl            libc-start.c           392 0x7ffff5829e40 
      6 _start                                                       0x5555555550c5 
      

      UBSAN further reports:

      /home/qtrob/dev/src/qt-dev_12.09-base_imageformats_svg/qtbase/src/gui/kernel/qguiapplication.cpp:673:25: runtime error: member call on address 0x58789bfc5d50 which does not point to an object of type 'QAbstractEventDispatcher'
      0x58789bfc5d50: note: object has invalid vptr
       00 00 00 00  85 38 70 1c 7d 58 00 00  a5 d9 c1 65 59 08 24 3f  00 00 00 00 00 00 00 00  61 00 00 00
                    ^~~~~~~~~~~~~~~~~~~~~~~
                    invalid vptr
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/qtrob/dev/src/qt-dev_12.09-base_imageformats_svg/qtbase/src/gui/kernel/qguiapplication.cpp:673:25 in 
      UndefinedBehaviorSanitizer:DEADLYSIGNAL
      ==133604==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x587d1c70393d (pc 0x58789659862a bp 0x7ffda2ef89f0 sp 0x7ffda2ef8980 T133604)
      ==133604==The signal is caused by a READ memory access.
      

      This was found by oss-fuzz as issue 378014605.

      Attachments

        For Gerrit Dashboard: QTBUG-132381
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change