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

QTableWidgetItem::setText() crashes with -fstack-protector on

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1: Critical P1: Critical
    • None
    • 6.0.0
    • None
    • Windows

      1. Have a Qt 6.0.0 with GCC 8.1.0 on Windows (should also work on Linux). This is a 6.0.0 regression, with Qt 5.15 it works fine.
      2. Compile the following program:
      #include <QApplication>
      #include <QTableWidgetItem>
      #include <QTimer>
      
      void setText() {
          QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem();
          __qtablewidgetitem->setText("Text");
      }
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          setText();
      
          QTimer::singleShot(0, &a, &QCoreApplication::quit);
          return a.exec();
      }
      
      QT += core gui widgets
      CONFIG += c++11
      SOURCES += main.cpp
      QMAKE_CXXFLAGS += -fstack-protector
      win32: LIBS += -lssp
      
      1. In setText() the program crashes. If you remove stack protection by removing the last two lines in the .pro file, the error goes away.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            szotsaki Szőts Ákos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes