Bug 63973 - I create Fortran project, add long source files, close gideon. Open gideon - it crashes on fortran parser.
Summary: I create Fortran project, add long source files, close gideon. Open gideon - ...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
: 69433 76273 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-09 19:38 UTC by Evgeniy Shapiro
Modified: 2004-03-29 16:09 UTC (History)
2 users (show)

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 Evgeniy Shapiro 2003-09-09 19:38:08 UTC
Version:           3.0 alpha 5 (using KDE KDE 3.1.1)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2.2 
OS:          Linux

Gideon crashes on an attempt to parse a long fortran source file at startup. Fortran project is created normally, then fortran source file is added to the project. All works fine, but the next time I start gideon  - it crashes.

Messages:
kdevelop (fortran support): maybe parse <file name>

kde trace:
0x414b4f29 in wait4 () from /lib/libc.so.6
#0  0x414b4f29 in wait4 () from /lib/libc.so.6
#1  0x41535234 in sys_sigabbrev () from /lib/libc.so.6
#2  0x412cb103 in waitpid () from /lib/libpthread.so.0
#3  0x40a2bc4d in KCrash::defaultCrashHandler(int) ()
   from /opt/kde/lib/libkdecore.so.4
#4  0x41430b48 in sigaction () from /lib/libc.so.6
#5  0x414c48d8 in regexec () from /lib/libc.so.6
#6  0x40a37043 in KRegExpPrivate::match(char const*) ()
   from /opt/kde/lib/libkdecore.so.4
#7  0x40a373b8 in KRegExp::match(char const*) ()
   from /opt/kde/lib/libkdecore.so.4
#8  0x4202ed37 in FixedFormParser::process(QCString const&, QString const&, int) () from /opt/kde/lib/kde3/libkdevfortransupport.so
#9  0x4202f11f in FixedFormParser::parse(QString const&) ()
   from /opt/kde/lib/kde3/libkdevfortransupport.so
#10 0x4202d1bd in FortranSupportPart::maybeParse(QString) ()
   from /opt/kde/lib/kde3/libkdevfortransupport.so
#11 0x4202d42c in FortranSupportPart::initialParse() ()
   from /opt/kde/lib/kde3/libkdevfortransupport.so
#12 0x4202e091 in FortranSupportPart::qt_invoke(int, QUObject*) ()
   from /opt/kde/lib/kde3/libkdevfortransupport.so
#13 0x40da7939 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#14 0x410848b2 in QSignal::signal(QVariant const&) ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#15 0x40dc1af8 in QSignal::activate() ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#16 0x40dc8a93 in QSingleShotTimer::event(QEvent*) ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#17 0x40d498f4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#18 0x40d494e9 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#19 0x409b0c69 in KApplication::notify(QObject*, QEvent*) ()
   from /opt/kde/lib/libkdecore.so.4
#20 0x40d247a3 in QEventLoop::activateTimers() ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#21 0x40d022b8 in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#22 0x40d5d6e6 in QEventLoop::enterLoop() ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#23 0x40d5d588 in QEventLoop::exec() ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#24 0x40d49b21 in QApplication::exec() ()
   from /usr/lib/qt-3.1.1/lib/libqt-mt.so.3
#25 0x0806961c in main ()
#26 0x4141cbb4 in __libc_start_main () from /lib/libc.so.6
Comment 1 Amilcar do Carmo Lucas 2003-11-03 18:24:05 UTC
Can you retest with CVS HEAD?
Comment 2 Amilcar do Carmo Lucas 2003-12-02 22:09:40 UTC
*** Bug 69433 has been marked as a duplicate of this bug. ***
Comment 3 Evgeniy Shapiro 2003-12-04 12:45:14 UTC
Re: Can you retest with CVS HEAD?

Have not done it yet, but tried beta 1 of kdevelop - same problem.
Comment 4 Jens Dagerbo 2004-02-27 14:19:54 UTC
*** Bug 76273 has been marked as a duplicate of this bug. ***
Comment 5 Evgeniy Shapiro 2004-03-23 16:36:30 UTC
Tried the same trick with 3.0.2:
Platform: Slackware 9.1/gcc 3.2.3
Installed from contributed tgz package 

Crash when I try to add  the following fortran file an empty fortran project:
c interface for xns inibs


      SUBROUTINE XNS_INIB(NG,X,Y,Z, USB,IE,JE,KE)
      INCLUDE 'xcominc3.f'
      INCLUDE 'block.f'
      real, dimension (0:IE,0:JE,0:KE,NBLO) :: X,Y,Z
      real, dimension (0:JE,0:KE,NBLO) :: USB
      print *,"I2D = ",i2d
 
      if(i2d.eq.0) then
       print *, "Initializing 3D"
       call XNS_INIB3D(NG,X,Y,Z, USB,IE,JE,KE)
      else
        print *, "Initializing 2D"
        call XNS_INIB2D(NG,X,Y,Z, USB,IE,JE,KE)
      end if
      return
      end

:(
Comment 6 Jens Dagerbo 2004-03-24 04:14:39 UTC
Fixed in CVS.
Comment 7 Jens Dagerbo 2004-03-29 16:09:33 UTC
CVS commit by dagerbo: 

Use QRegExp instead of the deprecated KRegExp. 

Hopefully fixing a few crashes in the process..

CCMAIL: 63973@bugs.kde.org


  M +12 -10    fixedformparser.cpp   1.11.2.1
  M +2 -2      fixedformparser.h   1.3.2.1


--- kdevelop/languages/fortran/fixedformparser.cpp  #1.11:1.11.2.1
@@ -22,7 +22,10 @@ FixedFormParser::FixedFormParser(CodeMod
     m_model = model;
 
-    functionre.compile("(integer|real|logical|complex|character|"
+    functionre.setPattern("(integer|real|logical|complex|character|"
                        "double(precision)?)function([^(]+).*");
-    subroutinere.compile("subroutine([^(]+).*");
+    subroutinere.setPattern("subroutine([^(]+).*");
+
+    functionre.setCaseSensitive( false );
+    subroutinere.setCaseSensitive( false );
 }
 
@@ -30,7 +33,4 @@ FixedFormParser::FixedFormParser(CodeMod
 void FixedFormParser::process(const QCString &line, const QString &fileName, int lineNum)
 {
-    if (line.isEmpty())
-        return;
-
     QCString simplified;
     int l = line.length();
@@ -39,9 +39,11 @@ void FixedFormParser::process(const QCSt
             simplified += line[i];
 
-    QCString name;
-    if (functionre.match(simplified))
-        name = functionre.group(3);
-    else if (subroutinere.match(simplified))
-        name = subroutinere.group(1);
+    if ( simplified.isEmpty() ) return;
+
+    QString name;
+    if (functionre.search(simplified) != -1)
+        name = functionre.cap(3);
+    else if (subroutinere.search(simplified) != -1) 
+        name = subroutinere.cap(1);
     else
         return;

--- kdevelop/languages/fortran/fixedformparser.h  #1.3:1.3.2.1
@@ -15,5 +15,5 @@
 #include <qstring.h>
 #include <qtextstream.h>
-#include <kregexp.h>
+#include <qregexp.h>
 #include <codemodel.h>
 
@@ -30,5 +30,5 @@ private:
     CodeModel* m_model;
     FileDom m_file;
-    KRegExp functionre, subroutinere;
+    QRegExp functionre, subroutinere;
 };