Debian bug report logs - #1088
ncurses - segfault in wnoutrefresh in dpkg 0.93.53

Package: ncurses-developer; Reported by: iwj10@cus.cam.ac.uk (Ian Jackson); 113 days old.

Message received at debian-bugs:


From pixar.com!bruce Sat Jul 22 20:49:16 1995
Return-Path: <bruce@pixar.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sZs2W-0005QmC; Sat, 22 Jul 95 20:49 PDT
Received: from mongo.pixar.com by pixar.com with SMTP id AA22392
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Sat, 22 Jul 1995 20:47:42 -0700
Received: by mongo.pixar.com (Smail3.1.28.1 #15)
	id m0sZryz-0005QmC; Sat, 22 Jul 95 20:45 PDT
Message-Id: <m0sZryz-0005QmC@mongo.pixar.com>
To: iwj10@cus.cam.ac.uk (Ian Jackson), debian-bugs@Pixar.com
Cc: bruce@Pixar.com
Subject: Re: Bug#1088: ncurses - segfault in wnoutrefresh 
In-Reply-To: Your message of "Sun, 23 Jul 1995 00:21:00 PDT."
             <m0sZnrH-0002ZZZ@chiark.al.cl.cam.ac.uk> 
Date: Sat, 22 Jul 1995 20:45:37 -0700
From: Bruce Perens <bruce@Pixar.com>

Yes, I did see the rectangle in the upper left rendered before everything
else, and I also saw some lines cleared and than rendered with one space
in the left before being redrawn with their proper contents. I put that
up to strange movement optimization, but I'll take it up with them.
Rather than have them look at the whole of dpkg, can you put the relevant
fragments (refreshing windows, etc.) in a mail message along with questions?
You'll be more likely to get a response that way.

	Thanks

	Bruce

Acknowledgement sent to Bruce Perens <bruce@Pixar.com>:
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#1088; Package ncurses-developer. Full text available.

Message received at debian-bugs:


From cus.cam.ac.uk!iwj10 Sat Jul 22 16:50:00 1995
Return-Path: <iwj10@cus.cam.ac.uk>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sZoIy-0004BqC; Sat, 22 Jul 95 16:50 PDT
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA09425
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Sat, 22 Jul 1995 16:48:16 -0700
Received: by bootes.cus.cam.ac.uk 
	(Smail-3.1.29.0 #36) id m0sZoIi-000BzOC; Sun, 23 Jul 95 00:49 BST
Received: by chiark
	id <m0sZnrH-0002ZZZ@chiark.al.cl.cam.ac.uk>
	(Debian /\oo/\ Smail3.1.29.1 #29.32); Sun, 23 Jul 95 00:21 BST
Message-Id: <m0sZnrH-0002ZZZ@chiark.al.cl.cam.ac.uk>
Date: Sun, 23 Jul 95 00:21 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: debian-bugs@Pixar.com
Subject: Re: Bug#1088: ncurses - segfault in wnoutrefresh 
In-Reply-To: <m0sZSOO-0003GFC@mongo.pixar.com>
References: <m0sZPLn-0002XVZ@chiark.al.cl.cam.ac.uk>
	<m0sZSOO-0003GFC@mongo.pixar.com>

Bruce Perens writes ("Re: Bug#1088: ncurses - segfault in wnoutrefresh "):
> iwj10@cus.cam.ac.uk said:
> > However it's still doing something very weird that I think is 
> > probably a bug somewere.
> 
> On my ANSI terminal emulation at work, it looked OK, though some of the 
> decisions it made about movement optimization were strange.

Sorry, I've not made myself clear.

You'll notice that it redraws a rectangle near the top left of the
package list before everything else.

I find this highly suspicious.  There is nothing in my code that makes
that rectangle special; the whole package list is a single pad which
is pnoutrefresh'd all at once.  The displayed data doesn't make it
special either.

I think that this bizarre redraw order is another symptom of the same
bug that caused the coredump with 1.9.2c.  It seems likely to me that
it is coincidence that with 1.9.3 the numbers that are the corners of
the rectangle are sane enough for it to redraw that part apparently
correctly, and that in 1.9.2c it just happened to be sufficiently
badly off to cause a coredump.

I won't be convinced that this rectangle isn't an abberation involving
some kind of incorrectly calculated quantities until someone shows me
how it was derived :-).

>  I'll look at it on 
> my Linux at home as soon as I can to see if it's a linux-terminfo problem. If
> it's solely a matter of not liking the movement optimization, I think we 
> should wait before complaining about that, as they've just worked over the 
> movement optimization for the next release.

No, I don't think it is just a problem with the movement optimization.

What I'd really like is for one of the ncurses team to look over my
code and see what it ought to do and compare it with what it does.
If you point them to me I can explain the window/pad structures I'm
using, or answer their questions.

> What were you running it under? Xterm? The linux console? What was $TERM
> set to? Did it behave the same way under both xterm and the console?

TERM=xterm in an 80x24 xterm (3.1.1-1 at the time, but it does it with
3.1.1-2 too).

In fact, I've just tried it (0.93.62 dselect, List, Redraw) in an
80x37 xterm (3.1.1-2) and I get a segfault.  If I try making my xterm
bigger one line at a time I find that the earlier-drawn rectangle
shrinks, and that I get a segfault when it has shrunk to nothing.

I can't reproduce the problem with a 132x43 Linux console with
TERM=console or TERM=linux.  TERM=con132x43 (the default for my 1.2.10
kernel) produces a string of messages about errors in terminal entries
and then appears to hang.

Ian.

Acknowledgement sent to iwj10@cus.cam.ac.uk (Ian Jackson):
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#1088; Package ncurses-developer. Full text available.

Message received at debian-bugs:


From pixar.com!bruce Fri Jul 21 17:27:16 1995
Return-Path: <bruce@pixar.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sZSPT-0003DbC; Fri, 21 Jul 95 17:27 PDT
Received: from mongo.pixar.com by pixar.com with SMTP id AA24124
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Fri, 21 Jul 1995 17:25:41 -0700
Received: by mongo.pixar.com (Smail3.1.28.1 #15)
	id m0sZSOO-0003GFC; Fri, 21 Jul 95 17:26 PDT
Message-Id: <m0sZSOO-0003GFC@mongo.pixar.com>
X-Mailer: exmh version 1.6.2 7/18/95
To: iwj10@cus.cam.ac.uk (Ian Jackson), debian-bugs@Pixar.com
Cc: bruce@Pixar.com
Subject: Re: Bug#1088: ncurses - segfault in wnoutrefresh 
In-Reply-To: Your message of "Fri, 21 Jul 1995 22:11:00 PDT."
             <m0sZPLn-0002XVZ@chiark.al.cl.cam.ac.uk> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 21 Jul 1995 17:26:08 -0700
From: Bruce Perens <bruce@Pixar.com>


iwj10@cus.cam.ac.uk said:
> However it's still doing something very weird that I think is 
> probably a bug somewere.

On my ANSI terminal emulation at work, it looked OK, though some of the 
decisions it made about movement optimization were strange. I'll look at it on 
my Linux at home as soon as I can to see if it's a linux-terminfo problem. If
it's solely a matter of not liking the movement optimization, I think we 
should wait before complaining about that, as they've just worked over the 
movement optimization for the next release.

What were you running it under? Xterm? The linux console? What was $TERM
set to? Did it behave the same way under both xterm and the console?

If I'm seeing what you are complaining about, I'm perhaps not recognizing it.
Can I have a few more words about what "something very weird" is?

	Thanks

	Bruce


--
-- Attention Ham Radio Operators: For information on "Linux for Hams", read
-- the World Wide Web page http://www.hams.com/perens/LinuxForHams, or send
-- an e-mail message containing the word "help" to info@hams.com .


Acknowledgement sent to Bruce Perens <bruce@Pixar.com>:
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#1088; Package ncurses-developer. Full text available.

Message received at debian-bugs:


From cus.cam.ac.uk!iwj10 Fri Jul 21 16:11:26 1995
Return-Path: <iwj10@cus.cam.ac.uk>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sZRE6-000B84C; Fri, 21 Jul 95 16:11 PDT
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA15844
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Fri, 21 Jul 1995 16:08:12 -0700
Received: by bootes.cus.cam.ac.uk 
	(Smail-3.1.29.0 #36) id m0sZQ2k-000C0jC; Fri, 21 Jul 95 22:55 BST
Received: by chiark
	id <m0sZPLn-0002XVZ@chiark.al.cl.cam.ac.uk>
	(Debian /\oo/\ Smail3.1.29.1 #29.32); Fri, 21 Jul 95 22:11 BST
Message-Id: <m0sZPLn-0002XVZ@chiark.al.cl.cam.ac.uk>
Date: Fri, 21 Jul 95 22:11 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: debian-bugs@pixar.com
Subject: Re: Bug#1088: ncurses - segfault in wnoutrefresh
In-Reply-To: <m0sYQhm-000604C@mongo.pixar.com>
References: <m0sYQhm-000604C@mongo.pixar.com>

Bruce Perens writes:
> Ian, is this still happening with ncurses-1.9.3 ?

No, it's not.  However it's still doing something very weird that I
think is probably a bug somewhere.

Here is a typescript which demonstrates the effect.  For best results
use something like
 slowprint 0.001 <typescript
to see what's going on.  (slowprint is the Perl script below.)

This was in an 80x24 xterm.

Can we please keep this bug open until the question of precisely how I
should refresh the display in dselect is resolved, as well as all the
related ncurses code and documentation bugs ?

Ian.

#!/usr/bin/perl
$v=join("",<STDIN>); $|=1;
$overhead= 0.0125;
$delay= @ARGV ? $ARGV[0]+0 : 0.025;
$per=1;
while ($delay < $overhead) { $per*=2; $delay*=2; }
$delay -= $overhead;
while (length($v)) {
    print substr($v,0,$per); $v=substr($v,$per);
    select("","","",$delay);
}

begin 664 typescript.gz
M'XL(``,7$#`"`^U:6T_;2!1^K[2_("_G#8H@8),K:+OBUJ8%45I@M2M$RV!/
MXEE\B69L0E[ZV_<<SXQ)`%M`Z+9=Q4+R)./YYER_<V+FV)-BF()*F4RY#TD,
M;Z6`#UD(K@.NN['6VF@VP>EVFZ]J9W\X0>UW+Q!,7FU\6_TGBZ_>P+?5-!#Q
M0*WZ_%*P>-4?7@U6UNK=]7K+7?45#[F7VCO\EH.$M3>U-@X:[:!VUJN=N1]J
M9TZTFZ^'=X>GJP<BSF[@PJQ:@"'SKMB`0\!B/\3-H"^3..6Q7\?%FPY"1%`[
M6\]'[0B68*T.9\?G/,V&H*^=($D4AS3@(&)4-@Q9*E#9B*=!XD.:0*9X'1ZZ
M:F<-LP6`@[A;Y]=,A&;R=.BSE$,H5`I)'QA-L<N06Y'5,H@^#!.E!'Z+XC81
M"]>Y"'1P3JO,=:P--`J$%Q2+22XC+BPF$GQN/KU&I)9&6D>DT_.8EAB1]%C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
Information forwarded to debian-devel@pixar.com:
Bug#1088; Package ncurses-developer. Full text available.

Message received at debian-bugs:


From pixar.com!bruce Tue Jul 18 21:28:45 1995
Return-Path: <bruce@pixar.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sYQkX-000604C; Tue, 18 Jul 95 21:28 PDT
Received: from mongo.pixar.com by pixar.com with SMTP id AA22152
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Tue, 18 Jul 1995 21:27:12 -0700
Received: by mongo.pixar.com (Smail3.1.28.1 #15)
	id m0sYQhm-000604C; Tue, 18 Jul 95 21:25 PDT
Message-Id: <m0sYQhm-000604C@mongo.pixar.com>
Date: Tue, 18 Jul 95 21:25 PDT
From: bruce@pixar.com (Bruce Perens)
To: debian-bugs@pixar.com, iwj10@cus.cam.ac.uk
Subject: Re: Bug#1088: Acknowledgement (was: ncurses - segfault in
    wnoutrefresh

Ian, is this still happening with ncurses-1.9.3 ?

	Thanks

	Bruce
--
-- Attention Ham Radio Operators: For information on "Linux for Hams", read
-- the World Wide Web page http://www.hams.com/perens/LinuxForHams, or send
-- an e-mail message containing the word "help" to info@hams.com .

Acknowledgement sent to bruce@pixar.com (Bruce Perens):
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#1088; Package ncurses-developer. Full text available.

Message received at debian-bugs:


From cus.cam.ac.uk!iwj10 Mon Jul 10 06:44:16 1995
Return-Path: <iwj10@cus.cam.ac.uk>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sVJ8C-0005nTC; Mon, 10 Jul 95 06:44 PDT
Received: from bootes.cus.cam.ac.uk by pixar.com with SMTP id AA21370
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Mon, 10 Jul 1995 06:42:43 -0700
Received: by bootes.cus.cam.ac.uk 
	(Smail-3.1.29.0 #36) id m0sVJ86-000C00C; Mon, 10 Jul 95 14:44 BST
Received: by chiark
	id <m0sV5pe-0000YOZ@chiark.al.cl.cam.ac.uk>
	(Debian /\oo/\ Smail3.1.29.1 #29.32); Mon, 10 Jul 95 00:32 BST
Message-Id: <m0sV5pe-0000YOZ@chiark.al.cl.cam.ac.uk>
Date: Mon, 10 Jul 95 00:32 BST
From: iwj10@cus.cam.ac.uk (Ian Jackson)
To: Debian bugs submission address <debian-bugs@pixar.com>
Subject: ncurses - segfault in wnoutrefresh in dpkg 0.93.53

Package: ncurses-developer
Version: 1.9.2c-1

To reproduce:
 * start dselect 0.93.53;
 * enter the package list (option 2);
 * hit ^L to redraw the display.

The result is a coredump in wnoutrefresh.  The arguments appear to be
sane.  I haven't investigated whether this is an overwriting (memory
corruption) problem in dselect because the last time I had an
overwriting problem it turned out to be ncurses infecting the rest of
the program rather than the other way around.

The bug happens with 0.93.42.3 too, and probably with other versions.

If you want to debug this and have Electric Fence installed the
easiest way is probably to use the `debugmake' script in the dpkg
0.93.53 source tarfile's `lib' and `dselect' directories.

dpkg-0.93.53.tar.gz is currently in private/project/ALPHA; when I
upload dpkg 0.93.54 I'll move it to dpkg-0.93.53-ncursesbug.tar.gz.

Ian.

Acknowledgement sent to iwj10@cus.cam.ac.uk (Ian Jackson):
New bug report received and forwarded. Full text available.
Report forwarded to debian-devel@pixar.com:
Bug#1088; Package ncurses-developer. Full text available.
Ian Jackson / iwj10@thor.cam.ac.uk, with the debian-bugs tracking mechanism
This page last modified 07:43:01 GMT Wed 01 Nov