Bug 457125 - Krita 5.1.0 beta 2 git e91e5d4 : crash right after undoing a text insertion
Summary: Krita 5.1.0 beta 2 git e91e5d4 : crash right after undoing a text insertion
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (show other bugs)
Version: 5.1.0-beta1
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2022-07-25 16:19 UTC by stephen
Modified: 2022-07-26 10:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stephen 2022-07-25 16:19:17 UTC
SUMMARY
Krita crashes right after undoing a text insertion

STEPS TO REPRODUCE
1. in a newly opened document, insert a new text
2. undo your text insertion

OBSERVED RESULT
Krita crashes right after undoing the text insertion

EXPECTED RESULT
*No crash
*The text should disappear from the canvas once undone

SOFTWARE/OS VERSIONS
Windows 10 21H1
Comment 1 amyspark 2022-07-25 16:41:25 UTC
Confirmed on latest stable nightly (commit e91e5d4). Also happens on nightly master (commit a40c361). This is the stacktrace on macOS:

0   libkritaui.18.dylib           	0x0000000108e0a735 0x108ce4000 + 1206069
1   org.qt-project.QtCore         	0x000000010bd776da QMetaObject::activate(QObject*, int, int, void**) + 2138
2   org.qt-project.QtCore         	0x000000010bd776da QMetaObject::activate(QObject*, int, int, void**) + 2138
3   libkritaglobal.18.dylib       	0x000000010a912f1c KisSignalCompressor::tryEmitOnTick(bool) + 188
4   libkritaglobal.18.dylib       	0x000000010a912f78 KisSignalCompressor::slotTimerExpired() + 56
5   org.qt-project.QtCore         	0x000000010bd776da QMetaObject::activate(QObject*, int, int, void**) + 2138
6   org.qt-project.QtCore         	0x000000010bd7ea22 QTimer::timerEvent(QTimerEvent*) + 98
7   org.qt-project.QtCore         	0x000000010bd70694 QObject::event(QEvent*) + 100
8   org.qt-project.QtWidgets      	0x000000010a971489 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 265
9   org.qt-project.QtWidgets      	0x000000010a9727b0 QApplication::notify(QObject*, QEvent*) + 480
10  libkritaui.18.dylib           	0x0000000109156fa0 KisApplication::notify(QObject*, QEvent*) + 160
11  org.qt-project.QtCore         	0x000000010bd48f57 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 167
12  org.qt-project.QtCore         	0x000000010bd9e91a QTimerInfoList::activateTimers() + 1002
13  libqcocoa.dylib               	0x000000010eb5d9f5 0x10eb29000 + 215541
14  com.apple.CoreFoundation      	0x00007fff20986cec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15  com.apple.CoreFoundation      	0x00007fff20986c54 __CFRunLoopDoSource0 + 180
16  com.apple.CoreFoundation      	0x00007fff209869d4 __CFRunLoopDoSources0 + 242
17  com.apple.CoreFoundation      	0x00007fff209853fc __CFRunLoopRun + 893
18  com.apple.CoreFoundation      	0x00007fff209849bc CFRunLoopRunSpecific + 563
19  com.apple.HIToolbox           	0x00007fff28bcda83 RunCurrentEventLoopInMode + 292
20  com.apple.HIToolbox           	0x00007fff28bcd7e5 ReceiveNextEventCommon + 587
21  com.apple.HIToolbox           	0x00007fff28bcd583 _BlockUntilNextEventMatchingListInModeWithFilter + 70
22  com.apple.AppKit              	0x00007fff2318db12 _DPSNextEvent + 864
23  com.apple.AppKit              	0x00007fff2318c2e5 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
24  com.apple.AppKit              	0x00007fff2317e609 -[NSApplication run] + 586
25  libqcocoa.dylib               	0x000000010eb5e55e 0x10eb29000 + 218462
26  org.qt-project.QtCore         	0x000000010bd44d37 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 471
27  org.qt-project.QtCore         	0x000000010bd495b2 QCoreApplication::exec() + 130
28  org.krita                     	0x000000010865c5eb 0x10864b000 + 71147
29  libdyld.dylib                 	0x00007fff208a9f3d start + 1

(it doesn't make sense, so I suppose some part of the undo machinery set a compressed signal along the way.)
Comment 2 Freya Lupen 2022-07-25 21:13:41 UTC
The top part of the backtrace from my Windows build, if it helps; I can also confirm the same happens in 5.1.0 beta 1.

libkritaui.dll!KisShapeLayerCanvas::slotStartAsyncRepaint+0x3a3  [mysrcdir/libs/ui/flake/kis_shape_layer_canvas.cpp @ 292]
   290:         // by tracking the size of the image in slotImageSizeChanged()
   291:         uncroppedRepaintRect = repaintRect;
>  292:         repaintRect = repaintRect.intersected(m_parentLayer->image()->bounds());
   293:     } else {
   294:         const QRectF shapesBounds = KoShape::boundingRect(m_shapeManager->shapes());
Qt5Core.dll!QMetaObject::activate+0x828  [C:/Packaging/KritaDepsBuild/ext_qt/s/qtbase/src/corelib/kernel/qobject.cpp @ 3804]
Comment 3 amyspark 2022-07-25 21:32:08 UTC
Doesn't happen on 5.0.6, marking as regression.
Comment 4 Dmitry Kazakov 2022-07-26 10:47:10 UTC
Git commit 737f08f12bc7bbb165b0b5af3942d2eef317dd8a by Dmitry Kazakov.
Committed on 26/07/2022 at 10:47.
Pushed by dkazakov into branch 'master'.

Fix crash when undoing addition of a text layer

M  +2    -0    libs/ui/flake/kis_shape_layer_canvas.cpp

https://invent.kde.org/graphics/krita/commit/737f08f12bc7bbb165b0b5af3942d2eef317dd8a
Comment 5 Dmitry Kazakov 2022-07-26 10:47:21 UTC
Git commit 9bfc24eb5800cf61649a95213ba58ed8a6d89e8a by Dmitry Kazakov.
Committed on 26/07/2022 at 10:47.
Pushed by dkazakov into branch 'krita/5.1'.

Fix crash when undoing addition of a text layer

M  +2    -0    libs/ui/flake/kis_shape_layer_canvas.cpp

https://invent.kde.org/graphics/krita/commit/9bfc24eb5800cf61649a95213ba58ed8a6d89e8a