Debian Bug report logs - #591993
litters dpkg-tmp files after unpack error (file conflict)

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Helmut Grohne <helmut@subdivi.de>

Date: Fri, 6 Aug 2010 19:48:05 UTC

Severity: normal

Tags: patch

Found in version dpkg/1.15.8.3

Fixed in version dpkg/1.15.8.4

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#591993; Package dpkg. (Fri, 06 Aug 2010 19:48:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Grohne <helmut@subdivi.de>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 06 Aug 2010 19:48:08 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Helmut Grohne <helmut@subdivi.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: litters dpkg-tmp files after unpack error (file conflict)
Date: Fri, 6 Aug 2010 21:45:59 +0200
Package: dpkg
Version: 1.15.8.3
Severity: normal

Recently there was a file conflict between kdelibs{,5}-data.

# find /usr -name "*.dpkg-tmp" | wc -l
0
# dpkg -i /var/cache/apt/archives/kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb 
(Reading database ... 217862 files and directories currently installed.)
Preparing to replace kdelibs-data 4:3.5.10.dfsg.1-3 (using .../kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb) ...
Unpacking replacement kdelibs-data ...
dpkg: error processing /var/cache/apt/archives/kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb (--install):
 trying to overwrite '/usr/share/doc/kde/HTML/en/common/6.png', which is also in package kdelibs5-data 4:4.4.5-1
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Processing triggers for desktop-file-utils ...
Errors were encountered while processing:
 /var/cache/apt/archives/kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb
# find /usr -name "*.dpkg-tmp" | wc -l
4217
#

So dpkg litters dpkg-tmp files. Note that no packages are in a state other than
ii, rc or pn. Removing the dpkg-tmp files and unpacking again yields the same
result.

Helmut

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg depends on:
ii  coreutils         8.5-1                  GNU core utilities
ii  libbz2-1.0        1.0.5-4                high-quality block-sorting file co
ii  libc6             2.11.2-2               Embedded GNU C Library: Shared lib
ii  libselinux1       2.0.96-1               SELinux runtime shared libraries
ii  xz-utils          4.999.9beta+20100713-1 XZ-format compression utilities
ii  zlib1g            1:1.2.3.4.dfsg-3       compression library - runtime

Versions of packages dpkg suggests:
ii  apt                           0.7.25.3   Advanced front-end for dpkg




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#591993; Package dpkg. (Thu, 12 Aug 2010 19:21:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac@gmx.de>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Thu, 12 Aug 2010 19:21:05 GMT) Full text and rfc822 format available.

Message #10 received at 591993@bugs.debian.org (full text, mbox):

From: Sven Joachim <svenjoac@gmx.de>
To: 591993@bugs.debian.org
Cc: Helmut Grohne <helmut@subdivi.de>
Subject: Re: Bug#591993: litters dpkg-tmp files after unpack error (file conflict)
Date: Thu, 12 Aug 2010 21:19:50 +0200
[Message part 1 (text/plain, inline)]
tags 591993 + patch
thanks

On 2010-08-06 21:45 +0200, Helmut Grohne wrote:

> Package: dpkg
> Version: 1.15.8.3
> Severity: normal
>
> Recently there was a file conflict between kdelibs{,5}-data.
>
> # find /usr -name "*.dpkg-tmp" | wc -l
> 0
> # dpkg -i /var/cache/apt/archives/kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb 
> (Reading database ... 217862 files and directories currently installed.)
> Preparing to replace kdelibs-data 4:3.5.10.dfsg.1-3 (using .../kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb) ...
> Unpacking replacement kdelibs-data ...
> dpkg: error processing /var/cache/apt/archives/kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb (--install):
>  trying to overwrite '/usr/share/doc/kde/HTML/en/common/6.png', which is also in package kdelibs5-data 4:4.4.5-1
> dpkg-deb: subprocess paste killed by signal (Broken pipe)
> Processing triggers for desktop-file-utils ...
> Errors were encountered while processing:
>  /var/cache/apt/archives/kdelibs-data_4%3a3.5.10.dfsg.1-4_all.deb
> # find /usr -name "*.dpkg-tmp" | wc -l
> 4217

I can reproduce this and have even figured out why it happens.  When
upgrading a package containing file "foo", dpkg unpacks the new version
as "foo.dpkg-new" and links the old file to a backup named
"foo.dpkg-tmp".  If unpacking fails, the error unwind consists of
deleting foo.dpkg-new and renaming foo.dpkg-tmp back to foo.

All well, but there is a problem because rename(2) states:

 If oldpath and newpath are existing hard links referring to the same
 file, then rename() does nothing, and returns a success status.

