Access violation when using QT objects in my program

1

I want to integrate QT into an existing desktop C++ project. The requirements were that QT should be statically built with MSVC2013 64bit and with /MT flag set for compiler, so I built QT5.5.0 from sources.

The integration worked as expected, I managed to test some of Qt's object(QFile, QObject) from QtCore.lib. The application seems to run without any problems, without crashing. However, the program exists with -1073741819 error level. I attached the debugger and tried to catch the exception in Visual Studio and I got the following:

First-chance exception at 0x00007FFAC6E4E1A2 in silversim.exe: 0xC0000005: Access violation executing location 0x00007FFAC6E4E1A2.
Unhandled exception at 0x00007FFAC6E4E1A2 in silversim.exe: 0xC0000005: Access violation executing location 0x00007FFAC6E4E1A2.

I undo the code integration until I had just a simple QObject object; declaration inside a function. With this simple declaration the program exists with error, without any use of Qt objects the program exists normally.

What is happening here? Might be the static link to Qt? Maybe a bug in the Qt5.5 versions? Or something else from my program trying to deal qt .libs somehow during cleanup?

UPDATE

Thanks to IDA decompiler I managed to find out where the crash happens but still I don't know why. It crashes in void __fastcall qt_watch_adopted_thread(HANDLE hObject, struct QThread *). As I noticed, Qt creates some threads which are not destroyed when the program exits, and those threads try to access invalid memory. Maybe it is related with this opened qt bug: https://bugreports.qt.io/browse/QTBUG-40247 but in my case I'm not loading any plugin.

c++
qt
dll
static-libraries
msvc12
asked on Stack Overflow Jul 18, 2019 by Ispas Claudiu • edited Jul 18, 2019 by Ispas Claudiu

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0