[Solved] SIGSEGV -> Segmentation fault --- Error in Custom Framework (with GDB Screenshot and Results)
-
Hi and welcome to devnet,
Please re-run your program in debug mode, you'll have more information about what triggers the crash. One thing that I see that might be doing this is that you don't verify that list of certificate is not empty.
Hope it helps
-
Sorry, i have no idea what is really needed, my Windows Version works fine
http://www.keppe.org/gdboutput.html <- the contains is to long for a Post
-
You are still running your program in release mode, change that. Have a look at the computer icon just above the green arrow, click on it change release to debug. Then start again using the debugger
-
I have made a screenshot, it's more needed?
-
i have made the Object KMsgFw11Q *fw;
fw = new KMsgFw11Q(this);Now have that
!http://www.keppe.org/img/debugmode2.png(Screenshot)!
Windows Debugger say me: QWidget: Must construct a QApplication before a QPaintDevice...
-
Can you show your main.cpp ?
-
@#include <QApplication>
#ifdef WIN32
#include <QUrl>
#include <QTimer>
#include <QProcess>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#endif
#include <QStyleFactory>
#include <QMessageBox>
#include <QSettings>
#include <QFileInfo>
#include <QWidget>
#include <QStyle>
#include <QDir>
#include "frmLogin.h"
#include "frmUpdate.h"
#include "UpdateThread.h"int main(int argc, char *argv[])
{
QApplication a(argc, argv);#ifdef Q_WS_WIN64
a.setApplicationName("Keppe Messenger (64bit)");
#else
a.setApplicationName("Keppe Messenger");
#endif
a.setApplicationVersion("1.0.0-19");bool noupdate = false; bool regupdate = false; bool minimized = false; bool resetstyle = false; foreach (const QString& argument, a.arguments()) { if (argument == "--noupdate" || argument.left(11) == "--noupdate=") { noupdate = true; } if (argument == "--regupdate" || argument.left(12) == "--regupdate=") { regupdate = true; } if (argument == "--minimized" || argument.left(12) == "--minimized=") { minimized = true; } if (argument == "--resetstyle" || argument.left(13) == "--resetstyle=") { resetstyle = true; } }
#ifdef SHARED
QDir pluginsDir = QFileInfo(a.applicationFilePath()).absoluteDir();
QDir::setCurrent(pluginsDir.path());
pluginsDir.cd("plugins");
a.addLibraryPath(pluginsDir.path());
pluginsDir.cd("styles");
a.addLibraryPath(pluginsDir.path());#ifdef WIN32
if (regupdate)
{
QString applicationID;
#ifdef QT5
applicationID = "{490D16AC-E002-40EA-A563-94B5AC5B5D21}";
#else
#ifdef WIN64
applicationID = "{6932EC7F-0EB0-4C59-A93C-4D266B8D26DC}";
#elif defined(MSVC)
applicationID = "";
#else
applicationID = "{EE2292A2-0CCC-492F-BB0E-F104F972DC1B}";
#endif
#endif
QSettings regNormal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+applicationID+"_is1",QSettings::NativeFormat);
if (regNormal.contains("DisplayName"))
{
regNormal.setValue("DisplayName",a.applicationName() + " " + a.applicationVersion());
}
if (regNormal.contains("DisplayVersion"))
{
regNormal.setValue("DisplayVersion",a.applicationVersion());
}
QSettings reg6432Node("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"+applicationID+"_is1",QSettings::NativeFormat);
if (reg6432Node.contains("DisplayName"))
{
reg6432Node.setValue("DisplayName",a.applicationName() + " " + a.applicationVersion());
}
if (reg6432Node.contains("DisplayVersion"))
{
reg6432Node.setValue("DisplayVersion",a.applicationVersion());
}
}
#else
Q_UNUSED(noupdate);
Q_UNUSED(regupdate);
#endifif (resetstyle) { QSettings settings("Keppe","Keppe Messenger"); settings.beginGroup("Style"); settings.setValue("Custom", false); settings.setValue("showBug", true); settings.endGroup(); } QString versionType;
#ifdef QT5
versionType = "32qt5";
#else
#ifdef WIN64
versionType = "64qt4";
#elif defined(MSVC)
versionType = "vcqt4";
#else
versionType = "32qt4";
#endif
#endif#ifdef WIN32
if (!noupdate) { bool updateAvailable = false; QString newVersion; QNetworkAccessManager *http = new QNetworkAccessManager(); QNetworkReply *treply = http->get(QNetworkRequest(QUrl("http://msg.keppe.org/update/stable" + versionType))); QEventLoop loop; QTimer::singleShot(5000, &loop, SLOT(quit())); QObject::connect(treply, SIGNAL(finished()), &loop, SLOT(quit())); loop.exec(); newVersion = QString::fromUtf8(treply->readAll()); newVersion = newVersion.remove("\n"); newVersion = newVersion.remove("\r"); newVersion = newVersion.trimmed(); if (a.applicationVersion() != newVersion && newVersion != "") {updateAvailable = true;} if (updateAvailable) { QStringList args; args.append("/C"); args.append("KeppeScriptUpdater.exe --path=network --script=http://msg.keppe.org/update/" + versionType + "_" + newVersion + ".lua --version=" + a.applicationVersion()); QProcess *process = new QProcess(); process->startDetached("cmd",args); return 0; } }
#endif
#endifQSettings settings("Keppe","Keppe Messenger"); settings.beginGroup("Style"); bool loadCustom = settings.value("Custom",false).toBool(); if (loadCustom) { QString style = settings.value("Name","System-defined").toString(); if (style != "System-defined") { if (style.trimmed() != "") { a.setStyle(style); } } } settings.endGroup();
#ifdef WIN32
settings.beginGroup("Update");
bool updateNotificationEnabled = settings.value("UpdateNotification",true).toBool();if (updateNotificationEnabled) { frmUpdate *uw = new frmUpdate(); uw->setVersionType(versionType); UpdateThread *ut = new UpdateThread(versionType, a.applicationVersion()); ut->start(); QObject::connect(ut,SIGNAL(setNewVersion(QString)),uw,SLOT(setNewVersion(QString))); QObject::connect(ut,SIGNAL(updateIsNowAvailable()),uw,SLOT(show())); QObject::connect(uw,SIGNAL(disableUpdateNotification()),ut,SLOT(disableUpdateNotification())); } settings.endGroup();
#endif
frmLogin w; if (minimized) {goto minimized;} w.show(); goto appexec;
minimized:
w.showMinimized();appexec:
return a.exec();
}
@ -
No need for goto
@
if (minimized) {
w.showMinimized();
} else {
w.show();
}
return a.exec();
}
@I also don't see anything really suspicious. Since you are using K in some of your classes are you using KDE's framework ? Or is it just because of the name of your software ?
-
I have build my own K Class'es for (K)eppe (I know has KDE have K)
I have a Bug with the Visual Studio 2010 Compiler, i have fixed it with Q_DECL_EXPORT and Q_DECL_IMPORT, i testing that on Linux if i have results i edit my post.Edit:
No, Q_DECL_EXPORT and Q_DECL_IMPORT is not the Problem on LinuxSecond Edit:
i have resolved this Problem, my KGuiFw used a function is only enabled on Windows, i have used now #ifdef WIN32 to resolve it -
Nice you found out !
You should rather use
@#ifdef Q_OS_WIN@
It will be valid for the various version of windows you might encounter
Since it's working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)