So foo.dpkg-tmp is left on the system and needs to be unlinked.  The
attached patch seems to work for me.

[0001-Remove-spurious-leftover-.dpkg-tmp-files-after-unpac.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Sven Joachim <svenjoac@gmx.de> to control@bugs.debian.org. (Thu, 12 Aug 2010 19:21:08 GMT) Full text and rfc822 format available.

Added tag(s) pending. Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Fri, 13 Aug 2010 04:45:12 GMT) Full text and rfc822 format available.

Message sent on to Helmut Grohne <helmut@subdivi.de>:
Bug#591993. (Fri, 13 Aug 2010 04:45:21 GMT) Full text and rfc822 format available.

Message #17 received at 591993-submitter@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 591993-submitter@bugs.debian.org
Subject: Bug#591993 marked as pending
Date: Fri, 13 Aug 2010 04:42:54 +0000
tag 591993 pending
thanks

Hello,

Bug #591993 reported by you has been fixed in the Git repository. You can
see the changelog below, and you can check the diff of the fix at:

    http://git.debian.org/?p=dpkg/dpkg.git;a=commitdiff;h=6598274

---
commit 6598274e9b04ff7940c1d0201b66c87c79604f56
Author: Sven Joachim <svenjoac@gmx.de>
Date:   Fri Aug 13 05:55:02 2010 +0200

    Remove spurious leftover .dpkg-tmp files after unpacking failure
    
    Renaming the backup copy to the old name is a no-op if these are
    hard links to the same file. So we need to remove the backup copy
    afterwards to make sure it is gone.
    
    Closes: #591993
    
    Signed-off-by: Guillem Jover <guillem@debian.org>

diff --git a/debian/changelog b/debian/changelog
index ee7136e..9ccb703 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,11 @@ dpkg (1.15.8.4) UNRELEASED; urgency=low
   * When analyzing the ELF format of a binary in dpkg-shlibdeps, fallback on
     usual objdump when the cross objdump failed. Closes: #591522
 
+  [ Sven Joachim ]
+  * Ensure removal of leftover backup .dpkg-tmp files after unpacking
+    failures, when the backup is still a hard link to the original file.
+    Closes: #591993
+
  -- Guillem Jover <guillem@debian.org>  Thu, 05 Aug 2010 17:42:51 +0200
 
 dpkg (1.15.8.3) unstable; urgency=low




Reply sent to Guillem Jover <guillem@debian.org>:
You have taken responsibility. (Fri, 13 Aug 2010 05:06:30 GMT) Full text and rfc822 format available.

Notification sent to Helmut Grohne <helmut@subdivi.de>:
Bug acknowledged by developer. (Fri, 13 Aug 2010 05:06:30 GMT) Full text and rfc822 format available.

Message #22 received at 591993-close@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 591993-close@bugs.debian.org
Subject: Bug#591993: fixed in dpkg 1.15.8.4
Date: Fri, 13 Aug 2010 05:02:15 +0000
Source: dpkg
Source-Version: 1.15.8.4

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:

dpkg-dev_1.15.8.4_all.deb
  to main/d/dpkg/dpkg-dev_1.15.8.4_all.deb
dpkg_1.15.8.4.dsc
  to main/d/dpkg/dpkg_1.15.8.4.dsc
dpkg_1.15.8.4.tar.bz2
  to main/d/dpkg/dpkg_1.15.8.4.tar.bz2
dpkg_1.15.8.4_amd64.deb
  to main/d/dpkg/dpkg_1.15.8.4_amd64.deb
dselect_1.15.8.4_amd64.deb
  to main/d/dpkg/dselect_1.15.8.4_amd64.deb
libdpkg-dev_1.15.8.4_amd64.deb
  to main/d/dpkg/libdpkg-dev_1.15.8.4_amd64.deb
libdpkg-perl_1.15.8.4_all.deb
  to main/d/dpkg/libdpkg-perl_1.15.8.4_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 591993@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 13 Aug 2010 06:02:10 +0200
Source: dpkg
Binary: libdpkg-dev dpkg dpkg-dev libdpkg-perl dselect
Architecture: source amd64 all
Version: 1.15.8.4
Distribution: unstable
Urgency: low
Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description: 
 dpkg       - Debian package management system
 dpkg-dev   - Debian package development tools
 dselect    - Debian package management front-end
 libdpkg-dev - Debian package management static library
 libdpkg-perl - Dpkg perl modules
