Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004735OCamlOCaml generalpublic2009-02-28 20:392009-04-19 11:08
Reportergildor 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.10.2 
Target VersionFixed in Version3.11.1+dev 
Summary0004735: Unix.LargeFile.fstat cannot report size over 32bits on Win32
DescriptionIn file otherlibs/win32unix/stat.c

CAMLprim value unix_fstat_64(value handle)
{
  int ret;
  struct _stati64 buf;

  ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
  if (ret == -1) uerror("fstat", Nothing);
  if (buf.st_size > Max_long) {
    win32_maperr(ERROR_ARITHMETIC_OVERFLOW);
    uerror("fstat", Nothing);
  }
  return stat_aux(1, &buf);
}

The test with Max_long is a copy an paste from unix_fstat. It should be rewritten as is:

CAMLprim value unix_fstat_64(value handle)
{
  int ret;
  struct _stati64 buf;

  ret = _fstati64(win_CRT_fd_of_filedescr(handle), &buf);
  if (ret == -1) uerror("fstat", Nothing);
  return stat_aux(1, &buf);
}

This allow to report size over 31 bits long.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0004877)
xleroy (administrator)
2009-03-28 17:40

Fixed as suggested in 3.11 branch, will go in 3.11.1.

- Issue History
Date Modified Username Field Change
2009-02-28 20:39 gildor New Issue
2009-03-28 17:40 xleroy Note Added: 0004877
2009-03-28 17:40 xleroy Status new => closed
2009-03-28 17:40 xleroy Resolution open => fixed
2009-04-19 11:08 xleroy Fixed in Version => 3.11.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker