AW: Kdevelop can only be started twice

Micko Roland Roland.Micko at icn.siemens.de
Thu Jun 17 08:09:07 BST 1999


Hi Jonas,

I've been investigating the problem, and it seems to be a problem of the
file classes.db.
Here is what i found out.

1. I was able to start it twice, as one instance has been started from KWM
and the second from the commandline, where the working directory is
different from my home directory.

2. Each time a project is opened the file classes.db is also opened.I don't
have any information about gdbm_open so I don't have a glue about the
parameters that are used, but I guess that the file is opened exclusiv. So
If you try to open it once again with a second instance of KDevelop that
tries to access the same file, the call is unsucessfull. So any further
access to this file leads to the assertion error. As there is information of
already known classes stored, it has to be opened exclusiv or you must use
file locking mechanism to inhibit concurrent read, writes on the file.

I think this is also the solution to the thread >> A really huge bug <<.

I myself changed the code so the file is created for each instance of
KDevelop with the name classes.db.<pid>. This is not what you intended but
it is a quick and dirty solution which helps me to continue to work.

I changed the constructor of CClassStore to

CClassStore::CClassStore()
  : classIterator( classes )
{
  char achFileName[256]; <--

  sprintf ( achFileName, "classes.db.%i", getpid ( ) ); <--

  classes.setAutoDelete( true );

  // Initialize the persistant class store.

  globalStore.setFilename( achFileName ); <--

  // Open the store if it exists, else create it.

  if( globalStore.exists() )

    globalStore.open();

  else

    globalStore.create();

}

I hope this helps

Roland Micko
ICN CA MR EG 2

SIEMENS AG
Hofmannstr. 51
81359 München

Tel.: +4989/722-21632
Fax.: +4989/722-47420
email: roland.micko at icn.siemens.de

> -----Ursprüngliche Nachricht-----
> Von:	Jonas Nordin [SMTP:jonas.nordin at cenacle.se]
> Gesendet am:	Dienstag, 15. Juni 1999 18:09
> An:	kdevelop at fara3.cs.uni-potsdam.de
> Betreff:	Re: Kdevelop can only be started twice
> 
> > Hi Roland!
> > 
> > KDevelop uses a DataBase and i think the problem is that if you start
> kdevelop
> > twice kdevelop would try to open the database again. And here is the
> reason
> > why  kdevelop crash.
> 
> I've started to add support for storing parsed classes(so they don't need
> to be
> reparsed at startup). Perhaps it has something todo with gdbm?
> 
> /J



More information about the KDevelop mailing list