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

QtPlugIn : a crash bug when call insertWidget on macos 11.4

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.15.10
    • Core: Plugins
    • None
    • macOS

    Description

      every time i run the demo crashTest on macos 11.4 , when i close the window, it will crash . 

      it will crash on macos 11.4 every time and crash sometimes on macos 12.xx or higher version

      do the steps below will reproduce the crash :

      1. unzip CrashTest.zip on you macos
      2. enter crash_build, modify the _build_crashdemo.sh line 14  and line 19

             set the CrashDemo and qmake_path path to your own path

             3. run _buildcrashdemo.sh ,you 'll get a MainApp.app in folder crash_build

             4. zip the MainApp.app to MainApp.app.zip and send it to macos 11.4, unzip it and run MainApp.app(you may need to know How to Install Software from Unsigned Developers on a Mac https://www.wikihow.com/Install-Software-from-Unsigned-Developers-on-a-Mac)

             5. close the app window and you will receive the dump info looks like

      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0   dyld                                  0x0000000106f54545 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 80
      1   libdyld.dylib                         0x00007fff203dfd08 _dyld_fast_stub_entry(void*, long) + 65
      2   libdyld.dylib                         0x00007fff203dfc46 dyld_stub_binder + 282
      3   ???                                   0x000000010b0e0000 0 + 4480434176
      4   org.qt-project.QtCore                 0x0000000107892594 QObjectPrivate::deleteChildren() + 228
      5   org.qt-project.QtWidgets              0x00000001068a81de QWidget::~QWidget() + 1006
      6   libCommon.1.dylib                     0x000000010685dcae SplitterWidget::~SplitterWidget() + 14
      7   org.qt-project.QtCore                 0x0000000107892594 QObjectPrivate::deleteChildren() + 228
      8   org.qt-project.QtWidgets              0x00000001068a81de QWidget::~QWidget() + 1006
      9   org.qt-project.QtWidgets              0x00000001068a8a9e QWidget::~QWidget() + 14
      10  org.qt-project.QtCore                 0x0000000107892594 QObjectPrivate::deleteChildren() + 228
      11  org.qt-project.QtWidgets              0x00000001068a81de QWidget::~QWidget() + 1006
      12  com.yourcompany.MainApp               0x0000000106848ac0 0x106842000 + 27328
      13  org.qt-project.QtCore                 0x0000000107892594 QObjectPrivate::deleteChildren() + 228
      14  org.qt-project.QtWidgets              0x00000001068a81de QWidget::~QWidget() + 1006
      15  com.yourcompany.MainApp               0x000000010684862e 0x106842000 + 26158
      16  org.qt-project.QtCore                 0x0000000107892594 QObjectPrivate::deleteChildren() + 228
      17  org.qt-project.QtWidgets              0x00000001068a81de QWidget::~QWidget() + 1006
      18  com.yourcompany.MainApp               0x00000001068463c2 main + 146
      19  libdyld.dylib                         0x00007fff203e0f5d start + 1

      if comment the code 

       m_mainLayout->insertWidget(index,widget,1);

      the application will not crash when close the window

      void SlicerPlugIn::initialize(ControlInterface *controlmanager)
      {
          //SlicePanel * panel = new SlicePanel();
          MyWidget * panel = new MyWidget();
      
          controlmanager->addWidgetToRightSettings(EFdmRightWidgetIndex::Idx_SlicePanel, panel);
      }
      void ControlManager::addWidgetToRightSettings(EFdmRightWidgetIndex index, QWidget *widget)
      {
          if(!m_splitter || !widget) {
              return;
          }
          if(!m_rightWidget) {
              m_rightWidget = new SplitterWidget();
              m_rightWidget->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
              m_splitter->addWidget(m_rightWidget);
      
            //  qDebug() << " parent =====" << m_rightWidget->parentWidget();
              //qDebug() << " parent =====" << m_rightWidget->parentWidget();
          }
          m_rightWidget->addWidget(index,widget); 
      }
      void SplitterWidget::addWidget(EFdmRightWidgetIndex index, QWidget *widget)
      {
          m_mainLayout->insertWidget(index,widget,1); // if comment this line, the app will not crash when the window be closed.
      }
      

      Attachments

        1. codeSummary.jpg
          10 kB
          qt dev6
        2. macosInfo.jpg
          195 kB
          qt dev6
        3. dumpInfo.txt
          72 kB
          qt dev6
        4. CrashTest.zip
          36 kB
          qt dev6
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            qt-dev6 qt dev6
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes