-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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.ftruncate fd 2^32
truncates to 0 on armv7
#8841
Comments
I compiled the test program on armv7 and disassembled it. The disassembly is rather large so I've linked it here: http://oirase.annexia.org/ocaml-8841.txt |
Can you provide the assembly generated by the OCaml compiler, by doing
? Also, do you know if |
(The output of |
It's quite frustrating to get these results because I don't have access to the armv7 hardware myself. I have to submit everything as a job to the Fedora build system! Here's the http://oirase.annexia.org/ocaml-8841-2.txt In answer to the question about size before calling ftruncate, I added a printf statement and the right value (4294967296) is printed before calling ftruncate. |
From the linked disassembly:
The relevant C code (with some macros expanded) is:
The assembly code is doing a 32-bit read from The
What should happen here is that configure should (a) ensure that whatever macros necessary to make On my machine (amd64), To help debugging, could you please run
|
I don't have access to the armv7 hardware so obtaining this is difficult. However here is the |
Of course another question is why OCaml doesn't use |
|
Here are the files requested before: |
Thanks! This seems to be the bug: I agree that we should just use |
…caml#8843) Fixes: ocaml#8841. Cherry-pick of commit 5e4b55d on trunk.
The following test program should obviously truncate fd 1 (stdout) to 2^32:
For example:
However on armv7 (only) it actually truncates the file to 0 bytes:
Testing with OCaml 4.08.0 and armv7. It seems as if this is a regression since 4.07. We are tracking this bug downstream in https://bugzilla.redhat.com/show_bug.cgi?id=1733743 .
The text was updated successfully, but these errors were encountered: