Bug 240874

Summary: Konqueror's bookmark editor crashes when importing bookmarks
Product: [Applications] keditbookmarks Reporter: Rosetzky Cedric <loacoon>
Component: generalAssignee: Konqueror Bugs <konqueror-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: ingo, jjm, jussi01, madoxxx, Stefan.Borggraefe
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Rosetzky Cedric 2010-06-06 11:24:35 UTC
Application: keditbookmarks (4.4.82 (KDE 4.4.82 (KDE 4.5 >= 20100601)))
KDE Platform Version: 4.4.82 (KDE 4.4.82 (KDE 4.5 >= 20100601)) (Compiled from sources)
Qt Version: 4.6.2
Operating System: Linux 2.6.32-gentoo-r7 i686
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:

I tried to import bookmark.xml file via Konqueror's bookmark editor. The editor crashed after asking me if I want to replace existing bookmarks or add in a new folder.

The crash can be reproduced every time.

-- Backtrace:
Application: Éditeur de signet (keditbookmarks), signal: Aborted
[KCrash Handler]
#7  0xffffe424 in __kernel_vsyscall ()
#8  0xb5b5f6e0 in raise () from /lib/libc.so.6
#9  0xb5b60f15 in abort () from /lib/libc.so.6
#10 0xb5fb68a5 in qt_message_output(QtMsgType, char const*) () from /usr/lib/qt4/libQtCore.so.4
#11 0xb5fb6a6e in ?? () from /usr/lib/qt4/libQtCore.so.4
#12 0xb5fb6b79 in qFatal(char const*, ...) () from /usr/lib/qt4/libQtCore.so.4
#13 0xb5fb6c05 in qt_assert(char const*, char const*, int) () from /usr/lib/qt4/libQtCore.so.4
#14 0xb7808309 in CommandHistory::commandExecuted (this=0x81cbbb8, k=0x8417380) at /home/loacoon/Documents/Downloads/SVN/KDE4/KDE/kdebase/apps/keditbookmarks/kbookmarkmodel/commandhistory.cpp:86
#15 0xb7808416 in CommandHistory::addCommand (this=0x81cbbb8, cmd=0x8417380) at /home/loacoon/Documents/Downloads/SVN/KDE4/KDE/kdebase/apps/keditbookmarks/kbookmarkmodel/commandhistory.cpp:104
#16 0xb7830bc8 in ActionsImpl::slotImport (this=0x81d1648) at /home/loacoon/Documents/Downloads/SVN/KDE4/KDE/kdebase/apps/keditbookmarks/actionsimpl.cpp:413
#17 0xb7831e8c in ActionsImpl::qt_metacall (this=0x81d1648, _c=QMetaObject::InvokeMetaMethod, _id=25, _a=0xbffdea6c)
    at /home/loacoon/Documents/Downloads/SVN/KDE4/build/kdebase/apps/keditbookmarks/actionsimpl.moc:142
#18 0xb60c7855 in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/qt4/libQtCore.so.4
#19 0xb60d6303 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/qt4/libQtCore.so.4
#20 0xb65dd239 in QAction::triggered(bool) () from /usr/lib/qt4/libQtGui.so.4
#21 0xb65df4df in QAction::activate(QAction::ActionEvent) () from /usr/lib/qt4/libQtGui.so.4
#22 0xb6a6fffc in ?? () from /usr/lib/qt4/libQtGui.so.4
#23 0xb6a7620b in ?? () from /usr/lib/qt4/libQtGui.so.4
#24 0xb6a771e2 in QMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/qt4/libQtGui.so.4
#25 0xb71fbe42 in KMenu::mouseReleaseEvent (this=0x81fbba0, e=0xbffdf47c) at /home/loacoon/Documents/Downloads/SVN/KDE4/KDE/kdelibs/kdeui/widgets/kmenu.cpp:471
#26 0xb6642190 in QWidget::event(QEvent*) () from /usr/lib/qt4/libQtGui.so.4
#27 0xb6a78927 in QMenu::event(QEvent*) () from /usr/lib/qt4/libQtGui.so.4
#28 0xb65e3bac in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/qt4/libQtGui.so.4
#29 0xb65ebb43 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/qt4/libQtGui.so.4
#30 0xb7104add in KApplication::notify (this=0xbffdfbec, receiver=0x81fbba0, event=0xbffdf47c) at /home/loacoon/Documents/Downloads/SVN/KDE4/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#31 0xb60c250b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/qt4/libQtCore.so.4
#32 0xb65eab11 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/qt4/libQtGui.so.4
#33 0xb6675781 in ?? () from /usr/lib/qt4/libQtGui.so.4
#34 0xb6674a9c in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/qt4/libQtGui.so.4
#35 0xb669f862 in ?? () from /usr/lib/qt4/libQtGui.so.4
#36 0xb562fbc8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#37 0xb5633353 in ?? () from /usr/lib/libglib-2.0.so.0
#38 0x08066a98 in ?? ()
#39 0x00000000 in ?? ()

