[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#590513: apt-get fails on i386 with 20tb filesystem (statvfs (75: Value too large for defined data type))



On Mo, 2010-07-26 at 15:23 -0700, David Bronaugh wrote:
> Package: apt
> Version: 0.7.25.3
> 
> When I try to install a package inside an i386 chroot on this machine
> (which resides on a 20TB XFS filesystem), it fails to even get to
> downloading the package with the following error messages:
> 
> root@windy:~# apt-get install tinywm
> Reading package lists... Done
> Building dependency tree       
> Reading state information... Done
> The following extra packages will be installed:
>   libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
> The following NEW packages will be installed:
>   libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 tinywm
> 0 upgraded, 6 newly installed, 0 to remove and 6 not upgraded.
> Need to get 1131kB of archives.
> After this operation, 4346kB of additional disk space will be used.
> W: Couldn't determine free space in /var/cache/apt/archives/ - statvfs
> (75: Value too large for defined data type)
> E: Handler silently failed
> root@windy:~#
> 
> It seems like this is likely a result of integer overflow in the data
> structure that statvfs returns. Therefore, it would seem the path
> forward is to use statvfs64().

Fixed in bzr:

=== modified file 'cmdline/apt-get.cc'
--- cmdline/apt-get.cc	2010-07-05 09:34:35 +0000
+++ cmdline/apt-get.cc	2010-07-27 11:21:03 +0000
@@ -25,6 +25,9 @@
    ##################################################################### */
 									/*}}}*/
 // Include Files							/*{{{*/
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+
 #include <apt-pkg/error.h>
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/init.h>
@@ -63,6 +66,9 @@
 #include <regex.h>
 #include <sys/wait.h>
 #include <sstream>
+
+#define statfs statfs64
+#define statvfs statvfs64
 									/*}}}*/
 
 #define RAMFS_MAGIC     0x858458f6

=== modified file 'debian/changelog'
--- debian/changelog	2010-07-23 14:13:15 +0000
+++ debian/changelog	2010-07-27 11:27:18 +0000
@@ -5,6 +5,9 @@ apt (0.7.26~exp11) experimental; urgency
     - Add to history whether a change was automatic or not.
   * apt-pkg/contrib/fileutl.cc:
     - Add FileFd::OpenDescriptor() (needed for python-apt's #383617).
+  * cmdline/apt-get.cc:
+    - Support large filesystems by using statvfs64() instead of statvfs()
+      and statfs64() instead of statfs() (Closes: #590513).
 
  -- Julian Andres Klode <jak@debian.org>  Wed, 21 Jul 2010 17:09:11 +0200
 


-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.





Reply to: