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 autolearn=disabled version=3.1.3 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 1D324BBCA for ; Wed, 7 May 2008 19:01:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqsBAKJ9IUjAXQImiGdsb2JhbACSAgEBAQ8gmlk X-IronPort-AV: E=Sophos;i="4.27,449,1204498800"; d="scan'208";a="25937875" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 07 May 2008 19:01:57 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m47H1uZA020115 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 7 May 2008 19:01:57 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqsBAN99IUhQRFuwiGdsb2JhbACSAgEBAQ8gmlg X-IronPort-AV: E=Sophos;i="4.27,449,1204498800"; d="scan'208";a="12358594" Received: from furbychan.cocan.org ([80.68.91.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 07 May 2008 19:01:51 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Jtn1a-0005YL-9j for caml-list@inria.fr; Wed, 07 May 2008 18:01:50 +0100 Date: Wed, 7 May 2008 18:01:50 +0100 To: caml-list@inria.fr Subject: ocamlc.opt tries to allocate 34 GB of RAM ... and fails Message-ID: <20080507170149.GA21077@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at discorde with ID 4821E084.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocamlc:01 bug:01 ocamlc:01 bug:01 camlp:01 syntax:01 expr:01 expr:01 lident:01 camlp:01 -pp:01 seq:01 -pp:01 ocaml:01 10.:98 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>; 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