[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
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt-mirror (Debian)
Fix Released
Unknown
apt-mirror (Ubuntu)
Fix Released
Undecided
Unassigned
Intrepid
Fix Released
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.

Revision history for this message
Rafal Kwasny (mag) wrote :

I confirm this - newest intrepid with all updates same problem

Revision history for this message
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)
Changed in apt-mirror:
status: New → Fix Committed
Benjamin Drung (bdrung)
Changed in apt-mirror:
assignee: nobody → bdrung
status: Fix Committed → In Progress
Revision history for this message
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
Revision history for this message
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)
description: updated
Benjamin Drung (bdrung)
Changed in apt-mirror:
status: Fix Committed → Confirmed
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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

Revision history for this message
John Dong (jdong) wrote :
Revision history for this message
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.

Revision history for this message
Devid Antonio Filoni (d.filoni) wrote :

motu-sru ACK.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Sponsored to intrepid-proposed.

Changed in apt-mirror:
status: New → Confirmed
Revision history for this message
Jonathan Riddell (jr) wrote :

Accepted into intrepid-proposed, please test.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Installed package from intrepid-proposed and it works.

Revision history for this message
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
Revision history for this message
Salimane Adjao Moustapha (salimane) wrote :

Bug not yet fixed in Hardy

Artur Rona (ari-tczew)
tags: added: patch
Artur Rona (ari-tczew)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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