Truncated (0 byte) files on crash during package install

Bug #559915 reported by João Pinto
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Fix Released
High
Colin Watson

Bug Description

Binary package hint: dpkg

While installing the package "quanta" using the software center I have experienced a system hard lock (X got into a white screen), the system was unresponsive.
After booting I have noted that the quant menu entry was not available.
APT did not complain about broken packages, however I have noted that quanta.desktop was 0 bytes.
I have attempted to fix it with "sudo apt-get install --reinstall quanta", the install was successful but I noted that there other files installed from quanta dependency packages where also truncated:
Rebuilding /usr/share/applications/desktop.pt_PT.utf8.cache...
Invalid desktop file /usr/share/applications/kde4/cervisia.desktop: ParsingError in file '/usr/share/applications/kde4/cervisia.desktop', [Desktop Entry]-Header missing
Invalid desktop file /usr/share/applications/kde4/kompare.desktop: ParsingError in file '/usr/share/applications/kde4/kompare.desktop', [Desktop Entry]-Header missing
Invalid desktop file /usr/share/applications/kde/kfilereplace.desktop: ParsingError in file '/usr/share/applications/kde/kfilereplace.desktop', [Desktop Entry]-Header missing
Invalid desktop file /usr/share/applications/kde/kmdr-editor.desktop: ParsingError in file '/usr/share/applications/kde/kmdr-editor.desktop', [Desktop Entry]-Header missing
Invalid desktop file /usr/share/applications/kde/klinkstatus.desktop: ParsingError in file '/usr/share/applications/kde/klinkstatus.desktop', [Desktop Entry]-Header missing

debsums did not help because the /var/lib/dpkg/info/cervisia.md5sums file is also truncated (I am going to file a bug for debsums for this as it should warn the user).

I am not sure this is a filesystem related corruption but I hope somehow it can be prevented at the application level, or at least add some validation on dpkg/apt for this scenario (warn on truncated md5sums ?, this would be a quick check).

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: dpkg 1.15.5.6ubuntu3
ProcVersionSignature: Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-19-generic x86_64
Architecture: amd64
Date: Sat Apr 10 10:40:55 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
 LANGUAGE=pt:pt_BR:en
 PATH=(custom, user)
 LANG=pt_PT.utf8
 SHELL=/bin/bash
SourcePackage: dpkg

Related branches

Revision history for this message
João Pinto (joaopinto) wrote :
Revision history for this message
João Pinto (joaopinto) wrote :

It seems that all files installed from the package are 0 bytes:
-rwxr-xr-x 1 root root 0 2010-03-31 16:47 /usr/bin/cervisia

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

This is a side effect of the fix for bug 512096. Part of this fix had to be reverted due to performance issues. When a crash occurs during an upgrade, the files extracted from the archive during the last 30 seconds (default system value) before the crash are 0 bytes excepted the control files.

setting to triaged.

Changed in dpkg (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
João Pinto (joaopinto) wrote :

The most concerning aspect of this bug is that you get corrupted packages without any indication of such condition. Non techie users will not easily found & fix the truncated files.

Colin Watson (cjwatson)
Changed in dpkg (Ubuntu):
status: Triaged → Fix Committed
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dpkg - 1.15.5.6ubuntu4

---------------
dpkg (1.15.5.6ubuntu4) lucid; urgency=low

  * Backport from upstream:
    - Restore fsync during package unpack (LP: #559915). This is now done
      by deferring the fsync and rename for normal files in tar extraction
      so that it's done in one pass afterwards, to avoid massive I/O
      degradation due to the serialization from each write + fsync. When
      creating hard links to normal files on extraction use the .dpkg-new
      filename for source as the file is not yet in place due to the rename
      deferral.
    - Fix dpkg to not lose package metadata on filesystems where readdir()
      returns new files added after the opendir() call, btrfs in particular
      triggered the problematic behaviour. Closes: #575891
    - Report deferred trigger errors on status-fd. Closes: #574599,
      LP: #540252
      Thanks to Michael Vogt <email address hidden>.
 -- Colin Watson <email address hidden> Thu, 15 Apr 2010 12:38:50 +0100

Changed in dpkg (Ubuntu):
status: Fix Committed → Fix Released
jdcorm (jdcormier)
Changed in dpkg (Ubuntu):
assignee: Colin Watson (cjwatson) → jdcorm (jdcormier)
Colin Watson (cjwatson)
Changed in dpkg (Ubuntu):
assignee: jdcorm (jdcormier) → Colin Watson (cjwatson)
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.