Bug 402686

Summary: Crash when creating new file
Product: [Applications] krita Reporter: azrul <ahloiscreamo>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: crash CC: halla
Priority: NOR    
Version First Reported In: 4.1.7   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description azrul 2018-12-29 19:28:45 UTC
Crash on creating new file


STEPS TO REPRODUCE
Open new file, create, crash

Terminal output

~
❯ krita
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Regular")
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Bold")
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Regular")
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Regular")
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Regular")
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Light")
krita.general: Could not find font QVariant(QString, "Source Sans Pro") with style QVariant(QString, "Regular")
Shortcut for action  "reset_canvas_rotation" "Reset Canvas Rotation" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/preset-switcher
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/opacity-decrease
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/opacity-increase
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/lightness-increase
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/lightness-decrease
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/zoom-in
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/rotate-canvas-left
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/rotation-reset
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/rotate-canvas-right
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/zoom-out
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/brushsize-decrease
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/brushsize-increase
file:///usr/lib64/qt5/qml/org/krita/sketch/components/Button.qml:84:9: QML Image: Failed to get image from provider: image://icon/edit-clear
krita.lib.flake: "InteractionTool" : action "object_order_raise" conflicts with canvas action "rotate_canvas_right" shortcut: "Ctrl+]"
krita.lib.flake: "InteractionTool" : action "object_order_raise" conflicts with canvas action "rotate_canvas_right" shortcut: "Ctrl+]"
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
free(): double free detected in tcache 2
[1]    15509 abort (core dumped)  krita

~ 14s
❯ 


SOFTWARE/OS VERSIONS


Linux/KDE Plasma: Fedora 29
i3-gaps wm
qt 5.11.3
krita 4.17.101    

ADDITIONAL INFORMATION
Just happen today on new fedora repository update (qt and krita package update)
Comment 1 Halla Rempt 2018-12-29 20:53:47 UTC
This crash cannot happen with that combination of Qt and Krita. There must be something wrong with the tarball the fedora package uses or something like that. The 4.1.7.101 tarball explicitly works around a dumb bug in Qt 5.11.3 and 5.12 that causes a double deletion. We have a workaround, it is in 4.1.7.101.

// See https://bugreports.qt.io/browse/QTBUG-72488    
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 3)
    if ((event->type() == QEvent::MouseMove ||
         event->type() == QEvent::TabletMove) &&
            (!d->matcher.supportsHiResInputEvents() ||
             d->testingCompressBrushEvents)) {

        d->compressedMoveEvent.reset(new Event(*event));
        d->moveEventCompressor.start();

        /**
         * On Linux Qt eats the rest of unneeded events if we
         * ignore the first of the chunk of tablet events. So
         * generally we should never activate this feature. Only
         * for testing purposes!
         */
        if (d->testingAcceptCompressedTabletEvents) {
            event->setAccepted(true);
        }

        retval = true;
    } else {
#endif
        slotCompressedMoveEvent();
        retval = d->handleCompressedTabletEvent(event);
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 3)
    }
#endif