Bug#2343: Crash on "Project | Add Existing Files..."
Petur Runolfsson
peturr at rhi.hi.is
Thu Nov 25 19:20:06 UTC 1999
Package: kdevelop
Version: 1.0beta4.1
Severity: grave
Bugreport ID : 15:51,25.11.99
Originator : Pétur Runólfsson
E-Mail : peturr at hi.is
Subject : Crash on "Project | Add Existing Files..."
Error Class : software bug
Error Location : I don´t know
Priority : high
Bug Description ---------------------------
================================================
Note:
Since I wrote the following I have looked at the list of outstanding
bugs at the KDevelop web site and I think that three of four
bugs with severity: critical are indeed the one and the same as
this one, as well as several with severity: grave.
My test case however differs from all those bug reports in two
aspects:
1) The namespace in question is unnamed
2) I did not always get a crash, indeed I have been able to
build and run programs that include this code. I have
however sometimes witnessed another effect where the link
process fails, but the IDE remains stable.
================================================
KDevelop sometimes crashes following the
Project | Add Existing Files... command. When this happens, the
corresponding dialog is shown. Everything works as expected,
including the browse button. When I click the OK button to add the
files KDevelop starts processing, then suddenly disappears.
How to repeat the error -------------------
I constructed a test case that sometimes reproduces the bug:
Given are two files to insert:
ipipestream.h:
=============================================
/***************************************************************************
ipipestream.h - description
-------------------
begin : Wed Nov 24 1999
copyright : (C) 1999 by Pétur Runólfsson
email : peturr at hi.is
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef IPIPESTREAM_H
#define IPIPESTREAM_H
#include <stdiostream.h>
class IPipeStream : public istdiostream
{
public:
IPipeStream(const char* command);
~IPipeStream();
};
#endif
===============================================
ipipestream.cpp:
===============================================
/***************************************************************************
ipipestream.cpp - description
-------------------
begin : Wed Nov 24 1999
copyright : (C) 1999 by Pétur Runólfsson
email : peturr at hi.is
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "ipipestream.h"
namespace
{
FILE* open_pipe(const char* command, const char* type)
{
FILE* pipe = popen(
const_cast<char*>(command),
const_cast<char*>(type)
);
if (!pipe)
{
perror("popen");
throw 1;
}
return pipe;
}
};
IPipeStream::IPipeStream(const char* command)
: istdiostream(open_pipe(command, "r"))
{
}
IPipeStream::~IPipeStream()
{
pclose(rdbuf()->stdiofile());
}
=============================================
These files reside in /tmp
Then I opened KDevelop, selected Project | New..., chose
KDE | Normal as the type, default values for all other options.
Immediately after the project was created I selected
Project | Add Existing Files... and selected ipipestream.cpp and
ipipestream.h, clicked on OK with other options on their defaults
and watched KDevelop crash.
I then opened KDevelop again and opened the same project.
I then selected Project | Add Existing Files... and chose the same
files again. KDevelop then asked whether I wanted to overwrite
ipipestream.cpp, but did not ask about ipipestream.h so I assume
that the crash happened while KDevelop was processing the .cpp
file.
I tried to create a minimal test case out of this information.
* Trying to add just the .cpp file did not lead to a crash
* Commenting out the definitions of the class and it's members
but nothing else still caused a crash.
* Removing the class and it's members completely left files that did
not cause a crash.
* Restoring the files back to the originals did not bring the crash
back again.
* Saving the .h file without changing it brought back the crash
* Removing the headers from the files got rid of the crash
* Bringing the headers back again did not bring the crash back
In other words, I have neither found necessary nor sufficient
conditions to reproduce the bug. My best guesses for the cause
are however
* An I/O error. A low level I/O function either calls exit() or abort() or
throws an exception that isn't caught.
* An error in the code that parses the files after adding to generate
information for the class tree. An unnamed namespace in the .cpp
test file is the newest language feature used and thus the most
likely to cause trouble.
Bugfix or Workaround ----------------------
System Information ------------------------
KDevelop version : 1.0beta4.1
KDE version : 1.1.2
QT version : 1.44
OS/Distribution : Linux (kernel 2.2.5) / RedHat 6.0
Compiler : egcs-2.91.66
misc :
More information about the KDevelop-devel
mailing list