Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67745 - Kdevelop crashes loading a c++ project on amd64
Summary: Kdevelop crashes loading a c++ project on amd64
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High critical
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 67961 (view as bug list)
Depends on:
Blocks: 61872
  Show dependency tree
 
Reported: 2004-10-15 22:35 UTC by Mike McLean
Modified: 2005-01-16 06:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike McLean 2004-10-15 22:35:51 UTC
Kdevelop 3.1.0 and 3.1.1 crash the first time you load a c++ project during a session.  The second time you load the project it works properly.

Reproducible: Always
Steps to Reproduce:
1. Open an existing c++ project within kdevelop by going to Project -> Open Project
2. Or you can run a copy of kdevelop which restores a project that was opened during the last session.
3.

Actual Results:  
It crashes after seemingly loading all the open files in the c++ project and
brings up the KDE crash handler.

Expected Results:  
It should load the project and allow the user to begin working.

I have a fix for this problem which was given to me by the kdevelop programmers
in #kdevelop on irc.freenode.net.  The fix has been committed to CVS HEAD, but
did not make it into the recent 3.1.1 release.

Below is the patch, which I have tested with a customized ebuild:

diff -uar kdevelop-3.1.1/languages/cpp/cppsupportpart.cpp
kdevelop-3.1.1.bak/languages/cpp/cppsupportpart.cpp
--- kdevelop-3.1.1/languages/cpp/cppsupportpart.cpp     2004-08-05
12:27:58.000000000 -0700
+++ kdevelop-3.1.1.bak/languages/cpp/cppsupportpart.cpp 2004-10-15
21:23:33.386401720 -0700
@@ -968,7 +968,7 @@
                        for( int i=0; i<numFiles; ++i ){
                        QString fn;
                        uint ts;
-                       Q_LONG offset;
+                       uint offset;

                        _jd->stream >> fn >> ts >> offset;
                        _jd->pcs[ fn ] = qMakePair( ts, offset );
@@ -1504,7 +1504,7 @@
     createIgnorePCSFile();

     QDataStream stream( &f );
-    QMap<QString, Q_ULONG> offsets;
+    QMap<QString, uint> offsets;

     QString pcs( "PCS" );
     stream << pcs << KDEV_PCS_VERSION;
@@ -1518,7 +1518,7 @@
   stream << dom->name() << toTime_t(m_timestamp[ dom->name() ]);
 #endif
        offsets.insert( dom->name(), stream.device()->at() );
-       stream << (Q_ULONG)0; // dummy offset
+       stream << (uint)0; // dummy offset
     }

     for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
Only in kdevelop-3.1.1.bak/languages/cpp: cppsupportpart.cpp.orig
diff -uar kdevelop-3.1.1/languages/cpp/cppsupportpart.h
kdevelop-3.1.1.bak/languages/cpp/cppsupportpart.h
--- kdevelop-3.1.1/languages/cpp/cppsupportpart.h       2004-07-17
12:13:56.000000000 -0700
+++ kdevelop-3.1.1.bak/languages/cpp/cppsupportpart.h   2004-10-15
21:23:33.386401720 -0700
@@ -232,7 +232,7 @@
                QProgressBar * progressBar;
                QStringList::Iterator it;
                QStringList files;
-               QMap< QString, QPair<uint, Q_LONG> > pcs;
+               QMap< QString, QPair<uint, uint> > pcs;
                QDataStream stream;
                QFile file;
Comment 1 Simone Gotti (RETIRED) gentoo-dev 2004-10-18 02:10:07 UTC
*** Bug 67961 has been marked as a duplicate of this bug. ***
Comment 2 Gregorio Guidi (RETIRED) gentoo-dev 2005-01-16 06:25:25 UTC
The fix went into kdevelop-3.1.2, so this can be closed now.