Crash when inserting comment into annotation
Closed, ResolvedPublic

Description

Seems there is no shape controller for the annotation shape.
Should there be, or is it something else.

Thread 1 (Thread 0x7f457a3a78c0 (LWP 7710)):
[KCrash Handler]
#6 KoShapeController::documentBase (this=this@entry=0x0) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/libs/flake/KoShapeController.cpp:204
#7 0x00007f458aa17e6f in AddAnnotationCommand::redo (this=0x110a490) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/libs/text/commands/AddAnnotationCommand.cpp:51
#8 0x00007f458a939b19 in KoTextEditor::addCommand (this=this@entry=0x1101320, command=command@entry=0x110a490) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/libs/text/KoTextEditor_undo.cpp:241
#9 0x00007f458a92e089 in KoTextEditor::addAnnotation (this=0x1101320, annotationShape=annotationShape@entry=0x120eb40) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/libs/text/KoTextEditor.cpp:513
#10 0x00007f456d9715ac in TextTool::insertAnnotation (this=0x13ba0f0) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/plugins/textshape/TextTool.cpp:3097
#11 0x00007f456d9f1ab8 in TextTool::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /mnt/src/kdesrc/releaseme/tarball/test/build/plugins/textshape/moc_TextTool.cpp:367
#12 0x00007f458bf82b09 in QMetaObject::activate (sender=sender@entry=0x100cb90, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff931ff2a0) at kernel/qobject.cpp:3740
#13 0x00007f458bf834b7 in QMetaObject::activate (sender=sender@entry=0x100cb90, m=m@entry=0x7f458c7d6e60 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff931ff2a0) at kernel/qobject.cpp:3602
#14 0x00007f458c2fcf22 in QAction::triggered (this=this@entry=0x100cb90, _t1=false) at .moc/moc_qaction.cpp:369
#15 0x00007f458c2ff890 in QAction::activate (this=0x100cb90, event=<optimized out>) at kernel/qaction.cpp:1170
#16 0x00007f458c3eb100 in QAbstractButtonPrivate::click (this=0x2407ca0) at widgets/qabstractbutton.cpp:393
#17 0x00007f458c3eb234 in QAbstractButton::mouseReleaseEvent (this=0x2407c60, e=0x7fff931ff820) at widgets/qabstractbutton.cpp:1009
#18 0x00007f458c4b579a in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:617
#19 0x00007f458c34a398 in QWidget::event (this=0x2407c60, event=0x7fff931ff820) at kernel/qwidget.cpp:9144
#20 0x00007f458c3ebc01 in QAbstractButton::event (this=this@entry=0x2407c60, e=e@entry=0x7fff931ff820) at widgets/qabstractbutton.cpp:966
#21 0x00007f458c4b5879 in QToolButton::event (this=0x2407c60, event=0x7fff931ff820) at widgets/qtoolbutton.cpp:983
#22 0x00007f458c30389c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2407c60, e=0x7fff931ff820) at kernel/qapplication.cpp:3799
#23 0x00007f458c30bb35 in QApplication::notify (this=<optimized out>, receiver=receiver@entry=0x2407c60, e=e@entry=0x7fff931ff820) at kernel/qapplication.cpp:3273
#24 0x00007f458cd39727 in KoApplication::notify (this=<optimized out>, receiver=0x2407c60, event=0x7fff931ff820) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/libs/main/KoApplication.cpp:657
#25 0x00007f458bf57cf8 in QCoreApplication::notifyInternal2 (receiver=receiver@entry=0x2407c60, event=event@entry=0x7fff931ff820) at kernel/qcoreapplication.cpp:988
#26 0x00007f458c30a85f in QCoreApplication::sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#27 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x2407c60, event=event@entry=0x7fff931ff820, alienWidget=alienWidget@entry=0x2407c60, nativeWidget=0xe2fb00, buttonDown=buttonDown@entry=0x7f458c805c30 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:2771
#28 0x00007f458c364090 in QWidgetWindow::handleMouseEvent (this=this@entry=0xef4320, event=event@entry=0x7fff931ffcb0) at kernel/qwidgetwindow.cpp:613
#29 0x00007f458c366863 in QWidgetWindow::event (this=0xef4320, event=0x7fff931ffcb0) at kernel/qwidgetwindow.cpp:239
#30 0x00007f458c30389c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0xef4320, e=0x7fff931ffcb0) at kernel/qapplication.cpp:3799
#31 0x00007f458c30b296 in QApplication::notify (this=0x7fff932000f0, receiver=receiver@entry=0xef4320, e=e@entry=0x7fff931ffcb0) at kernel/qapplication.cpp:3556
#32 0x00007f458cd39727 in KoApplication::notify (this=<optimized out>, receiver=0xef4320, event=0x7fff931ffcb0) at /mnt/src/kdesrc/releaseme/tarball/test/calligra-v3.0.0/libs/main/KoApplicatio

danders created this task.Dec 15 2016, 1:53 PM

KoTextDocument.cpp:171
document has no resource QUrl("kotext://shapeController")
It should add checks for nullptr in AddAnnotationCommand::undo, AddAnnotationCommand::redo

No, more sinister things are going on...
Adding a comment to an annotation shape should not be possible, so changes to the text tool is required.
Patch on it's way.