Bug#987886: krita: Right-clicking on the canvas crashes krita

2021-10-04 Thread Nils König
> I tried to reproduce this issue inside a virtual machine.
> But there the menu opens without the issue.

I can reliably reproduce this in Debian Bullseye; it appears like the
environment variable QT_SCALE_FACTOR needs to be set to a non-integer value 
(which is supported!) for the crash to happen. By default I'm using 
QT_SCALE_FACTOR=1.7 and it crashes — it doesn't crash with QT_SCALE_FACTOR=1 
or QT_SCALE_FACTOR=2.

Testing inside a Sid+Experimental chroot, version 5.0.0~beta1+dfsg-1 
from experimental seems not affected.

> Does this happen to you if you startup without the wacom input attached?

It happens with only a keyboard and a mouse as input devices attached.

> Does the KCrash window open or do you have the
> sad smiley at the bottom right near the clock?

It just crashes without any dialog, even with MALLOC_CHECK_=3 and
I'm afraid I don't know which smiley or clock you're referring to.
Before right-clicking and crashing the console log already shows a bunch of 
warnings like these, which might or might not be related to the crash:

  QImage::setPixel: coordinate (132,166) out of range
  QImage::setPixel: coordinate (133,166) out of range
  QImage::setPixel: coordinate (134,166) out of range
  QImage::setPixel: coordinate (135,166) out of range
  QImage::setPixel: coordinate (136,166) out of range

To get more info I ran krita in gdb, with 

  set args --new-image RGBA,U8,1600,1600
  set environment MALLOC_CHECK_ 3
  set environment QT_SCALE_FACTOR 1.7
  run

On right click, gdb first showed the following:

  Thread 1 "krita" received signal SIGABRT, Aborted.
  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
  50  ../sysdeps/unix/sysv/linux/raise.c: file or directory not found

Then I requested the backtrace, whose entirety can be found a few lines below.
I hope this helps in locating and fixing the issue (and backporting the fix to 
Bullseye). If you need any more information or something tested I'd be happy 
to help.

Cheers
Nils König

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x74529537 in __GI_abort () at abort.c:79
#2  0x74582768 in __libc_message (action=action@entry=do_abort, 
fmt=fmt@entry=0x74690e2d "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x74589a5a in malloc_printerr (str=str@entry=0x7468f05a 
"free(): invalid pointer") at malloc.c:5347
#4  0x7458bca6 in free_check (mem=0x7fffbafeb010, caller=) at hooks.c:255
#5  0x74f84e25 in QImageData::~QImageData() () from 
/lib/x86_64-linux-gnu/libQt5Gui.so.5
#6  0x74f85308 in QImage::~QImage() () from 
/lib/x86_64-linux-gnu/libQt5Gui.so.5
#7  0x73db45e8 in KoTriangleColorSelector::generateTriangle() () from 
/lib/x86_64-linux-gnu/libkritawidgets.so.20
#8  0x73db4a35 in KoTriangleColorSelector::paintEvent(QPaintEvent*) () 
from /lib/x86_64-linux-gnu/libkritawidgets.so.20
#9  0x7565ffae in QWidget::event(QEvent*) () from 
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x7562015f in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x770d37c9 in KisApplication::notify(QObject*, QEvent*) () from 
/lib/x86_64-linux-gnu/libkritaui.so.20
#12 0x74b5dfca in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x75658116 in QWidgetPrivate::sendPaintEvent(QRegion const&) () 
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x75658962 in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion 
const&, QPoint const&, QFlags, QPainter*, 
QWidgetRepaintManager*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x75659cb3 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, 
QList const&, int, QRegion const&, QPoint const&, 
QFlags, QPainter*, QWidgetRepaintManager*) () 
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x75659ad2 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, 
QList const&, int, QRegion const&, QPoint const&, 
QFlags, QPainter*, QWidgetRepaintManager*) () 
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x75659ad2 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, 
QList const&, int, QRegion const&, QPoint const&, 
QFlags, QPainter*, QWidgetRepaintManager*) () 
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x75659ad2 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, 
QList const&, int, QRegion const&, QPoint const&, 
QFlags, QPainter*, QWidgetRepaintManager*) () 
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x75659ad2 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, 
QList const&, int, QRegion const&, QPoint const&, 
QFlags, QPainter*, QWidgetRepaintManager*) () 
from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x75659ad2 in QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, 
QList const&, int, QRegion const&, QPoint const&, 
QFlags, QPainter*, 

Bug#987886: krita: Right-clicking on the canvas crashes krita

2021-05-18 Thread Bernhard Übelacker

Hello Torbjørn Birch Moltu,
I tried to reproduce this issue inside a virtual machine.
But there the menu opens without the issue.

Does this happen to you if you startup without the wacom input attached?

Next thing you could try is to startup krita this way:
  export MALLOC_CHECK_=3
  krita --new-image RGBA,U8,1600,1600

Does the KCrash window open or do you have the
sad smiley at the bottom right near the clock?

Kind regards,
Bernhard



Bug#987886: krita: Right-clicking on the canvas crashes krita

