Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix.LargeFile.stat has GC error. #8126

Closed
vicuna opened this issue May 1, 2003 · 1 comment
Closed

Unix.LargeFile.stat has GC error. #8126

vicuna opened this issue May 1, 2003 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented May 1, 2003

Original bug ID: 1665
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: David Brown
Version: 3.05 (CVS too)
OS: Linux
Submission from: 66-75-152-1.san.rr.com (66.75.152.1)

The function stat_aux in otherlibs/unix/stat.c has a GC problem when using 64
bit file offsets. The following patch seems to fix the problem.

Index: stat.c

RCS file: /caml/ocaml/otherlibs/unix/stat.c,v
retrieving revision 1.14
diff -u -r1.14 stat.c
--- stat.c 2002/09/27 08:32:28 1.14
+++ stat.c 2003/05/01 04:40:26
@@ -48,11 +48,13 @@
{
value v;
value atime = Val_unit, mtime = Val_unit, ctime = Val_unit;

  • value offset = Val_unit;
  • Begin_roots3(atime,mtime,ctime)
  • Begin_roots4(atime,mtime,ctime,offset)
    atime = copy_double((double) buf->st_atime);
    mtime = copy_double((double) buf->st_mtime);
    ctime = copy_double((double) buf->st_ctime);
  • offset = use_64 ? Val_file_offset (buf->st_size) : Val_int (buf->st_size);
    v = alloc_small(12, 0);
    Field (v, 0) = Val_int (buf->st_dev);
    Field (v, 1) = Val_int (buf->st_ino);
    @@ -63,8 +65,7 @@
    Field (v, 5) = Val_int (buf->st_uid);
    Field (v, 6) = Val_int (buf->st_gid);
    Field (v, 7) = Val_int (buf->st_rdev);
  • Field (v, 8) =
  •  use_64 ? Val_file_offset(buf->st_size) : Val_int (buf->st_size);
    
  • Field (v, 8) = offset;
    Field (v, 9) = atime;
    Field (v, 10) = mtime;
    Field (v, 11) = ctime;
@vicuna
Copy link
Author

vicuna commented May 5, 2003

Comment author: administrator

Fixed by XL 2003-05-05

@vicuna vicuna closed this as completed May 5, 2003
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant