Bug#629266: aptitude hangs in endless loop

2012-05-31 Thread Hannes von Haugwitz
On Tue, Apr 17, 2012 at 03:33:58PM +0200, Hannes von Haugwitz wrote:
 On Tue, Apr 17, 2012 at 12:56:31AM +0800, Daniel Hartwig wrote:
  Though I was not able to (quickly) reproduce this the attached patch
  should fix it.
  
  Could affected users please test and confirm the results.
 
 I've installed the patched version on some of my affected squeeze
 systems and will report back in about one or two weeks whether the issue
 has reoccurred again or not.

Sorry for the late response.

Though the bug is meanwhile closed, I still want to report back.

The issue hasn't reoccurred again with the patched version; so the patch
fixed the issue.

Best regards

Hannes



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#629266: aptitude hangs in endless loop

2012-05-31 Thread Daniel Hartwig
On 31 May 2012 20:19, Hannes von Haugwitz han...@vonhaugwitz.com wrote:
 Though the bug is meanwhile closed, I still want to report back.

 The issue hasn't reoccurred again with the patched version; so the patch
 fixed the issue.


Thanks, that is nice to know.

Regards



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#629266: aptitude hangs in endless loop

2012-04-17 Thread Hannes von Haugwitz
Hello,

On Tue, Apr 17, 2012 at 12:56:31AM +0800, Daniel Hartwig wrote:
 Though I was not able to (quickly) reproduce this the attached patch
 should fix it.
 
 Could affected users please test and confirm the results.

I've installed the patched version on some of my affected squeeze
systems and will report back in about one or two weeks whether the issue
has reoccurred again or not.

Best regards

Hannes



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#629266: aptitude hangs in endless loop

2012-04-16 Thread Daniel Hartwig
retitle 629266 aptitude: {full,safe}-upgrade -d has infinite loop
running dpkg/scripts
tags 629266 = patch
thanks

Though I was not able to (quickly) reproduce this the attached patch
should fix it.

Could affected users please test and confirm the results.
From fc33717e721954088ed14913af5002f0ef9d2d1a Mon Sep 17 00:00:00 2001
From: Daniel Hartwig mand...@gmail.com
Date: Tue, 17 Apr 2012 00:46:23 +0800
Subject: [PATCH] Avoid dpkg and infinite loop in download-only mode

