Bug 1288662 - openat() && write() broken on i386 with _FILE_OFFSET_BITS 64
openat() && write() broken on i386 with _FILE_OFFSET_BITS 64
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
23
i386 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Florian Weimer
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-04 17:27 EST by Pavel Raiskup
Modified: 2015-12-06 14:18 EST (History)
8 users (show)

See Also:
Fixed In Version: glibc-2.22-6.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-06 14:18:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Reproducer (srpm) (6.16 KB, application/octet-stream)
2015-12-04 17:32 EST, Pavel Raiskup
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 18781 None None None Never

  None (edit)
Description Pavel Raiskup 2015-12-04 17:27:20 EST
This issue breaks GNU tar for big files.  See:
https://copr.fedoraproject.org/coprs/praiskup/tar/monitor/

Reproducer (always fails with 'write: File too large'):

#define _FILE_OFFSET_BITS 64

#include <sys/types.h>
#include <unistd.h>

#include <fcntl.h>
#include <stdio.h>

int main()
{
  char buf[512];
#if 1
  /* this makes the following write() fail */
  int fd = openat (AT_FDCWD, "sparsefile", O_WRONLY | O_CREAT, 420);
#else
  /* this is OK */
  int fd = open ("sparsefile", O_WRONLY | O_CREAT, 420);
#endif
  if ((off_t)-1 == lseek (fd, 8589935104, SEEK_SET)) {
    perror ("lseek");
    return 1;
  }

  if ((ssize_t)-1 == write(fd, buf, 512)) {
    perror ("write");
    return 1;
  }

  return 0;
}
Comment 2 Pavel Raiskup 2015-12-04 18:33:30 EST
# rpm -q glibc
glibc-2.22-5.fc23.i686
Comment 3 Florian Weimer 2015-12-05 07:21:40 EST
glibc-2.22-5.fc23.i686 confirmed as affected, but glibc-2.21-5.fc22.i686 is not.
Comment 4 Fedora Update System 2015-12-05 11:47:53 EST
glibc-2.22-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-7174c4d68d
Comment 5 Fedora Update System 2015-12-06 12:20:41 EST
glibc-2.22-6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update glibc'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-7174c4d68d
Comment 6 Fedora Update System 2015-12-06 14:18:21 EST
glibc-2.22-6.fc23 has been pushed to the Fedora 23 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.