From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 5A46CBC69 for ; Fri, 31 Aug 2007 18:32:14 +0200 (CEST) Received: from smtp25.orange.fr (smtp25.orange.fr [193.252.22.23]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7VGWDhQ015887 for ; Fri, 31 Aug 2007 18:32:14 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2509.orange.fr (SMTP Server) with ESMTP id D57861C0008E for ; Fri, 31 Aug 2007 18:32:13 +0200 (CEST) Received: from [10.93.80.11] (ASt-Lambert-152-1-41-90.w82-124.abo.wanadoo.fr [82.124.167.90]) by mwinf2509.orange.fr (SMTP Server) with ESMTP id 948FD1C00086 for ; Fri, 31 Aug 2007 18:32:13 +0200 (CEST) X-ME-UUID: 20070831163213608.948FD1C00086@mwinf2509.orange.fr Subject: [Caml-list] int overflow and Marshal failure From: Mathias Kende To: OCaml List In-Reply-To: <6cd4x4ae5k.fsf@hod.lan.m-e-leypold.de> References: <6cd4x4ae5k.fsf@hod.lan.m-e-leypold.de> Content-Type: text/plain; charset=UTF-8 Date: Fri, 31 Aug 2007 18:30:19 +0200 Message-Id: <1188577819.7084.21.camel@MATHIAS-ENS> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 8bit X-Miltered: at discorde with ID 46D8428D.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 markus:01 integers:01 marshaling:01 unmarshaling:01 byte:01 mathias:98 mathias:98 unix:01 unix:01 integer:01 exception:01 exception:01 caml-list:01 marshal:01 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