[squeak-dev] filesize reporting 0 for very large files

David T. Lewis lewis at mail.msen.com
Mon Mar 19 01:40:03 UTC 2012


On Sun, Mar 18, 2012 at 07:28:11PM +0100, Hans-Martin Mosner wrote:
> Am 18.03.2012 17:32, schrieb Bert Freudenberg:
> > On 18.03.2012, at 17:10, Chris Muller wrote:
> >
> >> Does a 32-bit VM mean that no individual primitives can have an
> >> argument or return value greater than 32 bits?
> > No. It just means that any OOP is 32 bits wide. The file size primitive returns a LargeInteger instance, but its OOP will be a 32 bit pointer.
> >
> >>  File-size is something
> >> that, in 2012 with HD video recording devices, can very easily exceed
> >> 32-bits so it would seem to be overkill for ALL objects to have to be
> >> larger than 32 bits (as in a 64-bit VM) just for this one primitive..
> >
> > As Andreas wrote, it works fine on Windows in a 32 bit VM. The problem must be in your platform's support code.
> >
> > - Bert -
> >
> >
> >
> The problem is in the linux support code.
> I've reported it in Mantis quite some time ago: http://bugs.squeak.org/view.php?id=7522 but I don't have an easy
> solution because it seemed to affect several places (including platform-independent code IIRC) so I hoped that soem VM
> maintainer would have a look at it.

Hans-Martin,

Thanks for reporting this on Mantis, it is very helpful for maintaining
information on problems like this. As you note in the bug report, the issue
relates to the stat() function. I do not know if there is an alternative
way to address the problem without using stat(), but I know that stat()
uses the defined data type off_t to refer to file positions, and this is
a 32-bit data type for a VM compiled in 32-bit mode (i.e. most VMs in
general circulation). FWIW, this does work fine if the VM is compiled
in 64-bit mode for 64-bit Linux systems.

Dave



More information about the Squeak-dev mailing list