Bug 291172 - words crashes when splitting a paragraph
Summary: words crashes when splitting a paragraph
Status: RESOLVED FIXED
Alias: None
Product: calligrawords
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Calligra Words Bugs
URL:
Keywords:
: 291516 291675 293976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-10 14:54 UTC by Halla Rempt
Modified: 2012-02-14 11:27 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
crashing file (15.13 KB, application/octet-stream)
2012-02-02 17:48 UTC, Martin Bednar
Details
Different crashing file (26.47 KB, application/octet-stream)
2012-02-03 19:48 UTC, Martin Bednar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Halla Rempt 2012-01-10 14:54:10 UTC
Application: calligrawords (2.4 Beta 6)
KDE Platform Version: 4.7.4 (4.7.4)
Qt Version: 4.8.0
Operating System: Linux 3.1.0-1.2-desktop x86_64
Distribution: "openSUSE 12.1 (x86_64)"

-- Information about the crash:
I had typed some text, bold and not, and then selected Heading as the paragraph style. I went to the middle of the paragraph, pressed enter to split the paragraph. The second half seemed to look like defaul text again. When I typed another character, Words crashed.

-- Backtrace:
Application: Words (calligrawords), signal: Segmentation fault
[KCrash Handler]
#6  0x00007feff784bc1c in QTextLine::cursorToX(int*, QTextLine::Edge) const () from /usr/lib64/libQtGui.so.4
#7  0x00007feff7891157 in ?? () from /usr/lib64/libQtGui.so.4
#8  0x00007feffb5575fa in KoTextEditor::Private::newLine (this=0xbd6430) at /home/boud/kde/src/calligra/libs/kotext/KoTextEditor.cpp:277
#9  0x00007feffb55c29b in newLine (this=0xc04630) at /home/boud/kde/src/calligra/libs/kotext/KoTextEditor.cpp:2056
#10 KoTextEditor::newLine (this=0xc04630) at /home/boud/kde/src/calligra/libs/kotext/KoTextEditor.cpp:2042
#11 0x00007fefe2362e41 in TextTool::keyPressEvent (this=0xdb1970, event=0x7fff79baea10) at /home/boud/kde/src/calligra/plugins/textshape/TextTool.cpp:1159
#12 0x00007fefe773b20d in KWCanvas::keyPressEvent (this=0xd7fd50, e=0x7fff79baea10) at /home/boud/kde/src/calligra/words/part/KWCanvas.cpp:117
#13 0x00007feff7633618 in QWidget::event(QEvent*) () from /usr/lib64/libQtGui.so.4
#14 0x00007feff75e2e84 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#15 0x00007feff75e83ce in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQtGui.so.4
#16 0x00007feff83260f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#17 0x00007feff66f888c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQtCore.so.4
#18 0x00007feff76821c9 in ?? () from /usr/lib64/libQtGui.so.4
#19 0x00007feff768263b in ?? () from /usr/lib64/libQtGui.so.4
#20 0x00007feff765e604 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/libQtGui.so.4
#21 0x00007feff7686652 in ?? () from /usr/lib64/libQtGui.so.4
#22 0x00007feff04f258d in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#23 0x00007feff04f2d88 in ?? () from /usr/lib64/libglib-2.0.so.0
#24 0x00007feff04f2f59 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#25 0x00007feff67278df in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#26 0x00007feff76862de in ?? () from /usr/lib64/libQtGui.so.4
#27 0x00007feff66f7672 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#28 0x00007feff66f78c7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQtCore.so.4
#29 0x00007feff66fc425 in QCoreApplication::exec() () from /usr/lib64/libQtCore.so.4
#30 0x00007feffbeb801d in kdemain (argc=<optimized out>, argv=0x7fff79bafaa8) at /home/boud/kde/src/calligra/words/part/main.cpp:43
#31 0x00007feff587723d in __libc_start_main () from /lib64/libc.so.6
#32 0x0000000000400871 in _start () at ../sysdeps/x86_64/elf/start.S:113