2021-05-01 Thread Torbjørn Birch Moltu
Package: krita
Version: 1:4.4.2+dfsg-1
Severity: important
X-Debbugs-Cc: t.b.mo...@lyse.net

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
 Started krita from the application launcher and created a new file.
   * What exactly did you do (or not do) that was effective (or
 ineffective)?
 Right-clicked on the canvas.
 (Pressing the top button (button 3) on a wacom intuos BT M also crashes 
it) 
   * What was the outcome of this action?
 Krita closed unexpectedly without saving or asking to save.
 When I started it from the terminal (`krita --new-image RGBA,U8,1600,1600`)
 stderr contains this line:
 krita: malloc.c:2379: sysmalloc: Assertion `(old_top == initial_top (av)  
&& old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse 
(old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
 Deleting .config/kritarc and .config/kritadisplayrc does not fix it.
   * What outcome did you expect instead?
 A quick-menu to appear.

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing'), (200, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-6-amd64 (SMP w/6 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages krita depends on:
ii  krita-data1:4.4.2+dfsg-1
ii  libc6 2.31-11
ii  libexiv2-27   0.27.3-3
ii  libfftw3-double3  3.3.8-2
ii  libgcc-s1 10.2.1-6
ii  libgif7   5.1.9-2
ii  libgsl25  2.6+dfsg-2
ii  libheif1  1.11.0-1
ii  libilmbase25  2.5.4-1
ii  libjpeg62-turbo   1:2.0.6-4
ii  libkf5completion5 5.78.0-3
ii  libkf5configcore5 5.78.0-4
ii  libkf5configgui5  5.78.0-4
ii  libkf5coreaddons5 5.78.0-4
ii  libkf5crash5  5.78.0-3
ii  libkf5guiaddons5  5.78.0-3
ii  libkf5i18n5   5.78.0-2
ii  libkf5itemviews5  5.78.0-2
ii  libkf5widgetsaddons5  5.78.0-2
ii  libkf5windowsystem5   5.78.0-2
ii  liblcms2-22.12~rc1-2
ii  libopencolorio1v5 1.1.1~dfsg0-7
ii  libopenexr25  2.5.4-1
ii  libopenjp2-7  2.4.0-3
ii  libpng16-16   1.6.37-3
ii  libpoppler-qt5-1  20.09.0-3.1
ii  libpython3.9  3.9.2-1
ii  libqt5concurrent5 5.15.2+dfsg-5
ii  libqt5core5a  5.15.2+dfsg-5
ii  libqt5dbus5   5.15.2+dfsg-5
ii  libqt5gui55.15.2+dfsg-5
ii  libqt5multimedia5 5.15.2-3
ii  libqt5network55.15.2+dfsg-5
ii  libqt5printsupport5   5.15.2+dfsg-5
ii  libqt5qml55.15.2+dfsg-5
ii  libqt5quick5  5.15.2+dfsg-5
ii  libqt5quickwidgets5   5.15.2+dfsg-5
ii  libqt5svg55.15.2-3
ii  libqt5widgets55.15.2+dfsg-5
ii  libqt5x11extras5  5.15.2-2
ii  libqt5xml55.15.2+dfsg-5
ii  libquazip5-1  0.9.1-1
ii  libraw20  0.20.2-1
ii  libstdc++610.2.1-6
ii  libtiff5  4.2.0-1
ii  libx11-6  2:1.7.0-2
ii  zlib1g1:1.2.11.dfsg-2

Versions of packages krita recommends:
ii  krita-gmic   2.9.4-4
ii  python3-pyqt55.15.2+dfsg-3
ii  python3-sip  4.19.25+dfsg-1
ii  qml-module-qtmultimedia  5.15.2-3

Versions of packages krita suggests:
ii  colord  1.4.5-3
pn  ffmpeg  
pn  krita-l10n  

-- no debconf information
Invalid profile :  "/usr/share/color/icc/colord/Crayons.icc" "Crayon Colors"
Invalid profile :  "/usr/share/color/icc/colord/x11-colors.icc" "X11 Colors"
Could not set current file 0 "brushes/rake_sparse.png"
krita.general: Bundle is broken. File "brushes/rake_sparse.png" is missing
Could not set current file 0 "brushes/rock_pitted.gih"
krita.general: Bundle is broken. File "brushes/rock_pitted.gih" is missing
Could not set current file 0 "brushes/square_rough.png"
krita.general: Bundle is broken. File "brushes/square_rough.png" is missing
krita.general: Due to missing files and wrong entries in the manifest,  
"/usr/share/krita/bundles/RGBA_brushes.bundle"  will be recreated.
QuaZipFile::open(): file open mode 2 incompatible with ZIP open mode 0
Could not open "brushes/Craig_02.png" 0
krita.lib.store: KoStore: You must open before writing 

krita.lib.store: You must open before closing
QuaZipFile::open(): file open mode 2 incompatible with ZIP open mode 0
Could not open "brushes/DA_RGBA bluegreen_small.png" 0
QBuffer::setBuffer: Buffer is open
krita.lib.store: KoStore: You must open before writing 

krita.lib.store: You must open before closing
QuaZipFile::open(): file open mode 2 incompatible with ZIP open mode 0
Could not open "brushes/DA_RGBA bluegreen_small1.png" 0
QBuffer::setBuffer: Buffer is open