Bug 435329 - Show Popup Palette crashes Krita when QT_SCALE_FACTOR is not an integer
Summary: Show Popup Palette crashes Krita when QT_SCALE_FACTOR is not an integer
Status: RESOLVED DUPLICATE of bug 431944
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.4.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-03 23:16 UTC by nagisa
Modified: 2021-04-04 01:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nagisa 2021-04-03 23:16:59 UTC
SUMMARY

Attempting to open a popup palette will crash Krita when the scale factor used is not an integer (e.g. 1 or 2 or 3…)

STEPS TO REPRODUCE
1. env QT_SCALE_FACTOR=1.5 krita
2. create a new file
3. open a popup palette (e.g. via a button on a tablet pen)

OBSERVED RESULT

Krita immediately crashes. The output from krita contains a large number of messages such as 

```
QImage::setPixel: coordinate (208,0) out of range
QImage::setPixel: coordinate (208,1) out of range
QImage::setPixel: coordinate (208,2) out of range
```

and finally a

```
malloc(): invalid size (unsorted)
```

The callstack at the time of crash looks like this:

```
#0  0x00007f1da5fe133a in raise () from /nix/store/90illc73xfs933d06daq6d41njs8yh66-glibc-2.32-37/lib/libc.so.6
#1  0x00007f1da5fcb523 in abort () from /nix/store/90illc73xfs933d06daq6d41njs8yh66-glibc-2.32-37/lib/libc.so.6
#2  0x00007f1da6021958 in __libc_message () from /nix/store/90illc73xfs933d06daq6d41njs8yh66-glibc-2.32-37/lib/libc.so.6
#3  0x00007f1da602912a in malloc_printerr () from /nix/store/90illc73xfs933d06daq6d41njs8yh66-glibc-2.32-37/lib/libc.so.6
#4  0x00007f1da602b17c in _int_free () from /nix/store/90illc73xfs933d06daq6d41njs8yh66-glibc-2.32-37/lib/libc.so.6
#5  0x00007f1da6bcd015 in QImageData::~QImageData() () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Gui.so.5
#6  0x00007f1da6bcd4f8 in QImage::~QImage() () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Gui.so.5
#7  0x00007f1da93edce8 in KoTriangleColorSelector::generateTriangle() () from /nix/store/n2ajwshp19nlwin351d7bmj3lji90db0-krita-4.4.2/lib/libkritawidgets.so.20
#8  0x00007f1da93ee135 in KoTriangleColorSelector::paintEvent(QPaintEvent*) () from /nix/store/n2ajwshp19nlwin351d7bmj3lji90db0-krita-4.4.2/lib/libkritawidgets.so.20
#9  0x00007f1da726d0fe in QWidget::event(QEvent*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#10 0x00007f1da722d16f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#11 0x00007f1daa9570b9 in KisApplication::notify(QObject*, QEvent*) () from /nix/store/n2ajwshp19nlwin351d7bmj3lji90db0-krita-4.4.2/lib/libkritaui.so.20
#12 0x00007f1da676086a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#13 0x00007f1da7265216 in QWidgetPrivate::sendPaintEvent(QRegion const&) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#14 0x00007f1da7265a6b in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#15 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#16 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#17 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#18 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#19 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#20 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#21 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#22 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#23 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#24 0x00007f1da726a185 in QWidgetPrivate::render(QPaintDevice*, QPoint const&, QRegion const&, QFlags<QWidget::RenderFlag>) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#25 0x00007f1da726a684 in QWidget::render(QPainter*, QPoint const&, QRegion const&, QFlags<QWidget::RenderFlag>) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#26 0x00007f1da726aa47 in QWidget::render(QPaintDevice*, QPoint const&, QRegion const&, QFlags<QWidget::RenderFlag>) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#27 0x00007f1da726ac7b in ?? () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#28 0x00007f1da75b8d22 in QGraphicsEffectSource::pixmap(Qt::CoordinateSystem, QPoint*, QGraphicsEffect::PixmapPadMode) const () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#29 0x00007f1da75b8ec9 in QGraphicsEffect::sourcePixmap(Qt::CoordinateSystem, QPoint*, QGraphicsEffect::PixmapPadMode) const () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#30 0x00007f1da75b9514 in QGraphicsOpacityEffect::draw(QPainter*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#31 0x00007f1da72664a7 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#32 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#33 0x00007f1da7266c0a in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#34 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#35 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#36 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#37 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#38 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#39 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#40 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#41 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#42 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#43 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#44 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#45 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#46 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#47 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#48 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#49 0x00007f1da7266de3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#50 0x00007f1da726577c in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) ()
   from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#51 0x00007f1da723d868 in ?? () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#52 0x00007f1da726d82f in QWidget::event(QEvent*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#53 0x00007f1da8ce1389 in KXmlGuiWindow::event(QEvent*) () from /nix/store/n2ajwshp19nlwin351d7bmj3lji90db0-krita-4.4.2/lib/libkritawidgetutils.so.20
#54 0x00007f1da722d16f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Widgets.so.5
#55 0x00007f1daa9570b9 in KisApplication::notify(QObject*, QEvent*) () from /nix/store/n2ajwshp19nlwin351d7bmj3lji90db0-krita-4.4.2/lib/libkritaui.so.20
#56 0x00007f1da676086a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#57 0x00007f1da6763371 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#58 0x00007f1da67b8c33 in ?? () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#59 0x00007f1da59d6a9b in g_main_context_dispatch () from /nix/store/m3cq4pw45jg4ja7slq9rzybs5chvi2nh-glib-2.66.4/lib/libglib-2.0.so.0
#60 0x00007f1da59d6d48 in g_main_context_iterate.constprop () from /nix/store/m3cq4pw45jg4ja7slq9rzybs5chvi2nh-glib-2.66.4/lib/libglib-2.0.so.0
#61 0x00007f1da59d6dff in g_main_context_iteration () from /nix/store/m3cq4pw45jg4ja7slq9rzybs5chvi2nh-glib-2.66.4/lib/libglib-2.0.so.0
#62 0x00007f1da67b829f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#63 0x00007f1da675f1bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#64 0x00007f1da67677b0 in QCoreApplication::exec() () from /nix/store/fhv05aqnfmbg0mjf7dp29yaxg3sgzgq3-qtbase-5.15.2/lib/libQt5Core.so.5
#65 0x0000000000407739 in main ()
```

EXPECTED RESULT

A popup palette shows up, krita continues running.

SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
Linux/KDE Plasma: Nix OS, sway, 
(available in About System)
KDE Plasma Version: N/A
KDE Frameworks Version: N/A
Qt Version: 5.15.2

ADDITIONAL INFORMATION

x86_64
Comment 1 Tiar 2021-04-04 01:41:59 UTC

*** This bug has been marked as a duplicate of bug 431944 ***