Reported using DrKonqi
Comment 1 Camilla Boemann 2012-01-14 15:08:32 UTC
*** Bug 291516 has been marked as a duplicate of this bug. ***
Comment 2 Camilla Boemann 2012-01-16 17:37:17 UTC
*** Bug 291675 has been marked as a duplicate of this bug. ***
Comment 3 Camilla Boemann 2012-01-19 11:46:50 UTC
It's not out of the question at all. In the the future though.
Comment 4 Camilla Boemann 2012-01-19 11:47:21 UTC
oops disregard last comment
Comment 5 Martin Bednar 2012-02-02 17:47:22 UTC
Can't reproduce with this description with beta 7...
However, I can reproduce 291675.

Open file, place cursor before first word of second paragraph, hit enter. it crashes.
I'm unable to geat a useful backtrace, but I will attach a file where it happens. This happens every time.
Comment 6 Martin Bednar 2012-02-02 17:48:22 UTC
Created attachment 68438 [details]
crashing file
Comment 7 Camilla Boemann 2012-02-02 18:00:44 UTC
unfortunately even with that document and doing as you describe it doesn't crash for me so i really need someone who can produce backtraces
Comment 8 Martin Bednar 2012-02-03 15:59:09 UTC
This is the best I've been able to come up with so far, 

-- Backtrace:

Application: Calligra Words (kdeinit4), signal: Segmentation fault
[KCrash Handler]
#6  0x00007f4f89ebd546 in QTextLine::cursorToX(int*, QTextLine::Edge) const () from /usr/lib/libQtGui.so.4
#7  0x00007f4f89f029d7 in ?? () from /usr/lib/libQtGui.so.4
#8  0x00007f4f75f1d86c in KoTextEditor::Private::newLine() () from /usr/lib/libkotext.so.9
#9  0x00007f4f75f1fc82 in KoTextEditor::newLine() () from /usr/lib/libkotext.so.9
#10 0x00007f4f6b7de58e in ?? () from /usr/lib/kde4/textshape.so
#11 0x00007f4f6ec5461d in ?? () from /usr/lib/libwordsprivate.so.9
#12 0x00007f4f89ca5e58 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#13 0x00007f4f89c55724 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007f4f89c5ac6e in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#15 0x00007f4f8b8cc4f6 in KApplication::notify (this=0x7ffff08b4020, receiver=0x2ed24c0, event=0x7ffff08b3150) at /chakra/desktop-unstable/kdelibs/src/kdelibs-4.8.0/kdeui/kernel/kapplication.cpp:311
#16 0x00007f4f8aae503c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007f4f89cf4839 in ?? () from /usr/lib/libQtGui.so.4
#18 0x00007f4f89cf4c7b in ?? () from /usr/lib/libQtGui.so.4
#19 0x00007f4f89cd11c4 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007f4f89cf8c82 in ?? () from /usr/lib/libQtGui.so.4
#21 0x00007f4f864f36d3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#22 0x00007f4f864f3eb0 in ?? () from /usr/lib/libglib-2.0.so.0
#23 0x00007f4f864f414d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#24 0x00007f4f8ab13f5f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#25 0x00007f4f89cf891e in ?? () from /usr/lib/libQtGui.so.4
#26 0x00007f4f8aae3e22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0x00007f4f8aae4077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0x00007f4f8aae8bd5 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#29 0x00007f4f7753efcd in kdemain () from /usr/lib/libkdeinit4_calligrawords.so
#30 0x00000000004087df in launch (argc=2, _name=0x236da28 "/usr/bin/calligrawords", args=<optimized out>, cwd=0x0, envc=<optimized out>, envs=<optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x236da77 "Nemmerle;1328284558;671872;32367_TIME183446605") at /chakra/desktop-unstable/kdelibs/src/kdelibs-4.8.0/kinit/kinit.cpp:734
#31 0x0000000000409706 in handle_launcher_request (sock=<optimized out>, who=<optimized out>) at /chakra/desktop-unstable/kdelibs/src/kdelibs-4.8.0/kinit/kinit.cpp:1226
#32 0x0000000000409d9f in handle_requests (waitForPid=0) at /chakra/desktop-unstable/kdelibs/src/kdelibs-4.8.0/kinit/kinit.cpp:1419
#33 0x00000000004056df in main (argc=4, argv=0x7fff00000001, envp=0x7ffff08b52d0) at /chakra/desktop-unstable/kdelibs/src/kdelibs-4.8.0/kinit/kinit.cpp:1907
Comment 9 Martin Bednar 2012-02-03 19:48:04 UTC
Created attachment 68471 [details]
Different crashing file

Attaching another file where this happens. Simply open using words, the cursor should be at the beginning of the first paragraph. Hit enter. Crash.
As a bonus this file will make Words use 100% of the CPU and become unresponsive if I try to insert a character in the middle of a paragraph. (But that is a different issue, should I file a new report?)

Backtrace obtained:
Application: Calligra Words (calligrawords), signal: Segmentation fault
[KCrash Handler]
#6  0x00007f1b0ee78546 in QTextLine::cursorToX(int*, QTextLine::Edge) const () from /usr/lib/libQtGui.so.4
#7  0x00007f1b0eebd9d7 in ?? () from /usr/lib/libQtGui.so.4
#8  0x00007f1b0c57c86c in KoTextEditor::Private::newLine() () from /usr/lib/libkotext.so.9
#9  0x00007f1b0c57ec82 in KoTextEditor::newLine() () from /usr/lib/libkotext.so.9
#10 0x00007f1af423658e in ?? () from /usr/lib/kde4/textshape.so
#11 0x00007f1afa4f461d in ?? () from /usr/lib/libwordsprivate.so.9
#12 0x00007f1b0ec60e58 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#13 0x00007f1b0ec10724 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007f1b0ec15c6e in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#15 0x00007f1b0b18b4f6 in KApplication::notify (this=0x7fffc7f350a0, receiver=0x1ed66d0, event=0x7fffc7f341d0) at /chakra/desktop-unstable/kdelibs/src/kdelibs-4.8.0/kdeui/kernel/kapplication.cpp:311
#16 0x00007f1b0e20303c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007f1b0ecaf839 in ?? () from /usr/lib/libQtGui.so.4
#18 0x00007f1b0ecafc7b in ?? () from /usr/lib/libQtGui.so.4
#19 0x00007f1b0ec8c1c4 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007f1b0ecb3c82 in ?? () from /usr/lib/libQtGui.so.4
#21 0x00007f1b0a55d6d3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#22 0x00007f1b0a55deb0 in ?? () from /usr/lib/libglib-2.0.so.0
#23 0x00007f1b0a55e14d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#24 0x00007f1b0e231f5f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#25 0x00007f1b0ecb391e in ?? () from /usr/lib/libQtGui.so.4
#26 0x00007f1b0e201e22 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0x00007f1b0e202077 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#28 0x00007f1b0e206bd5 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#29 0x00007f1b0fe06fcd in kdemain () from /usr/lib/libkdeinit4_calligrawords.so
#30 0x00007f1b0fa9e17d in __libc_start_main () from /lib/libc.so.6
#31 0x0000000000400601 in _start ()
Comment 10 Camilla Boemann 2012-02-03 19:53:32 UTC
I can not reproduce crash, but I can reproduce the unresponsiveness when entering text, so yes please open another bug for that
Comment 11 Giuseppe Calà 2012-02-04 22:49:28 UTC
I can reproduce the crash in beta 6. Words crashes pressing Enter twice while cursor is inside a paragraph or with just one pressure when placing the cursor at the beginning of a text paragraph.

If the cursor in on an empty line, it is all ok.

My crash log:
http://paste.kde.org/199976/
Comment 12 Camilla Boemann 2012-02-04 22:54:16 UTC
I'm sorry but without debugging symbols those backtraces are not worth much to me. Could you please see if you can either install debugging pacage for calligra or build from source.

