ssbssa / heob

Detects buffer overruns and memory leaks.
Boost Software License 1.0
155 stars 25 forks source link

Application stopped unexpectedly (Qt 5.12.4) #19

Closed IOTeule closed 4 years ago

IOTeule commented 4 years ago

Hi,

I have a crash with heob64.exe , when using Qt.

My heob (69f9c7dc) did stop working after about 6 month with Application stopped unexpectedly after working with it successfully for half a year.

There was no change in heob64.exe, Qt Creator or Qt.

I tried recompile with master (master commit f991cde7), but same error . heob being build with MSVC2015_64Bit.

To ensure it is not depending on my actual project, I created new projekt fom template, see attached.

The project is a new Qt Console Program generated with Qt Creator (4.10.0) from revision 9b7bab7d35 Compiler:MSVC2015_64Bit OS:Win 10 Enterprise LTSC Qt:5.12.4 project incl. leacks.xml:heobtest1.zip

ssbssa commented 4 years ago

How are you supposed to stop this test program? Because I can only do it with ctrl-c, or by closing the console window directly, and both of these methods are not handled by heob.

The needs to be some kind of clean exit, either with exit()/ExitProcess(), or on Qt side with quit().

IOTeule commented 4 years ago

I don't understand the problem, this is exactly the way it did work for past 6 month ... Qt Creator -> Analyze -> heob -> Change settings -> OK If this is NOT the recommended way, could you please provide a simple main.cpp, how it should look like using Qt Creator ?

ssbssa commented 4 years ago

That's how you start the application, yes. But how do you exit it?

IOTeule commented 4 years ago

Finally got the point to avoid chrash in heobtest1, running like below works:

#include <QCoreApplication>
#include <QTimer>
int main(int argc, char *argv[]) {
    QCoreApplication a(argc, argv);
    QTimer::singleShot(1000, &a.quit);  //Or some other class signal
    return a.exec();
}

In my main project, which I can't share, it still chrashes (using a workerthread calling the quit() ). I will try to create minimum project to reenact.

IOTeule commented 4 years ago

Fixed it, problem was program exit being called in Thread, now quit() moved to main.cpp

QObject::connect(Thread, &Server::finished, qApp, &myApp::quit);
Server.start();

Thx for your support