public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/17086] New: IOStreams Large File Support (> 2 GB) not fully implemented.
@ 2004-08-18 19:20 scrimr at louisville dot stortek dot com
  2004-08-18 19:28 ` [Bug libstdc++/17086] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 7+ messages in thread
From: scrimr at louisville dot stortek dot com @ 2004-08-18 19:20 UTC (permalink / raw)
  To: gcc-bugs

Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-
ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.1

Solaris 8 patch level is generic_108528-17 recommended patch cluster

I converted this code from c library functions that did work for 64-bit files.  
Before the 3.4.1 compiler I could not create files >2 GB with this stream code 
but it was completely working properly for files <= 2 GB(-1).

With the same program I can write files larger than 2 GB with the ofstream 
class (e.g. 5 GB), which I could not do before gcc 3.4.1, but now I am unable 
to seekg in files of any size with the ifsteam class. I also cannot 
sequentially read (without seeks) in files larger than 2 GB with the ifstream 
class (e.g. 5 GB).

Code Snippit that fails (throws exception) is as follows:

  inStream.exceptions( ios::failbit | ios::badbit );
  inStream.open( fileToProcess.c_str(), ios::in | ios::binary | ios::ate );

  ...

  int markerLength = (verificationMarker()).size(); // = 5
  inStream.seekg( -(rawSumLength()+markerLength),ios::cur); // 5 + 16

  ...

  SumMarkerFromFile = new char[markerLength+1];
  SumMarkerFromFile[markerLength] = '\0';
  inStream.read( SumMarkerFromFile, markerLength );
  
The code opens the ifstream for a file in binary mode and at the end of the 
file.  Then I try to back up 21 bytes for some data that I need to read.  Then 
I try to read it and the code then throws an exception on the read.  Both seekg 
and open do not seem to be failing.  read is throwing an exception.  The 
problem seems to occurs regardless of file size.  I think the seekg call is 
causing a bad stream state and then the read throws an exception because of the 
bad stream state.  Keep in mind that this does not work even for file less than 
or equal to 2 GB with the 3.4.1 compiler/libraies.

Anyway, seekg may be one of the failing components.  The wierd thing is that if 
I open a file and read it sequentially without seeks for files smaller than 2 
GB it works fine.  For files above 2 GB, the sequential reading does not work 
and does not even throw exceptions.  It appears to work but I know there is no 
way that it read a 5 GB file in less than a second.  So, it does not appear to 
be working here either.

I think this iostreams LFS support needs to be carefully rechecked for 
completeness.  Also, it seems that iostreams support in general seems to be 
broken for files below 2 GB now (e.g. seekg).

If you have any questions or suggestions I would love to hear them.  If you 
think I am doing something wrong I would love to hear that too.

-- 
           Summary: IOStreams Large File Support (> 2 GB) not fully
                    implemented.
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: scrimr at louisville dot stortek dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: 3.4.1
  GCC host triplet: 3.4.1
GCC target triplet: 3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/17086] IOStreams Large File Support (> 2 GB) not fully implemented.
  2004-08-18 19:20 [Bug libstdc++/17086] New: IOStreams Large File Support (> 2 GB) not fully implemented scrimr at louisville dot stortek dot com
@ 2004-08-18 19:28 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-18 19:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-18 19:28 -------


*** This bug has been marked as a duplicate of 12882 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/17086] IOStreams Large File Support (> 2 GB) not fully implemented.
       [not found] <20040818192027.17086.idonotknow232@comcast.net>
                   ` (3 preceding siblings ...)
  2004-08-18 21:24 ` idonotknow232 at comcast dot net
@ 2004-09-06 20:04 ` pcarlini at suse dot de
  4 siblings, 0 replies; 7+ messages in thread
From: pcarlini at suse dot de @ 2004-09-06 20:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-09-06 20:04 -------
Ok, I guess that we can close this for now: in case a short testcase is able to 
show a real, reproducible problem on solaris, please let us know as soon as 
possible. 
Thanks. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/17086] IOStreams Large File Support (> 2 GB) not fully implemented.
       [not found] <20040818192027.17086.idonotknow232@comcast.net>
                   ` (2 preceding siblings ...)
  2004-08-18 20:42 ` pcarlini at suse dot de
@ 2004-08-18 21:24 ` idonotknow232 at comcast dot net
  2004-09-06 20:04 ` pcarlini at suse dot de
  4 siblings, 0 replies; 7+ messages in thread
From: idonotknow232 at comcast dot net @ 2004-08-18 21:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From idonotknow232 at comcast dot net  2004-08-18 21:24 -------
Paolo,

Tried described code in small test program.  This seems to works for files > 
and < 2GB.  I am stumped why it works in my small test program and not in my 
app.  I will need to perform more testing.  I will pull my app apart and try to 
isolate problem.  The code is tucked away in a class and I may need to isolate 
the class and test the class by itself.  I will let you know if I can reproduce.

-- Robert

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|3.4.1                       |sparc-sun-solaris2.8
   GCC host triplet|3.4.1                       |sparc-sun-solaris2.8
 GCC target triplet|3.4.1                       |sparc-sun-solaris2.8


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/17086] IOStreams Large File Support (> 2 GB) not fully implemented.
       [not found] <20040818192027.17086.idonotknow232@comcast.net>
  2004-08-18 20:18 ` pcarlini at suse dot de
  2004-08-18 20:18 ` pcarlini at suse dot de
@ 2004-08-18 20:42 ` pcarlini at suse dot de
  2004-08-18 21:24 ` idonotknow232 at comcast dot net
  2004-09-06 20:04 ` pcarlini at suse dot de
  4 siblings, 0 replies; 7+ messages in thread
From: pcarlini at suse dot de @ 2004-08-18 20:42 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/17086] IOStreams Large File Support (> 2 GB) not fully implemented.
       [not found] <20040818192027.17086.idonotknow232@comcast.net>
  2004-08-18 20:18 ` pcarlini at suse dot de
@ 2004-08-18 20:18 ` pcarlini at suse dot de
  2004-08-18 20:42 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pcarlini at suse dot de @ 2004-08-18 20:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/17086] IOStreams Large File Support (> 2 GB) not fully implemented.
       [not found] <20040818192027.17086.idonotknow232@comcast.net>
@ 2004-08-18 20:18 ` pcarlini at suse dot de
  2004-08-18 20:18 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pcarlini at suse dot de @ 2004-08-18 20:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-08-18 20:18 -------
Actually, this one isn't a real duplicate of libstdc++/12882.

The latter is only about a -very- limited (QoI, not conformance) issue: showmanyc
returning zero for large files.

This PR would be about -basic- functionaly of large and also regular sized
files I/O on sparc.

Now: currently we support large files I/O only on selected 32 bit platforms
(besides, automatically, all of the 64 bit platforms), thos using GNU Libc. The
sparc-sun-solaris target is -not- among those.

On the other hand, normal (< 2G) I/O -must- absolutely work on all platforms
and we don't have any PR about this issue, that would highest priority,
probably a blocker for 3.4.2.

Could you please provide a short, self-contained, compilable testcase giving
problems on sparc? Without it we cannot take further actions.

Thanks.
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17086


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-09-06 20:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-18 19:20 [Bug libstdc++/17086] New: IOStreams Large File Support (> 2 GB) not fully implemented scrimr at louisville dot stortek dot com
2004-08-18 19:28 ` [Bug libstdc++/17086] " pinskia at gcc dot gnu dot org
     [not found] <20040818192027.17086.idonotknow232@comcast.net>
2004-08-18 20:18 ` pcarlini at suse dot de
2004-08-18 20:18 ` pcarlini at suse dot de
2004-08-18 20:42 ` pcarlini at suse dot de
2004-08-18 21:24 ` idonotknow232 at comcast dot net
2004-09-06 20:04 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).