boudewijn or bugsbane, maybe yo guys could test with the files linked in recent comments ?
Comment 13 Camilla Boemann 2012-02-13 10:04:47 UTC
*** Bug 293976 has been marked as a duplicate of this bug. ***
Comment 14 Camilla Boemann 2012-02-13 10:12:27 UTC
duplicate bug https://bugs.kde.org/show_bug.cgi?id=293976 shows the bug is Qt related

it's the line in KoTextEditor::Private::newLine:
caret.setPosition(startPosition);

that makes Qt crash, Presumably because Qt fails to register that the block layout has become invalid.

I'll try writing the code a bit different to see if we can work around, but being unable to reproduce myself I'll be working blindly
Comment 15 Camilla Boemann 2012-02-13 10:18:43 UTC
Git commit f14b8dd329ded0b709d33a5646ce4f57ac9810db by C. Boemann.
Committed on 13/02/2012 at 11:17.
Pushed by boemann into branch 'master'.

Try to work around a bug I presume is a Qt bug

M  +4    -5    libs/kotext/KoTextEditor.cpp

http://commits.kde.org/calligra/f14b8dd329ded0b709d33a5646ce4f57ac9810db
Comment 16 Giuseppe Calà 2012-02-13 12:15:13 UTC
Compiled master from git; unfortunately the work around doesn't work. Still crashing.
Comment 17 Camilla Boemann 2012-02-13 12:17:27 UTC
Ok thanks, it's a Qt bug, so closing as upstream (meaning Qt)
Comment 18 Martin Bednar 2012-02-13 21:57:53 UTC
I see it's closed, but just for the sake of completeness, here's the best backtrace I've (finally) been able to come up with : 
Application: Calligra Words (kdeinit4), signal: Segmentation fault
[KCrash Handler]
#6  0x00007fc7f9658b47 in QTextLine::cursorToX (this=0x7fff3c2fed30, cursorPos=0x7fff3c2fed5c, edge=QTextLine::Leading) at text/qtextlayout.cpp:2511
#7  0x00007fc7f96a1548 in cursorToX (edge=QTextLine::Leading, cursorPos=0, this=0x7fff3c2fed30) at ../../include/QtGui/../../src/gui/text/qtextlayout.h:230
#8  QTextCursorPrivate::setX (this=0x1ca1fb0) at text/qtextcursor.cpp:146
#9  0x00007fc7ea0fa52a in KoTextEditor::Private::newLine (this=0x10624b0) at /var/tmp/portage/app-office/calligra-2.3.87/work/calligra-2.3.87/libs/kotext/KoTextEditor.cpp:272
#10 0x00007fc7ea0fc8cb in KoTextEditor::newLine (this=0x12423d0) at /var/tmp/portage/app-office/calligra-2.3.87/work/calligra-2.3.87/libs/kotext/KoTextEditor.cpp:2143
#11 0x00007fc7e179a394 in TextTool::keyPressEvent (this=0x1438ac0, event=0x7fff3c2ff9d0) at /var/tmp/portage/app-office/calligra-2.3.87/work/calligra-2.3.87/plugins/textshape/TextTool.cpp:1145
#12 0x00007fc7e44d3152 in KWCanvas::keyPressEvent (this=0x1408380, e=0x7fff3c2ff9d0) at /var/tmp/portage/app-office/calligra-2.3.87/work/calligra-2.3.87/words/part/KWCanvas.cpp:117
#13 0x00007fc7f943ad93 in QWidget::event (this=0x1408380, event=0x7fff3c2ff9d0) at kernel/qwidget.cpp:8396
#14 0x00007fc7f93e9304 in QApplicationPrivate::notify_helper (this=0xd70c20, receiver=0x1408380, e=0x7fff3c2ff9d0) at kernel/qapplication.cpp:4550
#15 0x00007fc7f93ee777 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fff3c2ff9d0) at kernel/qapplication.cpp:3991
#16 0x00007fc7fb046a56 in KApplication::notify (this=0x7fff3c3008e0, receiver=0x1408380, event=0x7fff3c2ff9d0) at /var/tmp/portage/kde-base/kdelibs-4.8.0-r1/work/kdelibs-4.8.0/kdeui/kernel/kapplication.cpp:311
#17 0x00007fc7fa2685cb in QCoreApplication::notifyInternal (this=0x7fff3c3008e0, receiver=0x1408380, event=0x7fff3c2ff9d0) at kernel/qcoreapplication.cpp:876
#18 0x00007fc7f948a83a in QKeyMapper::sendKeyEvent (keyWidget=0x1408380, grab=<optimized out>, type=QEvent::KeyPress, code=16777220, modifiers=<optimized out>, text=..., autorepeat=false, count=1, nativeScanCode=36, nativeVirtualKey=65293, nativeModifiers=16) at kernel/qkeymapper_x11.cpp:1866
#19 0x00007fc7f948ac8f in QKeyMapperPrivate::translateKeyEvent (this=<optimized out>, keyWidget=0x1408380, event=<optimized out>, grab=false) at kernel/qkeymapper_x11.cpp:1836
#20 0x00007fc7f9466f63 in QApplication::x11ProcessEvent (this=0x7fff3c3008e0, event=0x7fff3c300580) at kernel/qapplication_x11.cpp:3513
#21 0x00007fc7f948ece2 in x11EventSourceDispatch (s=0xd749c0, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#22 0x00007fc7f5a2c28f in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#23 0x00007fc7f5a2ca98 in ?? () from /usr/lib64/libglib-2.0.so.0
#24 0x00007fc7f5a2cc71 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#25 0x00007fc7fa29770f in QEventDispatcherGlib::processEvents (this=0xd70be0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#26 0x00007fc7f948e98e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#27 0x00007fc7fa2675f2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#28 0x00007fc7fa2678a5 in QEventLoop::exec (this=0x7fff3c300890, flags=...) at kernel/qeventloop.cpp:204
#29 0x00007fc7fa26c02b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#30 0x00007fc7eb725fd5 in kdemain (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/app-office/calligra-2.3.87/work/calligra-2.3.87/words/part/main.cpp:43
#31 0x00000000004074e3 in launch (argc=2, _name=0xcd55f8 "/usr/bin/calligrawords", args=<optimized out>, cwd=0x0, envc=<optimized out>, envs=<optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0xcd5647 "Ged;1329173605;36613;2878_TIME514709") at /var/tmp/portage/kde-base/kdelibs-4.8.0-r1/work/kdelibs-4.8.0/kinit/kinit.cpp:734
#32 0x000000000040814f in handle_launcher_request (sock=<optimized out>, who=<optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.8.0-r1/work/kdelibs-4.8.0/kinit/kinit.cpp:1226
#33 0x0000000000408835 in handle_requests (waitForPid=0) at /var/tmp/portage/kde-base/kdelibs-4.8.0-r1/work/kdelibs-4.8.0/kinit/kinit.cpp:1419
#34 0x000000000040943f in main (argc=2, argv=0x7fff3c3018e8, envp=0x7fff3c301900) at /var/tmp/portage/kde-base/kdelibs-4.8.0-r1/work/kdelibs-4.8.0/kinit/kinit.cpp:1907
Comment 19 Camilla Boemann 2012-02-13 23:45:32 UTC
hmm it may be possible to work around it.

I'll look into it tomorrow
Comment 20 Camilla Boemann 2012-02-14 07:59:31 UTC
Git commit 22fa7175b47238d14e1520184208bbdab9e8cbee by C. Boemann.
Committed on 14/02/2012 at 08:58.
Pushed by boemann into branch 'master'.

Another try to work around the qt bug

M  +2    -0    libs/kotext/KoTextEditor.cpp

http://commits.kde.org/calligra/22fa7175b47238d14e1520184208bbdab9e8cbee
Comment 21 Giuseppe Calà 2012-02-14 09:55:59 UTC
Good news! Your last commit fixed the crash.
Comment 22 Camilla Boemann 2012-02-14 11:27:57 UTC
yay, and thanks guys for providing the needed backtraces