[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/14302] New: ar mishandles 4GB files
From: |
fgouget at codeweavers dot com |
Subject: |
[Bug binutils/14302] New: ar mishandles 4GB files |
Date: |
Wed, 27 Jun 2012 09:15:54 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=14302
Bug #: 14302
Summary: ar mishandles 4GB files
Product: binutils
Version: 2.23 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: binutils
AssignedTo: address@hidden
ReportedBy: address@hidden
Classification: Unclassified
Created attachment 6488
--> http://sourceware.org/bugzilla/attachment.cgi?id=6488
A fix for 'ar tv' and 'ar x'
This is similar to bug 13534 but with 4+GB files and only impacts 32bit
platforms.
$ dd if=/dev/zero of=file4G bs=1M count=4196
4196+0 records in
4196+0 records out
4399824896 bytes (4.4 GB) copied, 38.398 s, 115 MB/s
$ ~/binutils-cvs/binutils/ar q ar4G.ar file4G
/home/fgouget/binutils-cvs/binutils/ar: creating ar4G.ar
$ od -a ar4G.ar
0000000 ! < a r c h > nl f i l e 4 G / sp
0000020 sp sp sp sp sp sp sp sp 1 3 4 0 7 8 6 0
0000040 3 0 sp sp 1 0 0 0 sp sp 1 0 0 0 sp sp
0000060 1 0 0 6 4 4 sp sp 4 3 9 9 8 2 4 8
0000100 9 6 ` nl nul nul nul nul nul nul nul nul nul nul nul nul
0000120 nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul
^C
$ ~/binutils-cvs/binutils/ar tv ar4G.ar
rw-r--r-- 1000/1000 104857600 Jun 27 10:38 2012 file4G
$ ~/binutils-cvs/binutils/ar x ar4G.ar
$ ls -l file4G
-rw-r--r-- 1 fgouget fgouget 104857600 Jun 27 11:11 file41G
The od command shows that the ar archive was created correctly. However 'ar tv'
and 'ar x' think it is a 100MB file which is incorrect.
This happens because print_arelt_descr(), print_contents() and extract_file()
use 32bit size_t variables instead of bfd_size_type ones.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
- [Bug binutils/14302] New: ar mishandles 4GB files,
fgouget at codeweavers dot com <=
- [Bug binutils/14302] ar mishandles 4GB files, fgouget at codeweavers dot com, 2012/06/27
- [Bug binutils/14302] ar mishandles 4GB files, fgouget at codeweavers dot com, 2012/06/27
- [Bug binutils/14302] ar mishandles 4GB files, fgouget at codeweavers dot com, 2012/06/27
- [Bug binutils/14302] ar mishandles 4GB files, nickc at redhat dot com, 2012/06/29
- [Bug binutils/14302] ar mishandles 4GB files, cvs-commit at gcc dot gnu.org, 2012/06/29
- [Bug binutils/14302] ar mishandles 4GB files, fgouget at codeweavers dot com, 2012/06/29