Bug 392127 - Transforming text two times in a row crashes krita
Summary: Transforming text two times in a row crashes krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (show other bugs)
Version: 4.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-21 08:23 UTC by Antti Savolainen
Modified: 2018-04-03 11:46 UTC (History)
1 user (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 Antti Savolainen 2018-03-21 08:23:05 UTC
Overview:

    Using the transform tool on text two times in a row will instantly crash krita 

Steps to Reproduce: 

    1) Create a text

    2) Use the transform tool on the text and press enter to apply

    3) Use the transform tool again on the text and press enter to apply

Actual Results: 

    The application crashed.

Expected Results:

    The text should be reapplied in its new orientation.

Build Date & Platform:

    Krita 4.0

Additional Information: Any other useful information. 

    https://webmshare.com/ZjMEJ Recorded video of the crash in question.
Comment 1 Halla Rempt 2018-03-21 08:47:06 UTC
Backtrace (looks like the actual crash happens in Qt...):


Thread 8 (Thread 0x7f52017fd700 (LWP 3985)):
[KCrash Handler]
#6  0x00007f526354a55e in QFontEngineFT::loadGlyphSet(QTransform const&) (this=this@entry=0x7f51f4243670, matrix=...) at freetype/qfontengine_ft.cpp:1539
#7  0x00007f526354b533 in QFontEngineFT::loadGlyphFor(unsigned int, QFixed, QFontEngine::GlyphFormat, QTransform const&, bool, bool) (this=this@entry=0x7f51f4243670, g=g@entry=47, subPixelPosition=..., subPixelPosition@entry=..., format=format@entry=QFontEngine::Format_A8, t=..., fetchBoundingBox=fetchBoundingBox@entry=false, disableOutlineDrawing=disableOutlineDrawing@entry=false) at freetype/qfontengine_ft.cpp:2056
#8  0x00007f526354d18b in QFontEngineFT::lockedAlphaMapForGlyph(unsigned int, QFixed, QFontEngine::GlyphFormat, QTransform const&, QPoint*) (this=0x7f51f4243670, glyphIndex=47, subPixelPosition=..., neededFormat=QFontEngine::Format_A8, t=..., offset=0x7f52017fa830) at freetype/qfontengine_ft.cpp:2013
#9  0x00007f526faf2dac in QRasterPaintEngine::drawCachedGlyphs(int, unsigned int const*, QFixedPoint const*, QFontEngine*) (this=0x7f51f4244120, numGlyphs=<optimized out>, glyphs=<optimized out>, positions=<optimized out>, fontEngine=0x7f51f4243670) at painting/qpaintengine_raster.cpp:2804
#10 0x00007f526faf5506 in QRasterPaintEngine::drawTextItem(QPointF const&, QTextItem const&) (this=0x7f51f4244120, p=..., textItem=...) at painting/qpaintengine_raster.cpp:3081
#11 0x00007f526fb10f6b in QPainterPrivate::drawTextItem(QPointF const&, QTextItem const&, QTextEngine*) (this=<optimized out>, p=..., _ti=..., textEngine=0x7f51f4241c40) at painting/qpainter.cpp:6517
#12 0x00007f526f9aa4b0 in QTextLine::draw(QPainter*, QPointF const&, QTextLayout::FormatRange const*) const (this=this@entry=0x7f52017fc000, p=p@entry=0x7f52017fcb30, pos=..., selection=selection@entry=0x0) at text/qtextlayout.cpp:2614
#13 0x00007f526f9ab6ad in QTextLayout::draw(QPainter*, QPointF const&, QVector<QTextLayout::FormatRange> const&, QRectF const&) const (this=0x7f51f4003470, p=p@entry=0x7f52017fcb30, pos=..., selections=..., clip=...) at text/qtextlayout.cpp:1257
#14 0x00007f52773e06e9 in KoSvgTextShape::paintComponent(QPainter&, KoViewConverter const&, KoShapePaintingContext&) (this=<optimized out>, painter=..., converter=..., paintContext=...) at /home/boud/dev/krita/libs/flake/text/KoSvgTextShape.cpp:131
#15 0x00007f52772a7594 in KoShapeContainer::paint(QPainter&, KoViewConverter const&, KoShapePaintingContext&) (this=0xab3fe00, painter=..., converter=..., paintcontext=...) at /home/boud/dev/krita/libs/flake/KoShapeContainer.cpp:136
#16 0x00007f52772ae556 in KoShapeManager::paintShape(KoShape*, QPainter&, KoViewConverter const&, KoShapePaintingContext&) (shape=shape@entry=0xab3fe00, painter=..., converter=..., paintContext=...) at /home/boud/dev/krita/libs/flake/KoShapeManager.cpp:361
#17 0x00007f52772af8d0 in KoShapeManager::renderSingleShape(KoShape*, QPainter&, KoViewConverter const&, KoShapePaintingContext&) (shape=0xab3fe00, painter=..., converter=..., paintContext=...) at /home/boud/dev/krita/libs/flake/KoShapeManager.cpp:328
#18 0x00007f52772afeda in KoShapeManager::paint(QPainter&, KoViewConverter const&, bool) (this=0xc492640, painter=..., converter=..., forPrint=forPrint@entry=false) at /home/boud/dev/krita/libs/flake/KoShapeManager.cpp:297
#19 0x00007f5279501082 in KisShapeLayerCanvas::repaint() (this=0xc160240) at /home/boud/dev/krita/libs/ui/flake/kis_shape_layer_canvas.cpp:256
#20 0x00007f52783bd5e4 in KisUpdateJobItem::run() (this=0xce1aad0) at /home/boud/dev/b-krita/libs/image/../../../krita/libs/image/kis_update_job_item.h:90
#21 0x00007f526f19f172 in QThreadPoolThread::run() (this=0x119c8170) at thread/qthreadpool.cpp:101
#22 0x00007f526f1a1e0f in QThreadPrivate::start(void*) (arg=0x119c8170) at thread/qthread_unix.cpp:376
#23 0x00007f526d5a3724 in start_thread () at /lib64/libpthread.so.0
#24 0x00007f526e593c1d in clone () at /lib64/libc.so.6
Comment 2 Dmitry Kazakov 2018-03-30 09:43:41 UTC
Git commit 7c379a6bf047771069ef3c006412f2245efaea6b by Dmitry Kazakov.
Committed on 30/03/2018 at 09:42.
Pushed by dkazakov into branch 'master'.

Fix crash when transforming text with Transform Tool twice

We should release layouts of non-gui threads right in this very
thread.

M  +17   -3    libs/flake/text/KoSvgTextShape.cpp

https://commits.kde.org/krita/7c379a6bf047771069ef3c006412f2245efaea6b
Comment 3 Halla Rempt 2018-04-03 11:46:19 UTC
Git commit d2d9e0a8f90d939c925d68e942440c76461f6d10 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 03/04/2018 at 11:20.
Pushed by rempt into branch 'krita/4.0'.

Fix crash when transforming text with Transform Tool twice

We should release layouts of non-gui threads right in this very
thread.
(cherry picked from commit 7c379a6bf047771069ef3c006412f2245efaea6b)

M  +17   -3    libs/flake/text/KoSvgTextShape.cpp

https://commits.kde.org/krita/d2d9e0a8f90d939c925d68e942440c76461f6d10