dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed. Aborted

Bug #573696 reported by GerhardGaußling
76
This bug affects 9 people
Affects Status Importance Assigned to Milestone
dpkg (Debian)
Fix Released
Unknown
dpkg (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: dpkg

I tried a do-release-upgrade from Hardy to lucid, but it failed on installing perl:

~$ sudo dpkg -i --force-all /var/cache/apt/archives/perl_5.10.1-8ubuntu2_amd64.deb
(Reading database ... 524499 files and directories currently installed.)
Preparing to replace perl 5.10.1-8ubuntu2 (using .../perl_5.10.1-8ubuntu2_amd64.deb) ...
Unpacking replacement perl ...
dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.
Aborted

This may be related to these bugs?
https://bugs.launchpad.net/ecryptfs/+bug/524919
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561991

~$ dpkg -l liblocale*perl* perl* libperl*|grep ^i
ii liblocale-gettext-perl 1.05-6 Using libc functions for internationalizatio
ii libperl5.10 5.10.1-8ubuntu2 shared Perl library
iHR perl 5.10.1-8ubuntu2 Larry Wall's Practical Extraction and Report
ii perl-base 5.10.1-8ubuntu2 minimal Perl system
iU perl-doc 5.10.1-8ubuntu2 Perl documentation
iU perl-mapscript 5.6.1-1ubuntu1 Perl MapServer library
iU perl-modules 5.10.1-8ubuntu2 Core Perl modules
iU perl-suid 5.10.1-8ubuntu2 runs setuid Perl scripts
iU perl-tk 1:804.028-6 Perl module providing the Tk graphics librar
ii perlmagick 7:6.3.7.9.dfsg1-2ubuntu1.1 Perl interface to the libMagick graphics rou

~$ apt-cache policy libperl5.10 perl-tk perl-suid perl-modules perl-mapscript perl-doc perl-base perl dpkg liblocale-gettext-perl
libperl5.10:
  Installed: 5.10.1-8ubuntu2
  Candidate: 5.10.1-8ubuntu2
  Version table:
 *** 5.10.1-8ubuntu2 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
perl-tk:
  Installed: 1:804.028-6
  Candidate: 1:804.028-6
  Version table:
 *** 1:804.028-6 0
        500 http://de.archive.ubuntu.com lucid/universe Packages
        100 /var/lib/dpkg/status
perl-suid:
  Installed: 5.10.1-8ubuntu2
  Candidate: 5.10.1-8ubuntu2
  Version table:
 *** 5.10.1-8ubuntu2 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
perl-modules:
  Installed: 5.10.1-8ubuntu2
  Candidate: 5.10.1-8ubuntu2
  Version table:
 *** 5.10.1-8ubuntu2 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
perl-mapscript:
  Installed: 5.6.1-1ubuntu1
  Candidate: 5.6.1-1ubuntu1
  Version table:
 *** 5.6.1-1ubuntu1 0
        500 http://de.archive.ubuntu.com lucid/universe Packages
        100 /var/lib/dpkg/status
perl-doc:
  Installed: 5.10.1-8ubuntu2
  Candidate: 5.10.1-8ubuntu2
  Version table:
 *** 5.10.1-8ubuntu2 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
perl-base:
  Installed: 5.10.1-8ubuntu2
  Candidate: 5.10.1-8ubuntu2
  Version table:
 *** 5.10.1-8ubuntu2 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
perl:
  Installed: 5.10.1-8ubuntu2
  Candidate: 5.10.1-8ubuntu2
  Version table:
 *** 5.10.1-8ubuntu2 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
dpkg:
  Installed: 1.15.5.6ubuntu4
  Candidate: 1.15.5.6ubuntu4
  Version table:
 *** 1.15.5.6ubuntu4 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status
liblocale-gettext-perl:
  Installed: 1.05-6
  Candidate: 1.05-6
  Version table:
 *** 1.05-6 0
        500 http://de.archive.ubuntu.com lucid/main Packages
        500 http://archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status

This results in a system in unknown state:
~$ sudo apt-get -f install
[sudo] password for gerhard:
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of libintl-xs-perl:
 libintl-xs-perl depends on perl (>= 5.10.0-24ubuntu4); however:
  Package perl is not installed.
dpkg: error processing libintl-xs-perl (--configure):
 dependency problems - leaving unconfigured
[...]
 libapache2-reload-perl
 libemail-find-perl
Processing was halted because there were too many errors.

Or:
sudo aptitude remove vim-gtk vim-gnome doc-base gnumeric-plugins-extra irssi dhelp libapache2-mod-perl2 elinks xchat pidgin
[...]
47 packages upgraded, 14 newly installed, 37 to remove and 2959 not upgraded.
Need to get 0B/8333kB of archives. After unpacking 17.4MB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Error!
E: I wasn't able to locate file for the libio-stringy-perl package. This might mean you need to manually fix this package.

after that I tried:
~$ sudo aptitude install libio-stringy-perl
[...]
Score is 2766

Accept this solution? [Y/n/q/?]
The following packages are unused and will be REMOVED:
[...]
48 packages upgraded, 14 newly installed, 35 to remove and 2958 not upgraded.
Need to get 0B/75.9MB of archives. After unpacking 21.5MB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
/usr/bin/perl: symbol lookup error: /usr/lib/perl5/auto/Text/Iconv/Iconv.so: undefined symbol: Perl_Tstack_sp_ptr
(Reading database ... 524494 files and directories currently installed.)
Removing libapache2-request-perl ...
Removing libapparmor-perl ...
Removing libapt-pkg-perl ...
Removing libdata-page-perl ...
Removing libclass-accessor-chained-perl ...
Removing libclass-accessor-perl ...
Removing libconfig-file-perl ...
Removing libfile-libmagic-perl ...
Removing libio-compress-base-perl ...
Removing libio-compress-zlib-perl ...
Removing perl-mapscript ...
(Reading database ... 524331 files and directories currently installed.)
Preparing to replace perl 5.10.1-8ubuntu2 (using .../perl_5.10.1-8ubuntu2_amd64.deb) ...
Unpacking replacement perl ...
dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.
E: Sub-process /usr/bin/dpkg exited unexpectedly
A package failed to install. Trying to recover:
dpkg: dependency problems prevent configuration of libintl-xs-perl:
 libintl-xs-perl depends on perl (>= 5.10.0-24ubuntu4); however:
  Package perl is not installed.
dpkg: error processing libintl-xs-perl (--configure):
 dependency problems - leaving unconfigured
[...]
dpkg: error processing libio-socket-ssl-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: too many errors, stopping
Errors were encountered while processing:
 libintl-xs-perl
[...]
libio-socket-ssl-perl
Processing was halted because there were too many errors.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done

etc. I'm not able to upgrade the system, and I'm sure it won't boot:

~$ sudo aptitude full-upgrade
2941 packages upgraded, 971 newly installed, 279 to remove and 0 not upgraded.
Need to get 11.6MB/3584MB of archives. After unpacking 3306MB will be used.
The following packages have unmet dependencies:
  xserver-xorg-video-all: Depends: xserver-xorg-video-apm but it is not installable
                          Depends: xserver-xorg-video-ark but it is not installable
                          Depends: xserver-xorg-video-ati but it is not installable
                          Depends: xserver-xorg-video-chips but it is not installable
                          Depends: xserver-xorg-video-mga but it is not installable
                          Depends: xserver-xorg-video-s3virge but it is not installable
                          Depends: xserver-xorg-video-v4l but it is not installable
  console-setup: Depends: kbd (>= 1.15-1ubuntu3) but it is not installable
[...]
Resolving dependencies...
open: 5273; closed: 4890; defer: 0; conflict: 77 ONo solution found within the allotted time. Try harder? [Y/n]
Resolving dependencies...
open: 10564; closed: 9909; defer: 0; conflict: 91 .No solution found within the allotted time. Try harder? [Y/n]n
Abandoning all efforts to resolve these dependencies.
Abort.

Please, help me to find a workaround.

Tags: oneiric
Revision history for this message
GerhardGaußling (ggrubbish-web) wrote :

This bugreport might also be related:
Perl upgrade fails
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479220

~$ sudo debconf-show
/usr/bin/perl: symbol lookup error: /usr/lib/perl5/auto/Text/Iconv/Iconv.so: undefined symbol: Perl_Tstack_sp_ptr

Another try (these packages were in a hold state before)

~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
  cupsys-bsd: Depends: libcupsys2 (>= 1.3.4)
[...]
libgtk2-perl: Depends: libpango-perl (>= 1.220) but it is not installed
[...]
  xfprint4: Depends: libcupsys2 (>= 1.3.4)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

~$ sudo aptitude unhold cinepaint-data enblend freeglut3-dev libglut3-dev libplot-dev libxaw-headers libxaw7-dev
[...]
0 packages upgraded, 0 newly installed, 10 to remove and 3019 not upgraded.
Need to get 0B/4400kB of archives. After unpacking 2245kB will be freed.
The following packages have unmet dependencies:
  libtk-tablematrix-perl: Depends: perlapi-5.8.8 which is a virtual package.
[...]
  libio-socket-ssl-perl: Depends: libnet-ssleay-perl (>= 1.35) but 1.30-1 is installed and it is kept back.
Resolving dependencies...
E: I wasn't able to locate file for the libio-stringy-perl package. This might mean you need to manually fix this package.
The following actions will resolve these dependencies:

Remove the following packages:
[...]
Score is 2423

Accept this solution? [Y/n/q/?]
[...]
47 packages upgraded, 14 newly installed, 24 to remove and 2959 not upgraded.
Need to get 0B/8333kB of archives. After unpacking 26.6MB will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Error!
E: I wasn't able to locate file for the libio-stringy-perl package. This might mean you need to manually fix this package.

Anyway, they are no longer in the hold state:
~$ aptitude search "~ahold" | grep "^.h"
~$

Thank you in advance

Revision history for this message
GerhardGaußling (ggrubbish-web) wrote :

~$ sudo dpkg -i /var/cache/apt/archives/libio-stringy-perl_2.110-4_all.deb
(Reading database ... 524331 files and directories currently installed.)
Preparing to replace libio-stringy-perl 2.110-3 (using .../libio-stringy-perl_2.110-4_all.deb) ...
Unpacking replacement libio-stringy-perl ...
dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.
Aborted

Revision history for this message
Pascal de Bruijn (pmjdebruijn) wrote :

Parts of your UNIX filesystem should simply never live on NTFS in any case...

Revision history for this message
GerhardGaußling (ggrubbish-web) wrote :

Yes, it came to my mind while reading this bugreport:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/524919

I could resolve these errors by debugging with dpkg -D163

e.g.:
Preparing to replace enscript 1.6.4-12ubuntu0.8.04.1 (using .../enscript_1.6.5-1_amd64.deb) ...
Unpacking replacement enscript ...
dpkg: error processing /var/cache/apt/archives/enscript_1.6.5-1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/enscript/hl/octave.st', which is also in package octave3.0 1:3.0.0-9ubuntu1
dpkg-deb: subprocess paste killed by signal (Broken pipe)
[...]
root@ubuntu:~# dpkg -i --force-overwrite /var/cache/apt/archives/enscript_1.6.5-1_amd64.deb
(Reading database ... 550292 files and directories currently installed.)
Preparing to replace enscript 1.6.5-1 (using .../enscript_1.6.5-1_amd64.deb) ...
Unpacking replacement enscript ...
dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.
Aborted
root@ubuntu:~# dpkg -i --force-overwrite -D163 /var/cache/apt/archives/enscript_1.6.5-1_amd64.deb
(Reading database ... 550292 files and directories currently installed.)
Preparing to replace enscript 1.6.5-1 (using .../enscript_1.6.5-1_amd64.deb) ...
D000020: process_archive conffile `/etc/enscript.cfg' package=enscript same hash=a07c6bdfa820e78cb6c570434e9e5187
D000001: process_archive oldversionstatus=broken due to failed removal or installation
D000002: maintainer_script_new nonexistent preinst `/var/lib/dpkg/tmp.ci/preinst'
Unpacking replacement enscript ...
D000100: setupvnamevbs main=`/.' tmp=`/..dpkg-tmp' new=`/..dpkg-new'
[...]
D000100: setupvnamevbs main=`/usr/share/doc/enscript/index.html' tmp=`/usr/share/doc/enscript/index.html.dpkg-tmp' new=`/usr/share/doc/enscript/index.html.dpkg-new'
D000100: tarobject already exists
D000100: tarobject SymbolicLink creating
dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.
Aborted
root@ubuntu:~# mv -v /usr/share/doc/enscript/index.html /usr/share/doc/enscript/index.html_old
`/usr/share/doc/enscript/index.html' -> `/usr/share/doc/enscript/index.html_old'
root@ubuntu:~# dpkg -i --force-overwrite /var/cache/apt/archives/enscript_1.6.5-1_amd64.deb
(Reading database ... 550292 files and directories currently installed.)
Preparing to replace enscript 1.6.5-1 (using .../enscript_1.6.5-1_amd64.deb) ...
Unpacking replacement enscript ...
Setting up enscript (1.6.5-1) ...
Installing new version of config file /etc/enscript.cfg ...
Processing triggers for install-info ...

I then moved the doc folder to an ext3 partitition and symlinked it again.

Now everything seems to be fine.

Please, feel free to close this bugreport.

Revision history for this message
James Sparenberg (james-linuxrebel) wrote :

I'd like to say not yet on closing this. As this bug affects the ability to do custom CD's for ubuntu installation as well. Even an attempt to something like upgrade/update a CD is affected... 9.10 still would allow me to do an apt-get update (customization done IAW https://help.ubuntu.com/community/LiveCDCustomization) and associated installation of packages. I can take a 9.04 CD break it out like this and do an apt-get upgrade to 9.10. If I attempt to do either one of these two processes. (upgrade 9.10 to 10.4 in the chroot jail, or just do an apt-get update of 10.4) I get the now for me infamous dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.

The following is an excerpt from inside the chroot jail. When attempting to upgrade from 9.10. If I do an attempt just to update 10.4, it will fail out on base-files.

root@jacer:/# sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  kdebase-runtime-data-common policykit liblzma0 kdebase-runtime-bin-kde4
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libgdbm3 libperl5.10 perl perl-base
Suggested packages:
  perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl
The following packages will be upgraded:
  libgdbm3 libperl5.10 perl perl-base
4 upgraded, 0 newly installed, 0 to remove and 1332 not upgraded.
2 not fully installed or removed.
Need to get 0B/5527kB of archives.
After this operation, 98.3kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 156274 files and directories currently installed.)
Preparing to replace libgdbm3 1.8.3-4 (using .../libgdbm3_1.8.3-9_amd64.deb) ...
Unpacking replacement libgdbm3 ...
dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed.
E: Sub-process /usr/bin/dpkg exited unexpectedly

Revision history for this message
Alan Robertson (alanr-unix) wrote :

This behavior also shows up when making a chrooted distribution in an encrypted filesystem as per https://bugs.launchpad.net/ubuntu/+source/linux/+bug/524919. However, I believe that if our implementation of ntfs APIs breaks it, that it should also be fixed there.

Revision history for this message
Dimo Fedortchenko (zeraien) wrote :

My ubuntu installation does not live on NTFS and I'm still having this issue:

Preparing to replace gnome-user-guide 3.0.0+git20110406ubuntu10 (using .../gnome-user-guide_3.0.0+git20110406ubuntu11_all.deb) ...
Unpacking replacement gnome-user-guide ...
dpkg: ../../src/archives.c:968: tarobject: Assertion `r == stab.st_size' failed.
E: Sub-process /usr/bin/dpkg exited unexpectedly

I cleaned out all apt cache, tried uninstalling it, upgrading it, forcing it purging it with apt-get but that all failed.
In the end I had to uninstall it manually using dpkg:

sudo dpkg --remove --force-remove-reinstreq gnome-user-guide

Hard to say what the problem was, this was a pretty fresh install.

Revision history for this message
Raphaël Hertzog (hertzog) wrote : Re: [Bug 573696] Re: dpkg: ../../src/archives.c:763: tarobject: Assertion `r == stab.st_size' failed. Aborted

On Wed, 17 Aug 2011, Dmitri Fedortchenko wrote:
> My ubuntu installation does not live on NTFS and I'm still having this
> issue:
>
> Preparing to replace gnome-user-guide 3.0.0+git20110406ubuntu10 (using .../gnome-user-guide_3.0.0+git20110406ubuntu11_all.deb) ...
> Unpacking replacement gnome-user-guide ...
> dpkg: ../../src/archives.c:968: tarobject: Assertion `r == stab.st_size' failed.
> E: Sub-process /usr/bin/dpkg exited unexpectedly
[...]
> Hard to say what the problem was, this was a pretty fresh install.

Which version of dpkg and Ubuntu are you using?

Can you also use -D131 to the dpkg invocation that is failing
and send me the log?

Also identify the problematic file with this log and check where it's
stored. What filesystem is in use for the file that is failing?

The dpkg code verifying this does basically only this:
lstat(file, &stab);
r = readlink(file, buf, stab.st_size + 1);
assert(r == stab.st_size);

So the if "lstat" and the "readlink" disagree, either there's a lower
level bug (like a filesystem not working properly) or something else
changed the symlink between the lstat() and the readlink().

Cheers,
--
Raphaël Hertzog ◈ Debian Developer

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
                      ▶ http://RaphaelHertzog.fr (Français)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dpkg (Ubuntu):
status: New → Confirmed
Revision history for this message
Gary M (garym) wrote :

Just had this error trying to update the gwibber-service package, on an oneiric beta live-usb (which has persistence and recent updates).

dpkg version is 1.16.0.3 (i386).

Attached is the output from dpkg -i -D131 gwibber-service_3.2.0-0ubuntu1_all.deb

tags: added: oneiric
Revision history for this message
Raphaël Hertzog (hertzog) wrote :

Gary, so drop /usr/lib/python2.6/dist-packages/gwibber/microblog/dispatcher.py and retry.

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

The fix for this has been included in dpkg 1.16.1 upstream.

Changed in dpkg (Ubuntu):
status: Confirmed → Fix Committed
Changed in dpkg (Debian):
status: Unknown → Fix Released
Revision history for this message
Gary M (garym) wrote :

Dropping the damaged link and retrying the package upgrade fixed that. And thanks for the upstream work. Now I should check the file-system...

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

This is part of dpkg 1.16.1 which has been merged in Ubuntu Precise.

Changed in dpkg (Ubuntu):
status: Fix Committed → 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.