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=AWL,HTML_MESSAGE, UNPARSEABLE_RELAY autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 88188BBAF for ; Sat, 12 Jul 2008 08:07:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8DAB7nd0iBXvI7gWdsb2JhbACCPTWPOgEBECAFRZVO X-IronPort-AV: E=Sophos;i="4.30,348,1212357600"; d="scan'208,217";a="27257658" Received: from tone.orchestra.cse.unsw.edu.au ([129.94.242.59]) by mail4-smtp-sop.national.inria.fr with ESMTP; 12 Jul 2008 08:07:51 +0200 Received: From [IPv6???1] ([129.94.242.49] == weill.orchestra.cse.unsw.EDU.AU) (ident-user sseefried) (cse-authentic-sender sseefried) By tone With Smtp ; Sat, 12 Jul 2008 16:07:48 +1000 From: Sean Seefried To: Xavier Leroy Date: Sat, 12 Jul 2008 16:07:48 +1000 Message-Id: <97BDCFD7-C714-440D-A04E-2C141E4AD3E0@nicta.com.au> Content-Type: multipart/alternative; boundary=Apple-Mail-112--835016650 Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: [Caml-list] Heaps size problems with "caml_alloc_small" in foreign function interfaces Cc: caml-list@yquem.inria.fr X-Mailer: Apple Mail (2.926) X-Spam: no; 0.00; alloc:01 bug:01 ocaml:01 ocaml:01 camlidl:01 alloc:01 mlsize:01 camlidl:01 elegantly:01 bug:01 mlsize:01 elegantly:01 1.05:98 howe:98 1.05:98 --Apple-Mail-112--835016650 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi Xavier, Okay, here's some further clarification and this time I'm attaching a file. I've had to GZip it because it's so big. The bug in question occurs on line 4078. I should clarify. This file becomes part of a library that is linked into another OCaml program. On one input file that this OCaml program takes as input it fails on line 4078. On other files it fails on other lines. However, the code it fails at always seems to be of the form: _v2 = camlidl_alloc_small(18, 0); { mlsize_t _c8; for (_c8 = 0; _c8 < 18; _c8++) Field(_v2, _c8) = _v3[_c8]; } What's strange about this is that this is automatically generated code from CamlIDL (with a few extra debugging messages I threw in). Xavier, I'm using CamlDL to write a binding to a C front-end which has an absolutely huge C data structure. I've had to write several extensions to CamlIDL to make this a reality, but for the moment I'm keeping these in my own source control mainly because your coding style is very clean and many of my extensions could have been done a lot more elegantly. However, the code that is being generated above was already generated by version 1.05 of CamlIDL. The file can be found at: http://howe.textdrive.com/~sseefried/files/test.c.gz Sean --Apple-Mail-112--835016650 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
Hi = Xavier,

Okay, here's some further clarification = and this time I'm attaching a file. I've had to GZip it because it's so = big.

The bug in question occurs on line = 4078.

I should clarify. This file becomes part = of a library that is linked into another OCaml program. =  On one input file that this OCaml program takes = as input it fails on line 4078.  On other files it fails on other = lines. However, the code it fails at always seems to be of the = form:

    _v2 =3D = camlidl_alloc_small(18, 0);
    { = mlsize_t _c8;
      for (_c8 =3D 0; _c8 < 18; = _c8++) Field(_v2, _c8) =3D _v3[_c8];
   =  }

What's strange about this = is that this is automatically generated code from CamlIDL (with a few = extra debugging messages I threw in). Xavier, I'm using CamlDL to write = a binding to a  C front-end which has an = absolutely huge C data structure.  I've had to = write several extensions to CamlIDL to make this a reality, but for the = moment I'm keeping these in my own source control mainly because your = coding style is very clean and many of my extensions could have been = done a lot more elegantly.  

However, the = code that is being generated above was already generated by version 1.05 = of CamlIDL. 


The file can = be found at: http://howe.textdrive.com/~sseefried/files/= test.c.gz

Sean
= --Apple-Mail-112--835016650--