Bug 759655 - tree doesn't display large files
Summary: tree doesn't display large files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tree
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-02 23:00 UTC by Richard Fearn
Modified: 2011-12-10 19:48 UTC (History)
1 user (show)

Fixed In Version: tree-1.6.0-3.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-10 19:48:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Richard Fearn 2011-12-02 23:00:55 UTC
Description of problem:

Large files are omitted from tree's output because tree isn't compiled with -D_FILE_OFFSET_BITS=64.

Version-Release number of selected component (if applicable):

tree-1.6.0-2.fc16.i686

How reproducible:

Every time, for large files.

Steps to Reproduce:
1. Run tree on a directory containing a large file

Actual results:

-----------------------------------------------------------------------
$ tree
.
`-- Fedora-16-i386-CHECKSUM

0 directories, 1 file
$ ls -l
total 3720804
-r--r--r--. 1 rich rich       1112 Nov  4 15:01 Fedora-16-i386-CHECKSUM
-r--r--r--. 1 rich rich 3806375936 Nov  3 04:18 Fedora-16-i386-DVD.iso
-----------------------------------------------------------------------

Expected results:

Fedora-16-i386-DVD.iso should be displayed in tree's output.

Additional info:

The spec file does this:

  %build
  make CFLAGS="$RPM_OPT_FLAGS" "CPPFLAGS=$(getconf LFS_CFLAGS)" %{?_smp_mflags}

I think the 'getconf' part should be in the CFLAGS; the Makefile doesn't pass CPPFLAGS to gcc. This can be seen in the build log:

  http://kojipkgs.fedoraproject.org/packages/tree/1.6.0/2.fc16/data/logs/i686/build.log

In that log, the 'make' command contains:

  'CPPFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'

but the gcc commands don't include the FILE_OFFSET_BITS variable.

tree does an 'lstat' on each file it finds in a directory. Using gdb shows that lstat returns -1 and errno is set to 75 (EOVERFLOW). According to the man page for lstat(2), EOVERFLOW occurs when:

      (stat()) path refers to a file whose  size  cannot  be
      represented in the type off_t.  This can occur when an
      application compiled  on  a  32-bit  platform  without
      -D_FILE_OFFSET_BITS=64  calls  stat()  on a file whose
      size exceeds (1<<31)-1 bits.

Because lstat returns -1, tree ignores the large file.

Comment 1 Fedora Update System 2011-12-05 14:32:39 UTC
tree-1.6.0-3.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/tree-1.6.0-3.fc16

Comment 2 Fedora Update System 2011-12-06 01:03:01 UTC
Package tree-1.6.0-3.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing tree-1.6.0-3.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16818/tree-1.6.0-3.fc16
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2011-12-10 19:48:58 UTC
tree-1.6.0-3.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.