Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
None
-
6.0.0
-
None
Description
- Have a Qt 6.0.0 with GCC 8.1.0 on Windows (I haven't tried it on Linux but should work).
- Compile the following program:
#include <QCoreApplication> #include <QSettings> #include <QTimer> int readSettings() { QSettings settings; return settings.value(QStringLiteral("Settings/Temp"), 1).toInt(); } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QCoreApplication::setApplicationName(QStringLiteral("AppName")); QCoreApplication::setOrganizationName(QStringLiteral("OrgName")); QCoreApplication::setOrganizationDomain(QStringLiteral("www.org.org")); QCoreApplication::setApplicationVersion(QStringLiteral("1.0")); volatile int i = readSettings(); QTimer::singleShot(0, &a, &QCoreApplication::quit); return a.exec(); }
QT -= gui CONFIG += c++11 console CONFIG -= app_bundle SOURCES += main.cpp QMAKE_CXXFLAGS += -fstack-protector win32: LIBS += -lssp
- Observe that in readSettings the program crashes. If you remove stack protection by removing the last two lines in the .pro file, the error goes away.
Attachments
Issue Links
- relates to
-
QTBUG-89676 QTableWidgetItem::setText() crashes with -fstack-protector on
- Closed
-
QTBUG-89678 Function crashes as soon as a QVariant is create with -fstack-protector on
- Closed