[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#505016: marked as done (apt sometimes hangs after downloading)



Your message dated Tue, 11 Aug 2015 15:02:43 +0200
with message-id <20150811130242.GA22449@crossbow>
and subject line Re: apt sometimes hangs after downloading
has caused the Debian Bug report #505016,
regarding apt sometimes hangs after downloading
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 this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
505016: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505016
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 0.7.16
Tags: patch

When installing a large list of software on an newly installed lenny
system, I often see apt hanging at the end of downloading.

While testing apt methods manually for the next bug report you will get
in some minutes, I also found the methods not accepting my commands from
the stdin typed in by terminal but just waiting indefinitely.

This happens because the terminal gives the data line by line to the
apt method and ReadMessages puts each line on its own into
PartialMessages, so it never sees a \n\n in any of those, thus hanging
indefinitly. This bug is fixed by the attached patch.

I've not yet had the time to check (and with things only sometimes happening
(though lately 3 times after each other) it will also be impossible to
check if that also fixed the original problem, but I deem it highly
likely that this bug can also cause problems with identical behaviour).

Hochachtungsvoll,
	Bernhard R. Link
=== modified file 'apt-pkg/contrib/strutl.cc'
--- apt-pkg/contrib/strutl.cc	2008-10-03 18:57:25 +0000
+++ apt-pkg/contrib/strutl.cc	2008-11-08 16:25:33 +0000
@@ -696,9 +696,11 @@
       End += Res;
       
       // Look for the end of the message
-      for (char *I = Buffer; I + 1 < End; I++)
+      for (char *I = Buffer; I < End; I++)
       {
-	 if (I[0] != '\n' || I[1] != '\n')
+	 if (I == Buffer && I[0] == '\n' && PartialMessage[PartialMessage.length()-1] )
+	    PartialMessage = PartialMessage.substr(0, PartialMessage.length()-1);
+	 else if (I[0] != '\n' || I == End || I[1] != '\n')
 	    continue;
 	 
 	 // Pull the message out


--- End Message ---
--- Begin Message ---
Version: 1.1~exp8

Hi,

On Sat, Nov 08, 2008 at 05:40:22PM +0100, Bernhard R. Link wrote:
> This happens because the terminal gives the data line by line to the
> apt method and ReadMessages puts each line on its own into
> PartialMessages, so it never sees a \n\n in any of those, thus hanging
> indefinitly. This bug is fixed by the attached patch.

Right & thanks for the patch btw.

"Unfortunately" we fixed this differently with a 'rewrite' as there were
some other problems with it as well around the cut-point. On the upside
the commit fixing it also includes a testcase so we should never get to
accidentally reimplement this bug…
https://anonscm.debian.org/cgit/apt/apt.git/commit/?id=d8c71b3b5dc98daa247433503ad8242c9e7b77db

Closing this bugreport as done hence.

Best regards

David Kalnischkies

Attachment: signature.asc
Description: Digital signature


--- End Message ---

Reply to: