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

Function crashes as soon as a QVariant is create with -fstack-protector on

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • 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 <QCoreApplication>
      #include <QTimer>
      #include <QVariant>
      
      void setCursor() {
          QVariant(1);
      }
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          setCursor();
      
          QTimer::singleShot(0, &a, &QCoreApplication::quit);
          return a.exec();
      }
      
      QT += core
      SOURCES += main.cpp
      QMAKE_CXXFLAGS += -fstack-protector
      win32: LIBS += -lssp
      
      1. In setCursor() 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.

            thiago Thiago Macieira
            szotsaki Szőts Ákos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes