Open Unix.LargeFile to avoid "lstat: Value too large for defined data type".
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 1 Feb 2021 10:07:02 +0000 (10:07 +0000)
committerHilko Bengen <bengen@debian.org>
Thu, 2 Sep 2021 19:53:27 +0000 (20:53 +0100)
commit7a12d95a28c9199a2ce9e49ff9f8a2d972e55b93
tree15dea83af83a88ae078e19ecce67f364a5fdbd4c
parent5fd21fad87642a66a629ba67beb2bdc4c3ce9e61
Open Unix.LargeFile to avoid "lstat: Value too large for defined data type".

On 32 bit platforms, because OCaml native ints are limited to 31 bits,
there is a trap in the normal Unix.stat, Unix.lstat functions where
any field in the stat struct may overflow.  The result is random
errors like:

  supermin: error: lstat: Value too large for defined data type: /tmp/tmp.Ss9aYEBASm/d2/root

You would probably only see this on armv7.

The OCaml Unix module has a "LargeFile" submodule which fixes this by
using int64 for some (unfortunately not all) fields.

For more information see the OCaml sources, file
otherlibs/unix/stat.c, all instances of "EOVERFLOW".

Gbp-Pq: Name 0001-Open-Unix.LargeFile-to-avoid-lstat-Value-too-large-f.patch
src/format_chroot.ml
src/format_ext2.ml
src/format_ext2_initrd.ml
src/format_ext2_kernel.ml
src/mode_build.ml
src/package_handler.ml
src/ph_dpkg.ml
src/ph_pacman.ml
src/ph_rpm.ml
src/supermin.ml
src/utils.ml