Closes: 590885 590896 591522 591588 591653 591654 591692 591885 591993
Changes: 
 dpkg (1.15.8.4) unstable; urgency=low
 .
   [ Guillem Jover ]
   * Fix use after free segfault on update-alternatives --remove-all.
     Closes: #591653, #591654
   * Always print a massage on warning when parsing control files.
   * On database parsing only warn on bogus versions previously accepted,
     the other instances will keep producing errors, to avoid newly
     introduced bogosity. Closes: #590885, #590896, #591692, #591885
   * Fix compilation on Solaris and Darwin:
     - Link update-alternatives against libintl if libc does not have i18n
       support.
     - Include <limits.h> for _POSIX_MAX_PATH in update-alternatives.
     Thanks to Fabian Groffen <grobian@gentoo.org>.
 .
   [ Raphaƫl Hertzog ]
   * Fix make -C man install so that it actually finds the manual pages
     to install. Closes: #591588
   * When analyzing the ELF format of a binary in dpkg-shlibdeps, fallback on
     usual objdump when the cross objdump failed. Closes: #591522
 .
   [ Sven Joachim ]
   * Ensure removal of leftover backup .dpkg-tmp files after unpacking
     failures, when the backup is still a hard link to the original file.
     Closes: #591993
Checksums-Sha1: 
 fac9e1676644c52bad9c8463c711c48fc76f0d6f 1208 dpkg_1.15.8.4.dsc
 aff67eda19c1cbdfb29de6e292d8e556dcccd72a 5046836 dpkg_1.15.8.4.tar.bz2
 bee11e64e94d65ef57e6fb1a0ae69385e759b341 413956 libdpkg-dev_1.15.8.4_amd64.deb
 7c2e54ec06cdcdc25b96183b32cefcbcef39308f 2121180 dpkg_1.15.8.4_amd64.deb
 bfa764ef681ea1c0c0c4ef7c0245cb20d2a8090a 878214 dselect_1.15.8.4_amd64.deb
 6807437a85bb9e3d05d28b68a8f9d575720bcdab 763614 dpkg-dev_1.15.8.4_all.deb
 8f891dec7f95f81cadd558fc01e40fafab4b8fe4 655124 libdpkg-perl_1.15.8.4_all.deb
Checksums-Sha256: 
 166ebc30856dc2173de289996706a52efe082fc61c69b58c83737a7f3804ca7a 1208 dpkg_1.15.8.4.dsc
 9ee9431fe4fd93b80af8005de492a196b7fee1346225ee3522ee1cd758c3ad21 5046836 dpkg_1.15.8.4.tar.bz2
 6ce89bbce64b5c916d34c4b9bc85cc31639d0be29f01438465b8d9797ed71087 413956 libdpkg-dev_1.15.8.4_amd64.deb
 685625ea99e9698f898d27fe3821822b97a43a287920feae6b3ba016258c1fb5 2121180 dpkg_1.15.8.4_amd64.deb
 d21862a1acbe67df9f5963ea1850cc3241b9911c7ce49a3e03227e21714deb49 878214 dselect_1.15.8.4_amd64.deb
 3490259ad75739f151970d8c215e648e99c13e473e2139a830b056cd23b6427b 763614 dpkg-dev_1.15.8.4_all.deb
 5aa9c0fcb6ee80d6ba36ef173ab250580b9ca8ddcc92996df85920ea316c8d12 655124 libdpkg-perl_1.15.8.4_all.deb
Files: 
 02a56e0d0464b21d7a38f7bfc584177e 1208 admin required dpkg_1.15.8.4.dsc
 6ac142ac3e3d04a9dbc7905b0eef053d 5046836 admin required dpkg_1.15.8.4.tar.bz2
 655d2c902f459c897aee2f5014476c7a 413956 libdevel optional libdpkg-dev_1.15.8.4_amd64.deb
 e76920719fd81bbfe57a7e3bd9dc3a48 2121180 admin required dpkg_1.15.8.4_amd64.deb
 0f8bbc8a881da20c87a64d4493f1ce5d 878214 admin optional dselect_1.15.8.4_amd64.deb
 85ec58c8c0c50233cb3a7866e24af852 763614 utils optional dpkg-dev_1.15.8.4_all.deb
 7334efba28ce544ee112d2a6b7ccce7b 655124 perl optional libdpkg-perl_1.15.8.4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxky9UACgkQuW9ciZ2SjJsYpACcCx18qQSo0jvXsMhntLp5qxG0
HS8AnjqhLZMigzwXVUZUNt0bBDvcGR2P
=1+Yt
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 11 Sep 2010 07:36:56 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 05:49:04 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.