Bug 298899 - Crash when saving file with imported text
Summary: Crash when saving file with imported text
Status: RESOLVED FIXED
Alias: None
Product: calligrawords
Classification: Applications
Component: general (show other bugs)
Version: 2.4.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Calligra Words Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 11:18 UTC by raoul maher
Modified: 2012-08-25 15:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (7.29 KB, text/plain)
2012-08-19 12:04 UTC, Irina Rempt
Details
500 word plain text file made by Kate that reliably causes the crash (2.55 KB, application/octet-stream)
2012-08-19 12:13 UTC, Irina Rempt
Details
backtrace generated after installing more debug symbols (2.01 KB, text/plain)
2012-08-19 12:30 UTC, Irina Rempt
Details
console output while reproducing crash (1.05 KB, text/plain)
2012-08-19 12:33 UTC, Irina Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description raoul maher 2012-04-27 11:18:14 UTC
Application: calligrawords (2.4.0)
KDE Platform Version: 4.8.2 (4.8.2)
Qt Version: 4.8.1
Operating System: Linux 3.2.0-24-generic i686
Distribution: Ubuntu 12.04 LTS

-- Information about the crash:
After having just exported a pdf to text using Adobe Reader - I imported the created text file into Calligra Words and it opened ok - however when I tried to save the displayed file as an ODT text file it crashed the same thing happened all three times I attempted this.

The crash can be reproduced every time.

-- Backtrace:
Application: Calligra Words (calligrawords), signal: Segmentation fault
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0xb7706740 (LWP 15237))]

