Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Mathias Kende <mathias@kende.fr>
To: OCaml List <caml-list@inria.fr>
Subject: [Caml-list] int overflow and Marshal failure
Date: Fri, 31 Aug 2007 18:30:19 +0200	[thread overview]
Message-ID: <1188577819.7084.21.camel@MATHIAS-ENS> (raw)
In-Reply-To: <6cd4x4ae5k.fsf@hod.lan.m-e-leypold.de>

Le jeudi 30 août 2007 à 23:47 +0200, Markus E L a écrit :
> A check in the Unix library would be nice, in the long run I think
> using 32bit native integers is absolutely required. 

I had the same sort of problem with the Unix.stat function and the
st_size member being an int while it is a 64 bits int on recent systems
(including some 32 bits one). The maximum size that can be stored on 32
bits system, 1Go, is much too small for this function.

This lean me to an other, different but related, problem : marshaling a
value which contain an int on a 64 bits computer and then unmarshaling
it  on a 32 bits computer will raise an exception (Failure "input_value:
integer too large") if an int where bigger than max_int. while the
manual states than : "The format for the byte sequences is compatible
across all machines for a given version of Objective Caml."

Even if raising an exception is a "good" behaviour, it is still
impossible to read back the data and I think that there should be a way
to read back the data even in this case.

Mathias



  parent reply	other threads:[~2007-08-31 16:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 21:47 Unix.getuid() int overflow Markus E L
2007-08-30 22:57 ` [Caml-list] " Markus E L
2007-08-31 16:30 ` Mathias Kende [this message]
2007-08-31 16:47   ` [Caml-list] int overflow and Marshal failure Eric Cooper
2007-08-31 16:49   ` Vincent Hanquez
2007-08-31 17:03   ` Brian Hurt
2007-08-31 18:25   ` Matthieu Dubuget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1188577819.7084.21.camel@MATHIAS-ENS \
    --to=mathias@kende.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox