MainWindow show crashed after import some static-lib in the same project.
- KeithMaybe last edited by KeithMaybe
Here's the problem. I created a project include some subdirs to generate static-libs and an application. After all subdirs finished, I wrote a test program to check static-libs, and it works well. But After added some UI code, it crashed at show(), I got Sementation Fault from the os. Even I didn't use any funtion from these static-libs, if I delete show(), it worked well again.
I use gdb to run the application, it tells "reveived signal SIGSEGV, Segmentation fault. 0x00007f07b096bb81 in ??() from /usr/lib/x86_64-linux-gnu/libLLVM-9.so.1"
I remote to server and display by X11.
Here's the code.();; }
main.cpp
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
All these code create by default. I changed nothing
I found a bug report:QTBUG-48875, but I it did'n work for me.
OS: Ubuntu 20.04
Qt: 5.12.8
GCC: 9.3
Qt Creator: 4.11
Hi - I tried your program under Windows 10, and it runs fine.
I realize this doesn't answer your question, but have you considered updating your Qt library?
- KeithMaybe last edited by
Hi @mzimmers , Thanks for your test.
I have no license to update Qt library, because other guys of the company is also using the same development environment.
I just set static-lib path in .pro file and it run crashed. I have no idea to find the reason.
- jsulm Lifetime Qt Champion last edited by
@KeithMaybe Did you try to run it through debugger and check the stack trace?
- KeithMaybe last edited by
Thanks @jsulm .
I did. I found the reason finally. Some guys operator new/delete to replace defualt new/delete, when I created an object it crashed!
My problem solved.
- jsulm Lifetime Qt Champion last edited by
@KeithMaybe Please mark thread as solved