* src/generic/apt/download_install_manager.cc:
  When in download_only mode:
  - report download errors;
  - post_dpkg save/reload cycle (fix for #429388) is not needed;
  - ignore aptitude::Forget-New-On-Install;
  - avoid dpkg and a potential infinite loop;
  - do not run {Pre,Post}-Invoke scripts.

Closes: #629266
---
 src/generic/apt/download_install_manager.cc |   42 +++
 1 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/src/generic/apt/download_install_manager.cc b/src/generic/apt/download_install_manager.cc
index e3ab4c3..6544e39 100644
--- a/src/generic/apt/download_install_manager.cc
+++ b/src/generic/apt/download_install_manager.cc
@@ -109,8 +109,6 @@ download_manager::result download_install_manager::finish_pre_dpkg(pkgAcquire::R
 {
   if(res != pkgAcquire::Continue)
 return failure;
-  else if(download_only)
-return success;
 
   bool failed=false;
   for(pkgAcquire::ItemIterator i = fetcher-ItemsBegin();
@@ -128,6 +126,20 @@ download_manager::result download_install_manager::finish_pre_dpkg(pkgAcquire::R
   break;
 }
 
+  if(download_only)
+{
+  // TODO: Handle files on other CDROMs (StatIdle?).
+  if(failed)
+	{
+	  _error-Error(_(Some files failed to download));
+	  return failure;
+	}
+  else
+	{
+	  return success;
+	}
+}
+
   if(failed  !pm-FixMissing())
 {
   _error-Error(_(Unable to correct for unavailable packages));
@@ -226,9 +238,11 @@ void download_install_manager::finish_post_dpkg(pkgPackageManager::OrderResult d
   // world.
   //
   // This implicitly updates the package state file on disk.
-  apt_load_cache(progress, true);
+  if(!download_only)
+	apt_load_cache(progress, true);
 
-  if(aptcfg-FindB(PACKAGE ::Forget-New-On-Install, false))
+  if(aptcfg-FindB(PACKAGE ::Forget-New-On-Install, false)
+	  !download_only)
 	{
 	  if(apt_cache_file != NULL)
 	{
@@ -248,7 +262,7 @@ void download_install_manager::finish(pkgAcquire::RunResult result,
 {
   const download_manager::result pre_res = finish_pre_dpkg(result);
 
-  if(pre_res == success)
+  if(pre_res == success  !download_only)
 {
   run_dpkg_in_terminal(sigc::mem_fun(*this, download_install_manager::run_dpkg),
 			   sigc::bind(sigc::mem_fun(*this, download_install_manager::finish_post_dpkg),
@@ -258,7 +272,23 @@ void download_install_manager::finish(pkgAcquire::RunResult result,
 }
   else
 {
-  finish_post_dpkg(pkgPackageManager::Failed,
+  pkgPackageManager::OrderResult res;
+
+  switch(pre_res)
+	{
+	case success:
+	  res = pkgPackageManager::Completed;
+	  break;
+	case do_again:
+	  res = pkgPackageManager::Incomplete;
+	  break;
+	case failure:
+	default:
+	  res = pkgPackageManager::Failed;
+	  break;
+	}
+
+  finish_post_dpkg(res,
 		   progress,
 		   k);
   return;
-- 
1.7.9



Bug#629266: aptitude hangs in endless loop

2011-06-29 Thread Hannes von Haugwitz
Package: aptitude
Version: 0.6.3-3.2
Followup-For: Bug #629266

Hi,

today the issue occurred again on an up to date squeeze system (6.0.2).

Greetings

Hannes



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#629266: aptitude hangs in endless loop

2011-06-05 Thread Hannes von Haugwitz
Package: aptitude
Version: 0.6.3-3.2
Severity: important
Tags: squeeze

I don't know which package is responsible for this bug, the involved
packages are cron-apt, aptitude, rkhunter, debsums and maybe others.
Please reassign this bug if aptitude is the wrong package.

From time to time (until now 9 times since 14 Dec 2010) aptitude on my
squeeze system (started by cron-apt) hangs in an endless loop executing
at least the commands mentioned in
/etc/apt/apt.conf.d/{70debconf,90debsums,90rkhunter} over and over
again.  The issue leads to a higher load and CPU usage on the affected
system.

I also observed the same problem on my testing/unstable/experimental
system (but only twice on 2011-01-21 and 2011-05-11). aptitude has been
upgraded on 2011-04-18 (aptitude 0.6.3-3.2 - 0.6.3-4).

The issue occurred also yesterday on the squeeze system and that process
is still running.

The output of pstree for the cron pid:


cron,14803
  └─cron,3369
  └─sh,3375 -c test -x /usr/sbin/cron-apt  /usr/sbin/cron-apt
  └─cron-apt,3379 /usr/sbin/cron-apt
  └─cron-apt,7740 /usr/sbin/cron-apt
  └─aptitude,7764 -o quiet=1 dist-upgrade -d -y -o 
APT::Get::Show-Upgraded=true
  ├─aptitude,3152 -o quiet=1 dist-upgrade -d -y -o 
APT::Get::Show-Upgraded=true
  │   └─sh,3158 -c if [ -x /usr/bin/rkhunter ]  ( ! grep 
-q -E '^DISABLE_TESTS=.*(hashes.*attributes|attributes.*hashes|properties)' 
/etc/rkhunter.conf || grep -q -E 
'^ENABLE_TESTS=.*(hashes|attributes|properties)' /etc/rkhunter.conf); then 
/usr/bin/rkhunter --propupd --nolog; fi
  │   └─rkhunter,3161 /usr/bin/rkhunter --propupd 
--nolog
  └─{aptitude},7765.


The processes until pid 7764 and process 7765 are stable while all
childs of 7764 are reexecuted again and again.

Killing 7764 would solve the issue and lead to a cron-apt report like
the following:


CRON-APT RUN [/etc/cron-apt/config]: Tue May 31 04:00:02 UTC 2011
CRON-APT SLEEP: 2574, Tue May 31 04:42:56 UTC 2011
CRON-APT ACTION: 3-download
CRON-APT LINE: /usr/bin/aptitude dist-upgrade -d -y -o 
APT::Get::Show-Upgraded=true
Reading package lists...
Building dependency tree...
Reading state information...
Reading extended state information...
Initializing package states...
Reading task descriptions...
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
…
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 161 files, found 130
Terminated


Please let me know if I can provide any other information.

I have to kill the looping process until Jun 05 2011, 2000 UTC; so if
you want me to provide any information about the running process ask
before; otherwise you have to wait until the issue occurs again.

Greetings

Hannes



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org