Thread 4 (Thread 0xb62b7b40 (LWP 15240)):
#0  0x020898ba in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#1  0x020fa0ac in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0x020fa3c8 in g_mutex_unlock () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0x020baf10 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0x020bb52b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0x02f46134 in ?? () from /usr/lib/i386-linux-gnu/gio/modules/libdconfsettings.so
#6  0x020de673 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#7  0x006ced4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#8  0x0022cace in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 3 (Thread 0xb58ffb40 (LWP 15241)):
#0  0x006e8416 in __kernel_vsyscall ()
#1  0x0021e380 in poll () from /lib/i386-linux-gnu/libc.so.6
#2  0x020c8a3b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0x020bb06e in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0x020bb52b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0x02dbf0ea in ?? () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
#6  0x020de673 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#7  0x006ced4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#8  0x0022cace in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 2 (Thread 0xb4effb40 (LWP 15274)):
#0  0x020dec36 in g_thread_self () from /lib/i386-linux-gnu/libglib-2.0.so.0
#1  0x020bb1af in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0x00c568e7 in QEventDispatcherGlib::processEvents (this=0xb45029b8, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#3  0x00c2250d in QEventLoop::processEvents (this=0xb4eff240, flags=...) at kernel/qeventloop.cpp:149
#4  0x00c227a9 in QEventLoop::exec (this=0xb4eff240, flags=...) at kernel/qeventloop.cpp:204
#5  0x00b0b94c in QThread::exec (this=0x95c46f0) at thread/qthread.cpp:501
#6  0x00bffb5d in QInotifyFileSystemWatcherEngine::run (this=0x95c46f0) at io/qfilesystemwatcher_inotify.cpp:248
#7  0x00b0ede0 in QThreadPrivate::start (arg=0x95c46f0) at thread/qthread_unix.cpp:298
#8  0x006ced4c in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#9  0x0022cace in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 1 (Thread 0xb7706740 (LWP 15237)):
[KCrash Handler]
#7  0x00274407 in ?? () from /lib/i386-linux-gnu/libc.so.6
#8  0x006c0d67 in node_copy (src=0xd7fd84, to=0xaf1d957c, from=0xabbda01c, this=<optimized out>) at /usr/include/i386-linux-gnu/bits/string3.h:52
#9  QList<KUndo2Command*>::detach_helper_grow (this=0x8f2a908, i=14155096, c=1) at /usr/include/qt4/QtCore/qlist.h:681
#10 0x006c0e3f in QList<KUndo2Command*>::append (this=0x8f2a908, t=@0xbfcb92bc: 0x9a545f8) at /usr/include/qt4/QtCore/qlist.h:510
#11 0x006c0284 in KUndo2Command::KUndo2Command (this=0x9a545f8, text=..., parent=0x8f0fa20) at /build/buildd/calligra-2.4.0/libs/kundo2/kundo2stack.cpp:119
#12 0x01b0bfbb in UndoTextCommand (parent=<optimized out>, p=0x909cb28, document=0x8f126d0, this=0x9a545f8) at /build/buildd/calligra-2.4.0/libs/kotext/KoTextEditor_undo.cpp:90
#13 KoTextEditor::Private::documentCommandAdded (this=0x909cb28) at /build/buildd/calligra-2.4.0/libs/kotext/KoTextEditor_undo.cpp:149
#14 0x01b08250 in qt_static_metacall (_a=0xbfcb9570, _id=96, _o=0x90ad290, _c=<optimized out>) at /build/buildd/calligra-2.4.0/obj-i686-linux-gnu/libs/kotext/KoTextEditor.moc:364
#15 KoTextEditor::qt_static_metacall (_o=0x90ad290, _c=QMetaObject::InvokeMetaMethod, _id=96, _a=0xbfcb9570) at /build/buildd/calligra-2.4.0/obj-i686-linux-gnu/libs/kotext/KoTextEditor.moc:229
#16 0x00c3a6b1 in QMetaObject::activate (sender=0x8f126d0, m=0x1aadd04, local_signal_index=4, argv=0x0) at kernel/qobject.cpp:3547
#17 0x01857f85 in QTextDocument::undoCommandAdded (this=0x8f126d0) at .moc/release-shared/moc_qtextdocument.cpp:228
#18 0x013eb2e3 in endEditBlock (this=0x90877c8) at text/qtextdocument_p.cpp:1195
#19 QTextDocumentPrivate::endEditBlock (this=0x90877c8) at text/qtextdocument_p.cpp:1184
#20 0x013eb84e in QTextDocumentPrivate::setBlockFormat (this=0x90877c8, from=..., to=..., newFormat=..., mode=QTextDocumentPrivate::MergeFormat) at text/qtextdocument_p.cpp:827
#21 0x01412b72 in QTextCursorPrivate::setBlockFormat (this=0x8f74918, format=..., changeMode=QTextDocumentPrivate::MergeFormat) at text/qtextcursor.cpp:825
#22 0x01414c15 in QTextCursor::mergeBlockFormat (this=0xbfcb988c, modifier=...) at text/qtextcursor.cpp:1814
#23 0x032fe756 in KWOdfWriter::save (this=0xbfcb9908, odfStore=..., embeddedSaver=...) at /build/buildd/calligra-2.4.0/words/part/KWOdfWriter.cpp:311
#24 0x032d1f37 in KWDocument::saveOdf (this=0x8eabcc0, documentContext=...) at /build/buildd/calligra-2.4.0/words/part/KWDocument.cpp:757
#25 0x00342485 in KoDocument::saveNativeFormatODF (this=0x8eabcc0, store=0x9a447a0, mimeType=...) at /build/buildd/calligra-2.4.0/libs/main/KoDocument.cpp:919
#26 0x00343524 in KoDocument::saveNativeFormat (this=0x8eabcc0, file=...) at /build/buildd/calligra-2.4.0/libs/main/KoDocument.cpp:903
#27 0x00341185 in KoDocument::saveFile (this=0x8eabcc0) at /build/buildd/calligra-2.4.0/libs/main/KoDocument.cpp:542
#28 0x00548504 in KParts::ReadWritePart::save (this=0x8eabcc0) at ../../kparts/part.cpp:878
#29 0x00547630 in KParts::ReadWritePart::saveAs (this=0x8eabcc0, kurl=...) at ../../kparts/part.cpp:899
#30 0x00372936 in KoMainWindow::saveDocument (this=0x8ef81b0, saveas=false, silent=false) at /build/buildd/calligra-2.4.0/libs/main/KoMainWindow.cpp:968
#31 0x0036b825 in KoMainWindow::slotFileSaveAs (this=0x8ef81b0) at /build/buildd/calligra-2.4.0/libs/main/KoMainWindow.cpp:1251
#32 0x0037044d in qt_static_metacall (_a=0xbfcba1a8, _id=10, _o=0x8ef81b0, _c=<optimized out>) at /build/buildd/calligra-2.4.0/obj-i686-linux-gnu/libs/main/KoMainWindow.moc:121
#33 KoMainWindow::qt_static_metacall (_o=0x8ef81b0, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0xbfcba1a8) at /build/buildd/calligra-2.4.0/obj-i686-linux-gnu/libs/main/KoMainWindow.moc:105
#34 0x00c3a6b1 in QMetaObject::activate (sender=0x8ec14c8, m=0x1a9a3f8, local_signal_index=1, argv=0xbfcba1a8) at kernel/qobject.cpp:3547
#35 0x0111b9bd in QAction::triggered (this=0x8ec14c8, _t1=false) at .moc/release-shared/moc_qaction.cpp:277
#36 0x0111bc5b in QAction::activate (this=0x8ec14c8, event=QAction::Trigger) at kernel/qaction.cpp:1257
#37 0x0111bfb8 in trigger (this=0x8ec14c8) at kernel/qaction.h:218
#38 qt_static_metacall (_a=0x9b99a30, _id=8, _o=0x8ec14c8, _c=<optimized out>) at .moc/release-shared/moc_qaction.cpp:151
#39 QAction::qt_static_metacall (_o=0x8ec14c8, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0x9b99a30) at .moc/release-shared/moc_qaction.cpp:137
#40 0x00c35c01 in QMetaCallEvent::placeMetaCall (this=0x9b9d538, object=0x8ec14c8) at kernel/qobject.cpp:525
#41 0x00c3ec7b in QObject::event (this=0x8ec14c8, e=0x9b9d538) at kernel/qobject.cpp:1195
#42 0x0111bd31 in event (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1187
#43 QAction::event (this=0xad1d0230, e=0x2375f98) at kernel/qaction.cpp:1172
#44 0x01d17aff in KAction::event (this=0x8ec14c8, event=0x9b9d538) at ../../kdeui/actions/kaction.cpp:131
#45 0x01122ed4 in notify_helper (e=0x9b9d538, receiver=0x8ec14c8, this=0x8cd1838) at kernel/qapplication.cpp:4559
#46 QApplicationPrivate::notify_helper (this=0x8cd1838, receiver=0x8ec14c8, e=0x9b9d538) at kernel/qapplication.cpp:4531
#47 0x0112830d in QApplication::notify (this=0x9b9d538, receiver=0x8ec14c8, e=0x9b9d538) at kernel/qapplication.cpp:4288
#48 0x01e1db21 in KApplication::notify (this=0xbfcbaa9c, receiver=0x8ec14c8, event=0x9b9d538) at ../../kdeui/kernel/kapplication.cpp:311
#49 0x00c2397e in QCoreApplication::notifyInternal (this=0xbfcbaa9c, receiver=0x8ec14c8, event=0x9b9d538) at kernel/qcoreapplication.cpp:876
#50 0x00c27ad8 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#51 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x8c7d370) at kernel/qcoreapplication.cpp:1500
#52 0x00c27e0c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1393
#53 0x00c56494 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#54 postEventSourceDispatch (s=0x8ccfee8) at kernel/qeventdispatcher_glib.cpp:279
#55 0x020bacda in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#56 0x020bb0e5 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#57 0x020bb1c1 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#58 0x00c56887 in QEventDispatcherGlib::processEvents (this=0x8c7def0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#59 0x011dbaaa in QGuiEventDispatcherGlib::processEvents (this=0x8c7def0, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#60 0x00c2250d in QEventLoop::processEvents (this=0xbfcbaa24, flags=...) at kernel/qeventloop.cpp:149
#61 0x00c227a9 in QEventLoop::exec (this=0xbfcbaa24, flags=...) at kernel/qeventloop.cpp:204
#62 0x00c27eba in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#63 0x01120a74 in QApplication::exec () at kernel/qapplication.cpp:3820
#64 0x007d6f7d in kdemain (argc=2, argv=0xbfcbaba4) at /build/buildd/calligra-2.4.0/words/part/main.cpp:43
#65 0x0804850b in main (argc=2, argv=0xbfcbaba4) at /build/buildd/calligra-2.4.0/obj-i686-linux-gnu/words/part/calligrawords_dummy.cpp:3

Possible duplicates by query: bug 291166.

Reported using DrKonqi
Comment 1 Gopalakrishna Bhat 2012-08-04 05:44:40 UTC
Can you please attach the text document that you opened in calligrawords.
Comment 2 Irina Rempt 2012-08-19 12:04:47 UTC
Created attachment 73291 [details]
New crash information added by DrKonqi

calligrawords (2.5.0) on KDE Platform 4.9.00 "release 558" using Qt 4.8.2

- What I was doing when the application crashed:

I opened a plain text file with Calligra Words 2.5.0, could do everything I wanted to it (edit, apply styles), then it crashed when it tried to save it. This happened with a very long text file (560K) and also when I tested with a 500-word plain text file.

Also, when I first created and saved a new .odt document and imported the plain text file into it, it crashed on saving.

Words doesn't crash when I copy text from the text file and paste it into the .odt document, neither with normal paste nor with "paste as text".

-- Backtrace (Reduced):
#6  QList<KUndo2Command*>::append (this=0xffffffff00000001, t=@0x7fffcf5ff488) at /usr/include/QtCore/qlist.h:509
#7  0x00007fd9c452d472 in KUndo2Command::KUndo2Command (this=0x23ca660, text=..., parent=0x10d26a0) at /usr/src/debug/calligra-2.5.0/libs/kundo2/kundo2stack.cpp:119
#8  0x00007fd9c4dd15d5 in UndoTextCommand (parent=0x10d26a0, p=0x10d2a00, document=0x1093da0, this=0x23ca660) at /usr/src/debug/calligra-2.5.0/libs/kotext/KoTextEditor_undo.cpp:90
#9  KoTextEditor::Private::documentCommandAdded (this=0x10d2a00) at /usr/src/debug/calligra-2.5.0/libs/kotext/KoTextEditor_undo.cpp:149
#10 0x00007fd9c4dcdc46 in qt_static_metacall (_a=0x7fffcf5ff980, _id=<optimized out>, _o=0x10d29e0, _c=<optimized out>) at /usr/src/debug/calligra-2.5.0/build/libs/kotext/KoTextEditor.moc:399
Comment 3 Irina Rempt 2012-08-19 12:13:32 UTC
Created attachment 73292 [details]
500 word plain text file made by Kate that reliably causes the crash

This is the smallest plain text file I've tested the crash with; any larger plain text files I tried (largest was 560K) caused Words to crash on saving too.
Comment 4 Irina Rempt 2012-08-19 12:30:36 UTC
Created attachment 73294 [details]
backtrace generated after installing more debug symbols
Comment 5 Irina Rempt 2012-08-19 12:33:50 UTC
Created attachment 73295 [details]
console output while reproducing crash
Comment 6 Irina Rempt 2012-08-22 13:11:37 UTC
(In reply to comment #3)
> This is the smallest plain text file I've tested the crash with; any larger
> plain text files I tried (largest was 560K) caused Words to crash on saving
> too.

Also crashes when saving a document which has original text and imported text (create a document; type some text; save; import some additional text; try to save: crash)
Comment 7 Camilla Boemann 2012-08-22 13:51:08 UTC
Ok i can reproduce now - import thing is to use the import menu item, and not just paste the text in
Comment 8 Camilla Boemann 2012-08-22 14:51:26 UTC
Git commit 02473ff77fe7f85d49e69db72e635afc2a7bb861 by C. Boemann.
Committed on 22/08/2012 at 16:44.
Pushed by boemann into branch 'master'.

We shouldn't modify the document on saving, by adding a masterpagename to first paragraph
which is not what the user would expect. Think if the user would later on copy paste this paragraph
to somewhere in the middle of another master page. That would copy the masterpagename to causing an
unwanted pagebreak and masterpage change

This was originally added in 9472dc5b to fix pagestyle not being saved, but a quick check
shows that the original bug https://bugs.kde.org/show_bug.cgi?id=184858 is not reopenend by
removing this code now.

M  +0    -8    words/part/KWOdfWriter.cpp

http://commits.kde.org/calligra/02473ff77fe7f85d49e69db72e635afc2a7bb861
Comment 9 Camilla Boemann 2012-08-25 15:11:31 UTC
Git commit 049ed76921986fc1713604fc453bdf40656d750a by C. Boemann.
Committed on 22/08/2012 at 16:44.
Pushed by boemann into branch 'calligra/2.5'.

We shouldn't modify the document on saving, by adding a masterpagename to first paragraph
which is not what the user would expect. Think if the user would later on copy paste this paragraph
to somewhere in the middle of another master page. That would copy the masterpagename to causing an
unwanted pagebreak and masterpage change

This was originally added in 9472dc5b to fix pagestyle not being saved, but a quick check
shows that the original bug https://bugs.kde.org/show_bug.cgi?id=184858 is not reopenend by
removing this code now.

M  +0    -8    words/part/KWOdfWriter.cpp

http://commits.kde.org/calligra/049ed76921986fc1713604fc453bdf40656d750a