Bug#2146: marked as done (Seg fault when outputting a blank line first thing to cout)

Stephan Kulow owner at bugs.kde.org
Sat Oct 23 10:48:01 UTC 1999


Your message dated Sat, 23 Oct 1999 12:20:36 +0200
with message-id <99102312204804.17359 at lina>
and subject line 
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; 15 Oct 1999 10:23:26 +0000
>From jbb at ihug.co.nz Fri Oct 15 12:23:26 1999
Received: from tk1.ihug.co.nz ([203.29.160.13]:23822 "EHLO smtp1.ihug.co.nz")
	by max.tat.physik.uni-tuebingen.de with ESMTP id <S741427AbPJOKXD>;
	Fri, 15 Oct 1999 12:23:03 +0200
Received: from winter.localdomain (IDENT:jbb at p20-max11.chc.ihug.co.nz [209.79.136.212])
	by smtp1.ihug.co.nz (8.9.3/8.9.3/Debian/GNU) with SMTP id XAA18111
	for <submit at bugs.kde.org>; Fri, 15 Oct 1999 23:22:37 +1300
From:   jbb <jbb at ihug.co.nz>
Organization: home
To:     submit at bugs.kde.org
Subject: Seg fault when outputting a blank line first thing to cout
Date:   Fri, 15 Oct 1999 23:00:28 +1300
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <3806DFBF.307C4C05 at geocities.com> <99101510511002.04807 at killer>
In-Reply-To: <99101510511002.04807 at killer>
MIME-Version: 1.0
Message-Id: <99101523172600.04018 at winter.localdomain>
Content-Transfer-Encoding: 8bit
Return-Path: <jbb at ihug.co.nz>
X-Orcpt: rfc822;submit at bugs.kde.org

Package: kdevelop
Version: 1.0 beta3
Severity: grave (ish) bad, if it happens and easy to fix.

Bugreport ID : 23:15,15.10.99

Originator       : jbb
E-Mail   : jbb at ihug.co.nz

Subject : Seg fault when outputting a blank line first thing to cout

Error Class      : software bug
Error Location: ckdevelop.cpp
Priority         : low

Bug Description ---------------------------

If a "KDE Normal" application outputs a blank line to cout before any other
data is output to cout then an assert is generated in qmultiedit, when the
application is run using the "Run" button (phew :-)

here's some simple code that'll trigger the assert.

#include "iostream"
int main(int argc, char* argv[]) {

  cout << endl;

  KApplication app(argc,argv,"term");
...

This is the ASSERT diagnostic

EXEC:./termQGList::locate: Index 1 out of range
ASSERT: "s" in widgets/qmultilinedit.cpp (1853)
Segmentation fault (core dumped)

This hack :-) will stop the assert

void CKDevelop::slotApplReceivedStdout(KProcess*,char* buffer,int buflen){
  if (*(buffer+buflen-1) == '\n')
    buflen--;
    
  QString str(buffer,buflen+1);
  stdin_stdout_widget->insertLine(str);
  stdin_stdout_widget->setCursorPosition(stdin_stdout_widget->numLines()-1,0);

//    int x,y;
//  showOutputView(true);
//  stdin_stdout_widget->cursorPosition(&x,&y);
//  QString str(buffer,buflen+1);
//  stdin_stdout_widget->insertAt(str,x,y);
}
void CKDevelop::slotApplReceivedStderr(KProcess*,char* buffer,int buflen){
  if (*(buffer+buflen-1) == '\n')
    buflen--;
    
  QString str(buffer,buflen+1);
  stderr_widget->insertLine(str);
  stderr_widget->setCursorPosition(stderr_widget->numLines()-1,0);

//  int x,y;
//  showOutputView(true);
//  stderr_widget->cursorPosition(&x,&y);
//  QString str(buffer,buflen+1);
//  stderr_widget->insertAt(str,x,y);
}

System Information ------------------------

KDevelop version	: 1.0beta3
KDE version		: KDE-1.1.2 (cvs-release)
QT version		: QT-1.44
OS/Distribution		: Mandrake 6.1
Compiler		: gcc-2.95.1

Also using "insertLine()" and "setCursorPosition" as above on the message
window will fix the problem where the output gets messed up if the user
clicks in the message window whilst output is still being generated, as per the
report below.


On Fri, 15 Oct 1999, you wrote:
> Am Fri, 15 Oct 1999 schriebst Du zwecks "BUG: Output window" :
> > Hi,
> > 
> > I found an ugly bug:
> > Whenever I click on a compiler error message line in the output window
> > of KDevelop during compiling, all error lines coming after that click
> > are scrambled.
> > -- 
> > 
> > Ciao,
> > --Falk
> --
> email 1: delta_x at linuxCoding.de
> email 2: delta_x at gmx.net
> home   : HTTP://WWW.LinuxCoding.DE
> 
> why do you click on this line :)
> you MUST wait till kdev has compiled ready

Nooo, it's ugly and can be fixed :-)

-- 
Regards,

jbb
http://homepages.ihug.co.nz/~jbb



More information about the KDevelop-devel mailing list