From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p04Ev1xf001425 for ; Tue, 4 Jan 2011 15:57:05 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsBAArEIk3RVaE2kGdsb2JhbACWG44VCBUBAQEBCQkMBxEEIKJ2iXeCGIUMLoZOAQEDBYVFBIsHgx1p X-IronPort-AV: E=Sophos;i="4.60,272,1291590000"; d="scan'208";a="93757796" Received: from mail-fx0-f54.google.com ([209.85.161.54]) by mail1-smtp-roc.national.inria.fr with ESMTP; 04 Jan 2011 15:57:04 +0100 Received: by fxm16 with SMTP id 16so14245335fxm.27 for ; Tue, 04 Jan 2011 06:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=t7w8DRldNb/3XAS94KV8VIu+RItFDhs5qpGXx8XY5dE=; b=dpWqoDGtoDphO75mnpim42wurjoTWCp5Zpsrv0JJEbA27EKQpL6aFa6QJXXZtknsPZ bl25KdqYxto949bBRo5brtGQoHiK1JeGjRE2TYM13vNQ3GtSU/kjtScFs2l+jpELUaEi oYrMZVNTZ7fVBZmgXDn6r/dz37CsxxgPmIYvY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=CBtb40xdfbFS/JQZPfUb/+YhnItqwYPuV8Oo1tHzwy9HMrwAMHQAk23+yYZ0av43mt /UzdpNEARQc4rvec1hYIymzEjeRKmEDCqNF92DpHupkW7HW3NqSp1Bhvzrgrfh42Lz4v 9Uz+tQ3/GrvVxWAfHJvSXbjS0s/BIXi+ra6fk= Received: by 10.223.73.206 with SMTP id r14mr4901228faj.126.1294153024624; Tue, 04 Jan 2011 06:57:04 -0800 (PST) Received: from [192.168.1.101] ([79.114.99.210]) by mx.google.com with ESMTPS id n3sm5111043fax.31.2011.01.04.06.57.02 (version=SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 06:57:02 -0800 (PST) Message-ID: <4D23353C.8020803@gmail.com> Date: Tue, 04 Jan 2011 16:57:00 +0200 From: =?ISO-8859-1?Q?T=F6r=F6k_Edwin?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101213 Icedove/3.1.7 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Array.make exception and parser On 2011-01-04 15:41, Jean Krivine wrote: > Hi all, > > I am encountering a weird problem, I am trying to parse a very large file > (around 1.2 GB) according to a grammar defined in ocamlyacc. On a 32-bit or 64-bit architecture? > During the parsing I get the exception > > Invalid_argument "Array.make". > > This is strange because I am not using any array. You can try calling 'Printexc.record_backtrace true' on startup, and compile with -g. If you compile to bytecode the stacktrace will usually be better, but that is not always accurate either. Another way is to run your bytecode in ocamldebug, and use 'backstep' from the point where exception is raised. > My guess it that a big chunk of the file I am parsing is matching a non > terminal, something like > > rule: > non_term END {blah}; > > where non_term is going to be 1GB of characters. Does anyone know what > could be raising the exception ? Trying to allocate a too big array: #ifdef ARCH_SIXTYFOUR #define Max_wosize (((intnat)1 << 54) - 1) #else #define Max_wosize ((1 << 22) - 1) #endif if (wsize > Max_wosize) caml_invalid_argument("Array.make"); > > Thanks! > J >