Bug#2343: marked as done (Crash on "Project | Add Existing Files...")

Stephan Kulow owner at bugs.kde.org
Sun Dec 5 17:48:01 UTC 1999


Your message dated Sun, 5 Dec 1999 18:33:29 +0100
with message-id <99120518334100.08583 at albundy>
and subject line (no subject)
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

Received: (at submit) by bugs.kde.org; 25 Nov 1999 19:37:33 +0000
From peturr at rhi.hi.is Thu Nov 25 20:37:33 1999
Received: from dimon.rhi.hi.is ([130.208.165.10]:679 "EHLO dimon.rhi.hi.is")
	by max.tat.physik.uni-tuebingen.de with ESMTP id <S743170AbPKYThZ>;
	Thu, 25 Nov 1999 20:37:25 +0100
Received: from vh21.rhi.hi.is (peturr at vh21.rhi.hi.is [130.208.172.85])
	by dimon.rhi.hi.is (8.9.3/8.9.0) with SMTP id TAA09727
	for <submit at bugs.kde.org>; Thu, 25 Nov 1999 19:37:23 GMT
From:   Petur Runolfsson <peturr at rhi.hi.is>
Reply-To: peturr at hi.is
To:     submit at bugs.kde.org
Subject: Crash on "Project | Add Existing Files..."
Date:   Thu, 25 Nov 1999 19:20:06 +0000
X-Mailer: KMail [version 1.0.17]
Content-Type: text/plain
MIME-Version: 1.0
Message-Id: <99112519372205.00486 at vh21.rhi.hi.is>
Content-Transfer-Encoding: 8bit
X-KMail-Mark: 
Return-Path: <peturr at rhi.hi.is>
X-Orcpt: rfc822;submit at bugs.kde.org

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