LukasM94 / rc_car

0 stars 0 forks source link

QThread segfault #9

Open LukasM94 opened 4 years ago

LukasM94 commented 4 years ago

gdb output:

Thread 4 "main" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff2c67700 (LWP 836659)] 0x00007ffff72a594c in QPixmap::devicePixelRatio() const () from /usr/lib/libQt5Gui.so.5 (gdb) backtrace

0 0x00007ffff72a594c in QPixmap::devicePixelRatio() const () from /usr/lib/libQt5Gui.so.5

1 0x00007ffff74e525b in QPainter::drawPixmap(QRectF const&, QPixmap const&, QRectF const&) () from /usr/lib/libQt5Gui.so.5

2 0x00007ffff79691fe in QStyle::drawItemPixmap(QPainter*, QRect const&, int, QPixmap const&) const () from /usr/lib/libQt5Widgets.so.5

3 0x00007ffff7a384cc in QLabel::paintEvent(QPaintEvent*) () from /usr/lib/libQt5Widgets.so.5

4 0x00007ffff79372ee in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5

5 0x00007ffff79e8ecf in QFrame::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5

6 0x00007ffff78f3362 in QApplicationPrivate::notify_helper(QObject, QEvent) () from /usr/lib/libQt5Widgets.so.5

7 0x00007ffff78fc839 in QApplication::notify(QObject, QEvent) () from /usr/lib/libQt5Widgets.so.5

8 0x00007ffff6e5aac2 in QCoreApplication::notifyInternal2(QObject, QEvent) () from /usr/lib/libQt5Core.so.5

9 0x00007ffff792f5b8 in QWidgetPrivate::sendPaintEvent(QRegion const&) () from /usr/lib/libQt5Widgets.so.5

10 0x00007ffff792fe1c in QWidgetPrivate::drawWidget(QPaintDevice, QRegion const&, QPoint const&, QFlags, QPainter, QWidgetRepaintManager*) () from /usr/lib/libQt5Widgets.so.5

11 0x00007ffff7931298 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, Flags, QPainter, QWidgetRepaintManager) () from /usr/lib/libQt5Widgets.so.5

12 0x00007ffff792fb2d in QWidgetPrivate::drawWidget(QPaintDevice, QRegion const&, QPoint const&, QFlags, QPainter, QWidgetRepaintManager*) () from /usr/lib/libQt5Widgets.so.5

13 0x00007ffff7931298 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice, QList<QObject> const&, int, QRegion const&, QPoint const&, Flags, QPainter, QWidgetRepaintManager) () from /usr/lib/libQt5Widgets.so.5

14 0x00007ffff792fb2d in QWidgetPrivate::drawWidget(QPaintDevice, QRegion const&, QPoint const&, QFlags, QPainter, QWidgetRepaintManager*) () from /usr/lib/libQt5Widgets.so.5

15 0x00007ffff79065b9 in ?? () from /usr/lib/libQt5Widgets.so.5

16 0x00007ffff7906ff4 in ?? () from /usr/lib/libQt5Widgets.so.5

17 0x00007ffff7930d27 in QWidgetPrivate::syncBackingStore() () from /usr/lib/libQt5Widgets.so.5

18 0x00007ffff7937d14 in QWidget::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5

19 0x00007ffff7a514f5 in QMainWindow::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5

20 0x00007ffff78f3362 in QApplicationPrivate::notify_helper(QObject, QEvent) () from /usr/lib/libQt5Widgets.so.5

21 0x00007ffff78fc839 in QApplication::notify(QObject, QEvent) () from /usr/lib/libQt5Widgets.so.5

22 0x00007ffff6e5aac2 in QCoreApplication::notifyInternal2(QObject, QEvent) () from /usr/lib/libQt5Core.so.5

23 0x00007ffff6e5d326 in QCoreApplicationPrivate::sendPostedEvents(QObject, int, QThreadData) () from /usr/lib/libQt5Core.so.5

--Type for more, q to quit, c to continue without paging--c

24 0x00007ffff6eb3814 in ?? () from /usr/lib/libQt5Core.so.5

25 0x00007ffff5d029be in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0

26 0x00007ffff5d04831 in ?? () from /usr/lib/libglib-2.0.so.0

27 0x00007ffff5d04871 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0

28 0x00007ffff6eb2e60 in QEventDispatcherGlib::processEvents(QFlags) () from /usr/lib/libQt5Core.so.5

29 0x00007ffff6e5962c in QEventLoop::exec(QFlags) () from /usr/lib/libQt5Core.so.5

30 0x00007ffff6e61636 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5

31 0x00007ffff7f79343 in Graphics::run (this=0x555555577070) at /home/lukas/Documents/projects/rc_car/server/graphics/src/Graphics.cpp:30

32 0x00007ffff7fa8357 in WorkingThread::runWrapper (arg=0x555555577070) at /home/lukas/Documents/projects/rc_car/shared/Thread/src/WorkingThread.cpp:26

33 0x00007ffff685346f in start_thread () from /usr/lib/libpthread.so.0

34 0x00007ffff67813d3 in clone () from /usr/lib/libc.so.6`

LukasM94 commented 4 years ago

Has maybe something to do with the fact, that I combine pthread and qthread. I may change gui stuff with a thread which got created with pthread. Maybe this is the bug.

LukasM94 commented 4 years ago

To really fix this bug, there are some solutions which I do not want to implement:

LukasM94 commented 4 years ago

cd25def7bf1dc028477d10c09f9fb2abe7fda9ea added lock to the ui, because more threads access those :-D. Maybe this was the issue

LukasM94 commented 4 years ago

4c327ec7c24c7a4ab5247dc7ada3b6e823425cd0 changed the StatusDisplay and the VideoDisplay from inheritance WorkingThread to QThread. Need to do long time testing