Bug 94587 - Crash on vim embedded editor
Summary: Crash on vim embedded editor
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-07 02:57 UTC by Anne-Marie Mahfouf
Modified: 2004-12-07 19:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anne-Marie Mahfouf 2004-12-07 02:57:33 UTC
Version:           3.3.90 (using KDE 3.3.89 (CVS >= 20041129), compiled sources)
Compiler:          gcc version 3.4.0
OS:                Linux (i686) release 2.6.8.1-12mdk

When you set the editor to Embedded Vim Component, you get a crash when you load a project
We are 2 users experimenting the same bug, one with KDevelop 3.3.1 on Debian unstable and myself. I loaded KDE without any project and changed the editor to Embedded Vim Component. As soon as I load a project, KDevelop crashes.
Comment 1 Anne-Marie Mahfouf 2004-12-07 03:01:40 UTC
backtrace:
Using host libthread_db library "/lib/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 1102456256 (LWP 3061)]
[KCrash handler]
#3  0x42515a6d in Vim::Document::activeWidget ()
   from /usr/lib/kde3/libvimpart.so.0
#4  0x40694f52 in KParts::ReadOnlyPart::openURL () from
   /usr/lib/libkparts.so.2
#5  0x08075fa6 in QValueListPrivate<QString>::insert ()
#6  0x08093e9c in KHTMLPart::metaObject ()
#7  0x08091bb8 in KHTMLPart::metaObject ()
#8  0x4125352c in QObject::activate_signal () from
   /usr/lib/libqt-mt.so.3
#9  0x4159108a in QSignal::signal () from /usr/lib/libqt-mt.so.3
#10 0x4126d6ed in QSignal::activate () from /usr/lib/libqt-mt.so.3
#11 0x41274ed3 in QSingleShotTimer::event () from /usr/lib/libqt-mt.so.3
#12 0x411f6bcf in QApplication::internalNotify () from
   /usr/lib/libqt-mt.so.3
#13 0x411f61ce in QApplication::notify () from /usr/lib/libqt-mt.so.3
#14 0x40d72da3 in KApplication::notify () from /usr/lib/libkdecore.so.4
#15 0x411e6405 in QEventLoop::activateTimers () from
   /usr/lib/libqt-mt.so.3
#16 0x4119fc4b in QEventLoop::processEvents () from
   /usr/lib/libqt-mt.so.3
#17 0x41208f28 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#18 0x41208dd8 in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#19 0x411f6e21 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#20 0x080a24fa in KMdiMainFrm::tileVertically ()
#21 0x419007f8 in __libc_start_main () from /lib/tls/libc.so.6
#22 0x41a22f2c in ?? () from /lib/tls/libc.so.6
Comment 2 Jens Dagerbo 2004-12-07 08:18:15 UTC
This is a dupe of bug #91929, but I guess a WONTFIX in b.k.o won't keep anyone from attempting to use it. Let's keep it open until we specifically disallow usage of vim-part in KDevelop.
Comment 3 Jens Dagerbo 2004-12-07 19:07:54 UTC
CVS commit by dagerbo: 

Don't allow the loading of vim-part into KDevelop. It just crashes.

CCMAIL: 94587-done@bugs.kde.org


  M +19 -12    editorchooser_widget.cpp   1.9
  M +4 -1      editorchooser_widget.h   1.4


--- kdevelop/editors/editor-chooser/editorchooser_widget.cpp  #1.8:1.9
@@ -5,5 +5,4 @@
 #include <kapplication.h>
 #include <kdeversion.h>
-#include <ktrader.h>
 #include <kservice.h>
 #include <kdebug.h>
@@ -17,4 +16,19 @@ EditorChooserWidget::EditorChooserWidget
         : EditChooser(parent, name)
 {
+    // ask the trader which editors he has to offer
+    m_offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
+
+        // remove the vim-part, it's known to crash
+        KTrader::OfferList::Iterator it = m_offers.begin();
+        while( it != m_offers.end() )
+        {
+                if ( (*it)->desktopEntryName() == "vimpart" )
+                {
+                        m_offers.remove( it );
+                        break;
+                }
+                ++it;
+        }
+
     load();
 }
@@ -25,7 +39,4 @@ void EditorChooserWidget::load()
     EditorPart->clear();
 
-    // ask the trader which editors he has to offer
-    KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
-
     // find the editor to use
     KConfig *config = kapp->config();
@@ -36,5 +47,5 @@ void EditorChooserWidget::load()
     KTrader::OfferList::Iterator it;
     int index=-1, current=0;
-    for (it = offers.begin(); it != offers.end(); ++it)
+    for (it = m_offers.begin(); it != m_offers.end(); ++it)
     {
         EditorPart->insertItem((*it)->name());
@@ -69,8 +80,6 @@ void EditorChooserWidget::save()
     config->setGroup("Editor");
 
-    KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
-
     KTrader::OfferList::Iterator it;
-    for (it = offers.begin(); it != offers.end(); ++it)
+    for (it = m_offers.begin(); it != m_offers.end(); ++it)
         if ( EditorPart->currentText() == (*it)->name() )
         {
@@ -102,8 +111,6 @@ void EditorChooserWidget::accept()
 void EditorChooserWidget::slotEditPartChanged( const QString & )
 {
-        KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
-
         KTrader::OfferList::Iterator it;
-        for (it = offers.begin(); it != offers.end(); ++it)
+        for (it = m_offers.begin(); it != m_offers.end(); ++it)
         {
                 if ( EditorPart->currentText() == (*it)->name() )

--- kdevelop/editors/editor-chooser/editorchooser_widget.h  #1.3:1.4
@@ -4,5 +4,5 @@
 
 #include <qwidget.h>
-
+#include <ktrader.h>
 
 #include "editchooser.h"
@@ -27,4 +27,7 @@ private slots:
     void accept();
 
+private:
+        KTrader::OfferList m_offers;
+
 };
 


Comment 4 András Manţia 2004-12-07 19:20:40 UTC
On Tuesday 07 December 2004 20:07, Jens Dagerbo wrote:
> CVS commit by dagerbo:
>
> Don't allow the loading of vim-part into KDevelop. It just crashes.
>

Better warn the user or try to find why it crashes (if it's a KDevelop 
issue).

Andras
Comment 5 Amilcar do Carmo Lucas 2004-12-07 19:24:58 UTC
It's not a KDevelop issue it's a kvim issue.
Please use yzis (www.yzis.org) instead.
Comment 6 Anne-Marie Mahfouf 2004-12-07 19:58:05 UTC
It's a KDevelop issue as KDevelop proposed to load that part. Jens did right with his fix and I thank him for doing it so quickly. I am about to test it as soon as it's compiled.
When the user sees 'Use Vim Embedded Component', he will try it if he likes Vim. So it's bad to leave it as it crashes.  If he sees nothing he cannot try it. When Yzis is ready and when there's some doc (technote) about how to install it in kdevelop, I guess the user will happily use Yzis. In the meantime, it's fine as it is now.