aptitude stops displaying downloads

Bug #391035 reported by Jean-Louis Dupond on 2009-06-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
aptitude (Debian)
Fix Released
aptitude (Ubuntu)
Michael Vogt

Bug Description

Binary package hint: aptitude

aptitude sometimes (almost always) stops displaying downloads. When I for example do aptitude update, it suddenly stops outputting.


Hit http://archive.ubuntu.com karmic-proposed Release
Get:3 http://archive.ubuntu.com karmic/main Packages [1280kB]
Reading package lists... Done 55%] 131kB/s 4s

Current status: 9 updates [+8], 2194 new [+6].

Same happens when I do safe-upgrade. Then it also stops when downloading the packages. Never stops while installing them or in other stages!

Related branches

Jean-Louis Dupond (dupondje) wrote :

It seems to stop displaying when it starts showing speed & remaining time!

Jean-Louis Dupond (dupondje) wrote :

Seems only to occur when the gnome-terminal window is maximized

Jean-Louis Dupond (dupondje) wrote :

Changing the Fixed width font to Monospace 8pt in gnome-appearance-properties makes this happen it seems ! (and ofcouse gnome-terminal is set to use the default)

Jean-Louis Dupond (dupondje) wrote :

After some debugging @ #Ubuntu+1, the real reason seems to be the column count: columns 316;

Colums > 312 break the output
Colums <= 312 are just fine

Philip Muškovac (yofel) wrote :

Actually it stops once the speed indiator on the bottom right side appears.

Changed in aptitude (Ubuntu):
status: New → Confirmed
Jean-Louis Dupond (dupondje) wrote :

diff -ru aptitude/src/generic/apt/acqprogress.cc aptitude-
--- aptitude/src/generic/apt/acqprogress.cc 2009-10-19 23:42:25.937618128 +0200
+++ aptitude- 2008-11-20 04:17:12.000000000 +0100
@@ -256,7 +256,7 @@

    if (CurrentCPS != 0)
- char Tmp[400];
+ char Tmp[300];
       unsigned long ETA = (unsigned long)((TotalBytes - CurrentBytes)/CurrentCPS);
       sprintf(Tmp," %sB/s %s",SizeToStr(CurrentCPS).c_str(),TimeToStr(ETA).c_str());
       unsigned int Len = strlen(Buffer);
diff -ru aptitude/src/generic/apt/acqprogress.h aptitude-
--- aptitude/src/generic/apt/acqprogress.h 2009-10-20 19:48:33.625307969 +0200
+++ aptitude- 2008-11-20 04:17:12.000000000 +0100
@@ -20,7 +20,7 @@
 class AcqTextStatus : public sigc::trackable
    unsigned int &ScreenWidth;
- char BlankLine[400];
+ char BlankLine[300];
    unsigned long ID;
    unsigned long Quiet;

this fixes the bug!

Philip Muškovac (yofel) on 2010-02-07
Changed in aptitude (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
Michael Vogt (mvo) on 2010-02-15
Changed in aptitude (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Michael Vogt (mvo)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aptitude -

aptitude ( lucid; urgency=low

  * 13_screensize.dpatch:
     - Fixes a bug that stops outputting aptitude downloads on big screens (LP: #391035).
 -- Jean-Louis Dupond <email address hidden> Mon, 08 Feb 2010 20:42:30 +0100

Changed in aptitude (Ubuntu):
status: In Progress → Fix Released
Carey Underwood (cwillu) wrote :

I'm getting segfaults in any aptitude operation as of; reverting to an older version gets things working again.

Anders Kaseorg (andersk) wrote :

This patch is wrong. This needs to be ScreenWidth + 1, not ScreenWidth:
+ BlankLine = new char[ScreenWidth];
because otherwise acqprogress.cc:273 overflows the buffer:
   BlankLine[ScreenWidth] = 0;

Changed in aptitude (Ubuntu):
status: Fix Released → In Progress
Anders Kaseorg (andersk) wrote :

In addition, the patch has a more subtle problem. ScreenWidth is an int _reference_, that points to unsigned int screen_width in cmdline_progress.cc, which can be updated at any time from the SIGWINCH signal handler. This would lead to a buffer overflow if the window size is increased.

Anders Kaseorg (andersk) wrote :

Moving the fallout discussion to bug 515525, where I’ve posted a fixed patch.

Changed in aptitude (Ubuntu):
status: In Progress → Fix Released
Changed in aptitude (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.