Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: caml-list@inria.fr
Subject: ocamlc.opt tries to allocate 34 GB of RAM ... and fails
Date: Wed, 7 May 2008 18:01:50 +0100	[thread overview]
Message-ID: <20080507170149.GA21077@annexia.org> (raw)


We had a bug reported ages ago where ocamlc.opt would try to allocate
a ridiculous amount of RAM (34289692672 bytes, or about 34 GB) and
fail.  Another very similar bug report[1] has just come along, with a
nice small reproducer:

------------------------------------------------------------ log.ml
open Camlp4.PreCast;
open Syntax;


value insert_mname_mline _loc f = <:expr<Log.$lid:f$ $str:Loc.file_name  _loc$
$`int:Loc.start_line _loc$>>;

EXTEND Gram
  GLOBAL: expr;

    expr:
      [
        [ "Log"; "."; f = [ `LIDENT ("e"|"d"|"w" as f) -> f] ->
insert_mname_mline _loc f ]
      ];
  END;
----------------------------------------------------------------------

Running:

  ocamlc.opt -c -I +camlp4 -pp camlp4rf log.ml

_sometimes_ fails with an out of memory error, eg:

  for i in `seq 1 100`; do ocamlc.opt -c -I +camlp4 -pp camlp4rf log.ml; done

For me it fails about 1 time in 10.

There's some evidence this may be a Fedora-specific problem, maybe
some problem in the kernel or glibc or how we build OCaml, however I
have no real idea so I'm wondering if anyone can try reproducing it.

Rich.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=445545

-- 
Richard Jones
Red Hat


             reply	other threads:[~2008-05-07 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 17:01 Richard Jones [this message]
2008-05-07 17:35 ` [Caml-list] " Romain Beauxis
2008-05-07 18:34   ` Richard Jones
2008-05-07 18:46     ` Markus Mottl
2008-05-07 18:49       ` Richard Jones
2008-05-07 19:24         ` Markus Mottl
2008-05-07 19:29           ` Brian Hurt
2008-05-08  9:14           ` Richard Jones
2008-05-08 10:14             ` Richard Jones
2008-05-08 13:40               ` Markus Mottl
2008-05-08 13:55                 ` Richard Jones

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=20080507170149.GA21077@annexia.org \
    --to=rich@annexia.org \
    --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