[intrepid alpha1] apt-mirror gives error "closedir() attempted on invalid dirhandle DIR at /usr/bin/apt-mirror line 537."

Bug #244613 reported by Christer Edwards on 2008-07-01
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-mirror (Debian)
Fix Released
Unknown
apt-mirror (Ubuntu)
Undecided
Unassigned
Intrepid
Undecided
Unassigned

Bug Description

Binary package hint: apt-mirror

after an upgrade to intrepid alpha 1 I get the following output repeated when finishing an apt-mirror update:

...
closedir() attempted on invalid dirhandle DIR at /usr/bin/apt-mirror line 537.
closedir() attempted on invalid dirhandle DIR at /usr/bin/apt-mirror line 537.
closedir() attempted on invalid dirhandle DIR at /usr/bin/apt-mirror line 537.
closedir() attempted on invalid dirhandle DIR at /usr/bin/apt-mirror line 537.
...

The process does seem to finish, and the mirror is updated, the above is just spewed a few dozen times to stdout.

I am running Intrepid Alpha 1, 2.6.26-2-generic kernel and apt-mirror 0.4.5-1ubuntu1

TEST CASE: run apt-mirror

This bug affects all apt-mirror user.

Rafal Kwasny (mag) wrote :

I confirm this - newest intrepid with all updates same problem

moormaster (moormaster) wrote :

The bug lies in the process_directory - method of the apt-mirror script. It is called recursively for every subdirectory while using a global DIRHANDLE so the DIRHANDLE of the parent directories always gets overwritten and so the closedir() call tries to close a subdirectory which has already been closed :D

I have created a little patch for the apt-mirror 0.4.5-1ubuntu1 package:

528a529,530
> my $dirhandle;
>
530,531c532,533
< opendir(DIR, $dir) or die "apt-mirror: can't opendir $dir: $!";
< foreach (grep { !/^\.$/ && !/^\.\.$/ } readdir(DIR)) {
---
> opendir($dirhandle, $dir) or die "apt-mirror: can't opendir $dir: $!";
> foreach (grep { !/^\.$/ && !/^\.\.$/ } readdir($dirhandle)) {
537c539
< closedir DIR;
---
> closedir $dirhandle;

Maybe that helps to get the bug fixed :D

Benjamin Drung (bdrung) on 2008-11-01
Changed in apt-mirror:
status: New → Fix Committed
Benjamin Drung (bdrung) on 2008-11-01
Changed in apt-mirror:
assignee: nobody → bdrung
status: Fix Committed → In Progress
Benjamin Drung (bdrung) wrote :

apt-mirror (0.4.5-1ubuntu2) jaunty; urgency=low

  * Add 02-fix-invalid-dirhandle.dpatch (LP: #244613)
  * debian/Ubuntu-mirror.list:
    - fix typo (privlages -> privileges)
    - update distribution to jaunty
  * debian/rules: Move binary-arch commands to binary-indep
  * debian/control:
    - remove homepage from description
    - bump Debian standards version to 3.8.0, no changes needed

-- Benjamin Drung <email address hidden> Sat, 01 Nov 2008 20:41:20 +0100

Changed in apt-mirror:
assignee: bdrung → nobody
status: In Progress → Fix Committed
Benjamin Drung (bdrung) wrote :

And here the debdiff for intrepid-proposed:

apt-mirror (0.4.5-1ubuntu1.1) intrepid-proposed; urgency=low

  * Add 02-fix-invalid-dirhandle.dpatch (LP: #244613)
  * debian/Ubuntu-mirror.list:
    - fix typo (privlages -> privileges)
    - update distribution to intrepid

 -- Benjamin Drung <email address hidden> Sat, 01 Nov 2008 19:40:38 +0100

Benjamin Drung (bdrung) on 2008-11-03
description: updated
Benjamin Drung (bdrung) on 2008-11-03
Changed in apt-mirror:
status: Fix Committed → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-mirror - 0.4.5-1ubuntu2

---------------
apt-mirror (0.4.5-1ubuntu2) jaunty; urgency=low

  * Add 02-fix-invalid-dirhandle.dpatch (LP: #244613)
  * debian/Ubuntu-mirror.list:
    - fix typo (privlages -> privileges)
    - update distribution to jaunty
  * debian/rules: Move binary-arch commands to binary-indep
  * debian/control:
    - remove homepage from description
    - bump Debian standards version to 3.8.0, no changes needed

 -- Benjamin Drung <email address hidden> Sat, 01 Nov 2008 20:41:20 +0100

Changed in apt-mirror:
status: Confirmed → Fix Released
Peter M (peter-bolkhuis) wrote :

Hi,

Will this new apt-mirror package be in the Intrepid repos anytime soon? Or should I just install it from the jaunty repos to get rid of these annoying messages in my mail.

Benjamin Drung (bdrung) wrote :

I hope someone from ubuntu-sru will review my patch for intrepid. Meanwhile you can grab the fixed package from my PPA: https://launchpad.net/~bdrung/+archive

John Dong (jdong) wrote :
John Dong (jdong) wrote :

Sorry for double-posting, but in the future it'd be great if the debdiff for -proposed were clearly linked in the original description.

motu-sru ACK.

Luca Falavigna (dktrkranz) wrote :

Sponsored to intrepid-proposed.

Changed in apt-mirror:
status: New → Confirmed
Jonathan Riddell (jr) wrote :

Accepted into intrepid-proposed, please test.

Benjamin Drung (bdrung) wrote :

Installed package from intrepid-proposed and it works.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-mirror - 0.4.5-1ubuntu1.1

---------------
apt-mirror (0.4.5-1ubuntu1.1) intrepid-proposed; urgency=low

  * Add 02-fix-invalid-dirhandle.dpatch (LP: #244613)
  * debian/Ubuntu-mirror.list:
    - fix typo (privlages -> privileges)
    - update distribution to intrepid

 -- Benjamin Drung <email address hidden> Sat, 01 Nov 2008 19:40:38 +0100

Changed in apt-mirror:
status: Confirmed → Fix Released

Bug not yet fixed in Hardy

Artur Rona (ari-tczew) on 2009-10-25
tags: added: patch
Artur Rona (ari-tczew) on 2010-03-24
affects: debian → apt-mirror (Debian)
Changed in apt-mirror (Debian):
status: New → 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.