Reported using DrKonqi
Comment 1 Maksim Orlovich 2010-06-06 17:05:43 UTC
Did you answer a certain way?

Also, anything interesting about the bookmarks.xml you were using (e.g. what was its source?)
Comment 2 Rosetzky Cedric 2010-06-06 17:54:42 UTC
I answered to replace the existing bookmarks.

The bookmarks.xml file came from another KDE 4 install. When placing this file into ~/.kde manually, it worked perfectly.
Comment 3 Maksim Orlovich 2010-06-09 17:34:41 UTC
Worked for me (though replacing the file with itself has... rather undesirable results).
Comment 4 Jonathan Marten 2010-06-18 18:38:52 UTC
Regarding comments #1/#2: The same happens (identical message and backtrace) if answering "import the bookmarks into a new folder".
Comment 5 Jonathan Marten 2010-06-18 19:15:11 UTC
The problem assert is in CommandHistory::commandExecuted(const QUndoCommand *k):

    const IKEBCommand * cmd = dynamic_cast<const IKEBCommand *>(k);
    Q_ASSERT(cmd);

The dynamic_cast here returns NULL.
Comment 6 Tommi Tervo 2010-06-19 14:43:39 UTC
*** Bug 242166 has been marked as a duplicate of this bug. ***
Comment 7 madoxxx 2010-06-23 12:56:45 UTC
Created attachment 48259 [details]
New crash information added by DrKonqi

keditbookmarks (4.4.85 (KDE 4.4.85 (KDE 4.5 Beta2))) on KDE Platform 4.4.85 (KDE 4.4.85 (KDE 4.5 Beta2)) using Qt 4.7.0

- What I was doing when the application crashed:

Importing bookmarks from Firefox 3.6 into Konqueror

-- Backtrace (Reduced):
#6  CommandHistory::commandExecuted (this=0x12f2c90, k=0x0) at ../../../../apps/keditbookmarks/kbookmarkmodel/commandhistory.cpp:88
#7  0x00007fee86bb99ee in ActionsImpl::slotImport (this=0x1386330) at ../../../apps/keditbookmarks/actionsimpl.cpp:413
#8  0x00007fee86bbb35e in ActionsImpl::qt_metacall (this=0x1386330, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=<value optimized out>) at ./actionsimpl.moc:142
[...]
#10 0x00007fee84b381a2 in QAction::triggered (this=0x0, _t1=false) at .moc/release-shared/moc_qaction.cpp:263
#11 0x00007fee84b3989b in QAction::activate (this=0x1395360, event=<value optimized out>) at kernel/qaction.cpp:1256
Comment 8 Christoph Feck 2010-06-26 17:55:39 UTC
*** Bug 242301 has been marked as a duplicate of this bug. ***
Comment 9 Maksim Orlovich 2010-06-26 18:10:23 UTC
Perhaps the following helps? (The bug isn't reproducible for me, likely because of non-visibility-hidden build, so I can't confirm myself)

--- kbookmarkmodel/commands.h   (revision 1143103)
+++ kbookmarkmodel/commands.h   (working copy)
@@ -30,7 +30,7 @@
 // affected by executing or unexecuting the command
 // Or a common parent of the affected bookmarks
 // see KBookmarkManager::notifyChange(KBookmarkGroup)
-class IKEBCommand
+class KBOOKMARKMODEL_EXPORT IKEBCommand
 {
 public:
    IKEBCommand() {}
Comment 10 Jonathan Marten 2010-06-26 19:09:06 UTC
Patch in comment #9 works for me (with current trunk).

(not even going to think about trying to work out how symbol visibility interacts with dynamic_cast...)
Comment 11 Jonathan Marten 2010-06-26 19:19:56 UTC
Aha, just found http://gcc.gnu.org/wiki/Visibility, last line of section "Problems with C++ exceptions".
Comment 12 Maksim Orlovich 2010-06-26 19:26:54 UTC
SVN commit 1143147 by orlovich:

We need to export this since it's used in a dcast, which need the typeinfo nodes to be global.
Should fix crashes on importing bookmarks.

Credit to  Jonathan Marten for much of diagnosis and the testing.

BUG: 240874


 M  +1 -1      commands.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1143147
Comment 13 Maksim Orlovich 2010-06-30 15:25:25 UTC
*** Bug 243236 has been marked as a duplicate of this bug. ***