Article 6NV3C OpenCV on Slackware 64 current seems to have some troubles with Qt6 (pixmap segfaults in OpenToonz)

OpenCV on Slackware 64 current seems to have some troubles with Qt6 (pixmap segfaults in OpenToonz)

by
MooseCaboose
from LinuxQuestions.org on (#6NV3C)
Hello, after much rigamaroleous testing, which included changed nvidia driver versions about six times, a really puzzling (to my skill level) segfault kept occurring for OpenToonz, the git version.

It kept dying at a very specific custom QTabBar implementation while accessing qpixmaps, and even roling back to previously working commits (I was on the latest) it still kept happening.

I did figure that it was qt6 cause that's relatively new and I have only very recently updated my current to the snapshot that had it in it.

So I wholesale removed Qt6.
Then I recompiled OT.
Then that complained that OpenCV wasn't finding its library bindings.

So I rebuilt OpenCV against Qt5 only locally.
Then I recompiled OT, and it worked perfectly again.

Then I reinstalled Qt6, completely cleaned all OT build dirs and recompiled it.
Still works just fine now.

So, either Qt6 is wonky, or OpenCV is wonky (but only when including Qt6)

Here is an example segfault from OT from when it was faulty.

Code:
=== Backtrace ====
1> /usr/lib64/libQt5Gui.so.5(_ZNK7QPixmap6isNullEv+0xe) [0x7f97451b990e]
2> /home/bleep/coding/cpp/opentoonz/toonz/build/lib/opentoonz/libtoonzqt.so(_ZN5DVGui6TabBar10paintEventEP11QPaintEvent+0xe7) [0x7f97447bf927]
3> /usr/lib64/libQt5Widgets.so.5(_ZN7QWidget5eventEP6QEvent+0x238) [0x7f97458e8998]
4> /usr/lib64/libQt5Widgets.so.5(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x7e) [0x7f97458aa06e]
5> /usr/lib64/libQt5Core.so.5(_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent+0x108) [0x7f9744d40868]
6> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate14sendPaintEventERK7QRegion+0x25) [0x7f97458e16a5]
7> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x8ab) [0x7f97458e1f8b]
8> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x471) [0x7f97458e3251]
9> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x50a) [0x7f97458e1bea]
10> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x471) [0x7f97458e3251]
11> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
12> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
13> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x50a) [0x7f97458e1bea]
14> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x471) [0x7f97458e3251]
15> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x50a) [0x7f97458e1bea]
16> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x471) [0x7f97458e3251]
17> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
18> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
19> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
20> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
21> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
22> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
23> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
24> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
25> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
26> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
27> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
28> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x2dd) [0x7f97458e30bd]
29> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x50a) [0x7f97458e1bea]
30> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x471) [0x7f97458e3251]
31> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x50a) [0x7f97458e1bea]
32> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x471) [0x7f97458e3251]
33> /usr/lib64/libQt5Widgets.so.5(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPoint6QFlagsINS_14DrawWidgetFlagEEP8QPainterP21QWidgetRepaintManager+0x50a) [0x7f97458e1bea]
34> /usr/lib64/libQt5Widgets.so.5(+0x17faf5) [0x7f97458b9af5]
35> /usr/lib64/libQt5Widgets.so.5(+0x180257) [0x7f97458ba257]
36> /usr/lib64/libQt5Widgets.so.5(+0x1ca6e2) [0x7f97459046e2]
37> /usr/lib64/libQt5Widgets.so.5(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x7e) [0x7f97458aa06e]
38> /usr/lib64/libQt5Core.so.5(_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent+0x108) [0x7f9744d40868]
39> /usr/lib64/libQt5Gui.so.5(_ZN22QGuiApplicationPrivate18processExposeEventEPN29QWindowSystemInterfacePrivate11ExposeEventE+0x87) [0x7f9745138717]
40> /usr/lib64/libQt5Gui.so.5(_ZN22QWindowSystemInterface22sendWindowSystemEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0xac) [0x7f9745109fcc]
41> /usr/lib64/libQt5XcbQpa.so.5(+0x6a68a) [0x7f96b4d3068a]
42> /usr/lib64/libglib-2.0.so.0(+0x593bd) [0x7f974308a3bd]
43> /usr/lib64/libglib-2.0.so.0(+0x5c307) [0x7f974308d307]
44> /usr/lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f974308d8ec]
45> /usr/lib64/libQt5Core.so.5(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x69) [0x7f9744d97339]
46> /usr/lib64/libQt5Core.so.5(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x122) [0x7f9744d3f412]
47> /usr/lib64/libQt5Core.so.5(_ZN16QCoreApplication4execEv+0x80) [0x7f9744d47400]
48> main at ??:?
49> /lib64/libc.so.6(+0x25b77) [0x7f97412ccb77]
50> /lib64/libc.so.6(__libc_start_main+0x87) [0x7f97412ccc37]
51> _start at /tmp/glibc-2.39/csu/../sysdeps/x86_64/start.S:117
==== End ====It always appeared as if pixmaps were ...nonexistent, or something.
Which is weird since I think OT uses openCV only for stop motion? I am not sure at all, though.

Futzing around blindly with OT code (circumventing null checks and the like for the pixmaps) sometimes it would just complain about "recursive draws".

Well, that's my laymans report about that kind of thing.
Maybe it'll serve as some sort of datapoint for...possible future complaints.

Oh, right, I'm also on multilib but I don't think that had any bearing on this.
Edit:
And yes, I know this segfault example lists "Qt5" stuff but... it really did crash with Qt6 and OpenCV that way, and by doing the above steps it then didn't crash anymore...
I think that was the most puzzling part for me.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments