https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89255

--- Comment #8 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to r...@cebitec.uni-bielefeld.de from comment #5)
> > --- Comment #4 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
> > (In reply to r...@cebitec.uni-bielefeld.de from comment #3)
> >> 
> >> FAIL: ../src/std/range/package.d -fversion=Shared -shared-libphobos (test
> >> for excess errors)
> >> FAIL: ../src/std/socket.d -fversion=Shared -shared-libphobos (test for
> >> excess errors)
> >> FAIL: ../src/std/stdio.d -fversion=Shared -shared-libphobos (test for 
> >> excess
> >> errors)
> >> FAIL: ../src/std/stdio.d -fversion=Shared -shared-libphobos execution test
> >> 
> >> std.exception.ErrnoException@/vol/gcc/src/hg/trunk/local/libphobos/testsuite/
> >> ../src/std/stdio.d(1028): Could not seek in file
> >> `/tmp/deleteme.dmd.unittest.pid16148-детка.stdio.d.1037' (Invalid argument)
> >> 
> >
> > There's no backtrace, so don't know which unittest it came from, what are 
> > the
> > reasons why fseeko may return invalid argument on Solaris?  Specifically
> > anything that differs from other implementations.
> 
> Off the top of my head, could be related to largefile handling (or lack
> thereof).

I've just spotted that the line number is conveniently part of the file name
(line 1037)

Looking at that unittest, it is indeed testing largefile handing.

---
version (CRuntime_DigitalMars)
    auto bigOffset = int.max - 100;
else version (CRuntime_Bionic)
    auto bigOffset = int.max - 100;
else
    auto bigOffset = cast(ulong) int.max + 100;
f.seek(bigOffset);
assert(f.tell == bigOffset, text(f.tell));
---

And subsequently finding this documentation:
https://docs.oracle.com/cd/E37069_01/html/E54439/fseeko64-3f.html

fseeko64 and ftello64 operate identically to fseek and ftell respectively,
except that the first two routines will operate on "large files" as well --
files with size in bytes greater than the range of INTEGER*4 data (2 Gb). Large
file support was introduced with the Solaris 2.6 operating environment.


In the druntime bindings there's only glibc that has large file support.

---
else version (Posix)
{
    int   fseeko(FILE*, off_t, int);
    off_t ftello(FILE*);
}
---

So its either fix the phobos test to use an offset less than 2GB on Solaris, or
add necessary fseeko64 definitions to druntime to use the large file functions
instead.  Probably the latter.

Reply via email to