| Summary: | Kate crashes when invoking print preview for file | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Nicolas Fella <nicolas.fella> |
| Component: | application | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | christoph |
| Priority: | NOR | ||
| Version First Reported In: | Git | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/frameworks/ktexteditor/commit/18242d56dd70c4b26e807c31b1b7d5de3a3f56b1 | Version Fixed/Implemented In: | 5.97.0 |
| Sentry Crash Report: | |||
Upsa, will fix that. Git commit be8a6eec935e39801e6a73ec28c322d3912d412f by Christoph Cullmann. Committed on 09/07/2022 at 15:44. Pushed by cullmann into branch 'master'. avoid accessing view pointer during printing M +2 -2 src/render/katerenderer.cpp https://invent.kde.org/frameworks/ktexteditor/commit/be8a6eec935e39801e6a73ec28c322d3912d412f hmm, now I get a different crash for the same thing
#0 KateRenderer::paintTextLine (this=0x1354340, paint=..., range=..., xStart=xStart@entry=0, xEnd=745, cursor=cursor@entry=0x0, flags=...) at /home/nico/kde/src/ktexteditor/src/render/katerenderer.cpp:851
#1 0x00007ffff7c5e88f in KatePrinter::PrintPainter::paintLine (this=0x7fffffffbaf0, painter=..., line=<optimized out>, y=@0x7fffffffb6d0: 0, remainder=@0x7fffffffb6d4: 0, pl=...)
at /home/nico/kde/src/ktexteditor/src/printing/printpainter.cpp:682
#2 0x00007ffff7c5f331 in KatePrinter::PrintPainter::paint (this=0x7fffffffbaf0, printer=0x7fffffffba70) at /home/nico/kde/src/ktexteditor/src/printing/printpainter.cpp:206
#3 0x00007ffff5a043a4 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffb870, r=0x7fffffffbad0, this=0xdfc980) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#4 doActivate<false> (sender=0x7fffffffbaa0, signal_index=10, argv=0x7fffffffb870) at kernel/qobject.cpp:3886
#5 0x00007ffff59fdc1f in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff4cda0c0 <QPrintPreviewDialog::staticMetaObject>, local_signal_index=local_signal_index@entry=0,
argv=argv@entry=0x7fffffffb870) at kernel/qobject.cpp:3946
#6 0x00007ffff4cbbfbf in QPrintPreviewDialog::paintRequested (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qprintpreviewdialog.cpp:184
#7 0x00007ffff5a043d4 in doActivate<false> (sender=0xd7ab80, signal_index=7, argv=0x7fffffffb950) at kernel/qobject.cpp:3898
#8 0x00007ffff59fdc1f in QMetaObject::activate (sender=sender@entry=0xd7ab80, m=m@entry=0x7ffff4cd89a0 <QPrintPreviewWidget::staticMetaObject>, local_signal_index=local_signal_index@entry=0,
argv=argv@entry=0x7fffffffb950) at kernel/qobject.cpp:3946
#9 0x00007ffff4ca230f in QPrintPreviewWidget::paintRequested (this=this@entry=0xd7ab80, _t1=<optimized out>) at .moc/moc_qprintpreviewwidget.cpp:246
#10 0x00007ffff4ca4111 in QPrintPreviewWidgetPrivate::generatePreview (this=this@entry=0xe2bcf0) at widgets/qprintpreviewwidget.cpp:399
#11 0x00007ffff4ca4274 in QPrintPreviewWidget::updatePreview (this=<optimized out>) at widgets/qprintpreviewwidget.cpp:799
#12 0x00007ffff4cbf119 in QPrintPreviewDialog::setVisible (this=0x7fffffffbaa0, visible=<optimized out>) at dialogs/qprintpreviewdialog.cpp:730
#13 0x00007ffff6888e21 in QDialog::exec (this=this@entry=0x7fffffffbaa0) at dialogs/qdialog.cpp:593
#14 0x00007ffff7c5a2a4 in KatePrinter::printPreview (doc=<optimized out>) at /home/nico/kde/src/ktexteditor/src/printing/kateprinter.cpp:208
#15 0x00007ffff5a043a4 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffbca0, r=0x96e130, this=0x9b1450) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#16 doActivate<false> (sender=0x9b1600, signal_index=4, argv=0x7fffffffbca0) at kernel/qobject.cpp:3886
#17 0x00007ffff59fdc1f in QMetaObject::activate (sender=sender@entry=0x9b1600, m=m@entry=0x7ffff6b7fc00 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1,
argv=argv@entry=0x7fffffffbca0) at kernel/qobject.cpp:3946
#18 0x00007ffff66953d2 in QAction::triggered (this=this@entry=0x9b1600, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#19 0x00007ffff6697dbb in QAction::activate (this=0x9b1600, event=<optimized out>) at kernel/qaction.cpp:1161
#20 0x00007ffff680a4c2 in QMenuPrivate::activateCausedStack (this=this@entry=0x12d2120, causedStack=..., action=action@entry=0x9b1600, action_e=action_e@entry=QAction::Trigger, self=self@entry=true)
at widgets/qmenu.cpp:1384
#21 0x00007ffff6811e34 in QMenuPrivate::activateAction (this=0x12d2120, action=0x9b1600, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461
#22 0x00007ffff66d9928 in QWidget::event (this=0x7fffffffc8b0, event=0x7fffffffc190) at kernel/qwidget.cpp:9033
#23 0x00007ffff669b2de in QApplicationPrivate::notify_helper (this=this@entry=0x43d9f0, receiver=receiver@entry=0x7fffffffc8b0, e=e@entry=0x7fffffffc190) at kernel/qapplication.cpp:3637
#24 0x00007ffff66a3262 in QApplication::notify (this=<optimized out>, receiver=0x7fffffffc8b0, e=<optimized out>) at kernel/qapplication.cpp:3081
#25 0x00007ffff59cf508 in QCoreApplication::notifyInternal2 (receiver=0x7fffffffc8b0, event=0x7fffffffc190) at kernel/qcoreapplication.cpp:1064
#26 0x00007ffff66a140b in QApplicationPrivate::sendMouseEvent (receiver=0x7fffffffc8b0, event=event@entry=0x7fffffffc190, alienWidget=<optimized out>, nativeWidget=0x7fffffffc8b0,
buttonDown=buttonDown@entry=0x7ffff6baea10 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2619
#27 0x00007ffff66f1ff1 in QWidgetWindow::handleMouseEvent (this=0x12c6cc0, event=0x7fffffffc420) at kernel/qwidgetwindow.cpp:580
#28 0x00007ffff66f4d19 in QWidgetWindow::event (this=0x12c6cc0, event=0x7fffffffc420) at kernel/qwidgetwindow.cpp:300
#29 0x00007ffff669b2de in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x12c6cc0, e=0x7fffffffc420) at kernel/qapplication.cpp:3637
#30 0x00007ffff59cf508 in QCoreApplication::notifyInternal2 (receiver=0x12c6cc0, event=0x7fffffffc420) at kernel/qcoreapplication.cpp:1064
#31 0x00007ffff5f9b6b4 in QGuiApplicationPrivate::processMouseEvent (e=0x7fffdc006f90) at kernel/qguiapplication.cpp:2282
#32 0x00007ffff5f7036c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#33 0x00007ffff237b640 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:74
#34 0x00007ffff2546faf in g_main_dispatch (context=0x472700) at ../glib/gmain.c:3417
#35 g_main_context_dispatch (context=0x472700) at ../glib/gmain.c:4135
#36 0x00007ffff259c2c8 in g_main_context_iterate.constprop.0 (context=context@entry=0x472700, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4211
--Type <RET> for more, q to quit, c to continue without paging--
#37 0x00007ffff2544940 in g_main_context_iteration (context=0x472700, may_block=1) at ../glib/gmain.c:4276
#38 0x00007ffff5a234a6 in QEventDispatcherGlib::processEvents (this=0x472ca0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#39 0x00007ffff59ce0fb in QEventLoop::exec (this=this@entry=0x7fffffffc7b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#40 0x00007ffff680f95f in QMenuPrivate::exec(QPoint const&, QAction*, std::function<QPoint (QSize const&)>) (this=0x12d2120, p=..., action=action@entry=0x0, positionFunction=...)
at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#41 0x00007ffff680fa4f in QMenu::exec (this=this@entry=0x7fffffffc8b0, p=..., action=action@entry=0x0) at widgets/qmenu.cpp:2687
#42 0x00007fffe1a529cc in KateFileTree::contextMenuEvent (this=0x96e130, event=0x7fffffffcc90) at /home/nico/kde/src/kate/addons/filetree/katefiletree.cpp:398
#43 0x00007ffff66d9928 in QWidget::event (this=this@entry=0x96e130, event=event@entry=0x7fffffffcc90) at kernel/qwidget.cpp:9033
#44 0x00007ffff678092e in QFrame::event (this=0x96e130, e=0x7fffffffcc90) at widgets/qframe.cpp:550
#45 0x00007ffff59cf29b in QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=receiver@entry=0x9a40e0, event=event@entry=0x7fffffffcc90) at kernel/qcoreapplication.cpp:1190
#46 0x00007ffff669b2ce in QApplicationPrivate::notify_helper (this=this@entry=0x43d9f0, receiver=receiver@entry=0x9a40e0, e=e@entry=0x7fffffffcc90) at kernel/qapplication.cpp:3631
#47 0x00007ffff66a2220 in QApplication::notify (this=<optimized out>, receiver=0x9a40e0, e=<optimized out>) at kernel/qapplication.cpp:3243
#48 0x00007ffff59cf508 in QCoreApplication::notifyInternal2 (receiver=0x9a40e0, event=0x7fffffffcc90) at kernel/qcoreapplication.cpp:1064
#49 0x00007ffff66f25a5 in QWidgetWindow::handleMouseEvent (this=<optimized out>, event=0x7fffffffcf20) at kernel/qwidgetwindow.cpp:691
#50 0x00007ffff66f4d19 in QWidgetWindow::event (this=0x7255b0, event=0x7fffffffcf20) at kernel/qwidgetwindow.cpp:300
#51 0x00007ffff669b2de in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x7255b0, e=0x7fffffffcf20) at kernel/qapplication.cpp:3637
#52 0x00007ffff59cf508 in QCoreApplication::notifyInternal2 (receiver=0x7255b0, event=0x7fffffffcf20) at kernel/qcoreapplication.cpp:1064
#53 0x00007ffff5f9b6b4 in QGuiApplicationPrivate::processMouseEvent (e=0x7fffdc005de0) at kernel/qguiapplication.cpp:2282
#54 0x00007ffff5f7036c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#55 0x00007ffff237b640 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:74
#56 0x00007ffff2546faf in g_main_dispatch (context=0x472700) at ../glib/gmain.c:3417
#57 g_main_context_dispatch (context=0x472700) at ../glib/gmain.c:4135
#58 0x00007ffff259c2c8 in g_main_context_iterate.constprop.0 (context=context@entry=0x472700, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4211
#59 0x00007ffff2544940 in g_main_context_iteration (context=0x472700, may_block=1) at ../glib/gmain.c:4276
#60 0x00007ffff5a234a6 in QEventDispatcherGlib::processEvents (this=0x472ca0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#61 0x00007ffff59ce0fb in QEventLoop::exec (this=this@entry=0x7fffffffd2a0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#62 0x00007ffff59d5be2 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#63 0x00007ffff5f8f9fc in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#64 0x00007ffff669b255 in QApplication::exec () at kernel/qapplication.cpp:2829
#65 0x0000000000408de9 in main (argc=<optimized out>, argv=<optimized out>) at /home/nico/kde/src/kate/apps/kate/main.cpp:607
Hmm, fail to get that, interesting, but yes, that code is wrong, too :( Git commit 18242d56dd70c4b26e807c31b1b7d5de3a3f56b1 by Christoph Cullmann. Committed on 10/07/2022 at 10:08. Pushed by cullmann into branch 'master'. avoid crash on caret drawing if no view M +24 -22 src/render/katerenderer.cpp M +1 -1 src/render/katerenderer.h https://invent.kde.org/frameworks/ktexteditor/commit/18242d56dd70c4b26e807c31b1b7d5de3a3f56b1 Now it works, thanks! |
STEPS TO REPRODUCE 1. Open a file 2. In the left sidebar go to 'Documents' 3. right click on the file 4. Hit 'Print Preview' #0 KTextEditor::ViewPrivate::selectionRange (this=0x0) at /home/nico/kde/src/ktexteditor/src/view/kateview.cpp:4035 #1 0x00007ffff7c6a5dd in KateRenderer::decorationsForLine (this=this@entry=0x1362c10, textLine=..., line=<optimized out>, selectionsOnly=selectionsOnly@entry=false) at /home/nico/kde/src/ktexteditor/src/render/katerenderer.cpp:563 #2 0x00007ffff7c6b1be in KateRenderer::layoutLine (this=0x1362c10, lineLayout=..., maxwidth=745, cacheLayout=cacheLayout@entry=false) at /home/nico/kde/usr/include/QtCore/qshareddata.h:160 #3 0x00007ffff7c5f7fe in KatePrinter::PrintPainter::paintLine (this=0x7fffffffbb10, painter=..., line=0, y=@0x7fffffffb6f0: 0, remainder=@0x7fffffffb6f4: 0, pl=...) at /home/nico/kde/src/ktexteditor/src/printing/printpainter.cpp:632 #4 0x00007ffff7c603a1 in KatePrinter::PrintPainter::paint (this=0x7fffffffbb10, printer=0x7fffffffba90) at /home/nico/kde/src/ktexteditor/src/printing/printpainter.cpp:206 #5 0x00007ffff5a053a4 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffb890, r=0x7fffffffbaf0, this=0x12c4f20) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398 #6 doActivate<false> (sender=0x7fffffffbac0, signal_index=10, argv=0x7fffffffb890) at kernel/qobject.cpp:3886 #7 0x00007ffff59fec1f in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff4ce30c0 <QPrintPreviewDialog::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffb890) at kernel/qobject.cpp:3946 #8 0x00007ffff4cc4fbf in QPrintPreviewDialog::paintRequested (this=<optimized out>, _t1=<optimized out>) at .moc/moc_qprintpreviewdialog.cpp:184 #9 0x00007ffff5a053d4 in doActivate<false> (sender=0x13642d0, signal_index=7, argv=0x7fffffffb970) at kernel/qobject.cpp:3898 #10 0x00007ffff59fec1f in QMetaObject::activate (sender=sender@entry=0x13642d0, m=m@entry=0x7ffff4ce19a0 <QPrintPreviewWidget::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffb970) at kernel/qobject.cpp:3946 #11 0x00007ffff4cab30f in QPrintPreviewWidget::paintRequested (this=this@entry=0x13642d0, _t1=<optimized out>) at .moc/moc_qprintpreviewwidget.cpp:246 #12 0x00007ffff4cad111 in QPrintPreviewWidgetPrivate::generatePreview (this=this@entry=0xd988f0) at widgets/qprintpreviewwidget.cpp:399 #13 0x00007ffff4cad274 in QPrintPreviewWidget::updatePreview (this=<optimized out>) at widgets/qprintpreviewwidget.cpp:799 #14 0x00007ffff4cc8119 in QPrintPreviewDialog::setVisible (this=0x7fffffffbac0, visible=<optimized out>) at dialogs/qprintpreviewdialog.cpp:730 #15 0x00007ffff6889e21 in QDialog::exec (this=this@entry=0x7fffffffbac0) at dialogs/qdialog.cpp:593 #16 0x00007ffff7c5b314 in KatePrinter::printPreview (doc=<optimized out>) at /home/nico/kde/src/ktexteditor/src/printing/kateprinter.cpp:208 #17 0x00007ffff5a053a4 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffbcc0, r=0x96e9f0, this=0x9b1ec0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398 #18 doActivate<false> (sender=0x9b2070, signal_index=4, argv=0x7fffffffbcc0) at kernel/qobject.cpp:3886 #19 0x00007ffff59fec1f in QMetaObject::activate (sender=sender@entry=0x9b2070, m=m@entry=0x7ffff6b80c00 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffffffbcc0) at kernel/qobject.cpp:3946 #20 0x00007ffff66963d2 in QAction::triggered (this=this@entry=0x9b2070, _t1=<optimized out>) at .moc/moc_qaction.cpp:376 #21 0x00007ffff6698dbb in QAction::activate (this=0x9b2070, event=<optimized out>) at kernel/qaction.cpp:1161 #22 0x00007ffff680b4c2 in QMenuPrivate::activateCausedStack (this=this@entry=0xe06860, causedStack=..., action=action@entry=0x9b2070, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384 #23 0x00007ffff6812e34 in QMenuPrivate::activateAction (this=0xe06860, action=0x9b2070, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461 #24 0x00007ffff66da928 in QWidget::event (this=0x7fffffffc8d0, event=0x7fffffffc1b0) at kernel/qwidget.cpp:9033 #25 0x00007ffff669c2de in QApplicationPrivate::notify_helper (this=this@entry=0x43d9f0, receiver=receiver@entry=0x7fffffffc8d0, e=e@entry=0x7fffffffc1b0) at kernel/qapplication.cpp:3637 #26 0x00007ffff66a4262 in QApplication::notify (this=<optimized out>, receiver=0x7fffffffc8d0, e=<optimized out>) at kernel/qapplication.cpp:3081 #27 0x00007ffff59d0508 in QCoreApplication::notifyInternal2 (receiver=0x7fffffffc8d0, event=0x7fffffffc1b0) at kernel/qcoreapplication.cpp:1064 #28 0x00007ffff66a240b in QApplicationPrivate::sendMouseEvent (receiver=0x7fffffffc8d0, event=event@entry=0x7fffffffc1b0, alienWidget=<optimized out>, nativeWidget=0x7fffffffc8d0, buttonDown=buttonDown@entry=0x7ffff6bafa10 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2619 #29 0x00007ffff66f2ff1 in QWidgetWindow::handleMouseEvent (this=0x1305b00, event=0x7fffffffc440) at kernel/qwidgetwindow.cpp:580 #30 0x00007ffff66f5d19 in QWidgetWindow::event (this=0x1305b00, event=0x7fffffffc440) at kernel/qwidgetwindow.cpp:300 #31 0x00007ffff669c2de in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x1305b00, e=0x7fffffffc440) at kernel/qapplication.cpp:3637 #32 0x00007ffff59d0508 in QCoreApplication::notifyInternal2 (receiver=0x1305b00, event=0x7fffffffc440) at kernel/qcoreapplication.cpp:1064 #33 0x00007ffff5f9c6b4 in QGuiApplicationPrivate::processMouseEvent (e=0xdf40e0) at kernel/qguiapplication.cpp:2282 #34 0x00007ffff5f7136c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169 #35 0x00007ffff2421640 in userEventSourceDispatch (source=<optimized out>) at qeventdispatcher_glib.cpp:74 Kate + Frameworks from master branch