From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTP id 764375D5 for ; Tue, 28 May 2019 16:49:35 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,523,1549926000"; d="scan'208";a="385101445" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 28 May 2019 18:49:34 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 84DD0824A7; Tue, 28 May 2019 18:49:34 +0200 (CEST) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1968D7ED69 for ; Tue, 28 May 2019 18:49:22 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rixed@happyleptic.org; spf=Pass smtp.mailfrom=rixed@happyleptic.org; spf=Pass smtp.helo=postmaster@out1-smtp.messagingengine.com IronPort-PHdr: =?us-ascii?q?9a23=3AhXlciBxoLJ+e6oTXCy+O+j09IxM/srCxBDY+r6Qd?= =?us-ascii?q?1O4RIJqq85mqBkHD//Il1AaPAdyCrase1qGP6/uocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZr?= =?us-ascii?q?KeTpAI7SiNm82/yv95HJbAhEmSexbalvIBmorQjdudQajZdsJ60s1hbHv3xEdv?= =?us-ascii?q?hMy2h1P1yThRH85smx/J5n7Stdvu8q+tBDX6vnYak2VKRUAzs6PW874s3rrgTD?= =?us-ascii?q?QhCU5nQASGUWkwFHDBbD4RrnQ5r+qCr6tu562CmHIc37SK0/VDq+46t3ThLjlS?= =?us-ascii?q?EKPCM7/m7KkMx9lKVVrxyuqBJ8wYHUbo+bOvpgcK3AYdwXXnZBUtpLWiBdGI6x?= =?us-ascii?q?dYkCAuwcNuhYtYn9oF4OoAOkBQmtC+Lg1CJHi2T23aIgy+QhCQHH3Ag+ENIWrH?= =?us-ascii?q?TUrcn6OL0VUeCvw6nFyyjIYf1R2Tf48ofIcxYhrOmDXbJxbcrRyVQvGBjfglqM?= =?us-ascii?q?rozlOjWY3fkOvWiD9+dtVOOih3Q6pw1svzSj3MghhpPXio8VzF3P6D93z5wvJd?= =?us-ascii?q?KiTU52ed6kH4VUtyGdL4Z2Rd4iQ311tCoj0b0GvIK7fDAQxJQi2RHfcOeHfJKH?= =?us-ascii?q?4hLiUuaRLil3hHRqeLK+gRa971KsxfH7VsmxyFpKryxFncfQtn0V1hHe69KLRu?= =?us-ascii?q?Zg8ku8wzqC2Brf5v9ELEwskKrUMZ8hwro+lpoJtkTDGzf7mF/3jK6ZaEor5/Ol?= =?us-ascii?q?6+T9bbX+vp+dN4t0hR/mMqQym8ywHf40Mg8UX2iU4ei8zqHs/VXlQLVWif07ir?= =?us-ascii?q?XWv4rfJcQfv6K5Bw5V0p0/6xukFDen0NEYnWEdI15feRKHiZLpO1DUL/ziA/e/?= =?us-ascii?q?mVKhmyp1yvDCI73hGYnNIWbZkLn8fLZ86lBTxRIvwYMX25UBAbgEJLf3W1TtnN?= =?us-ascii?q?3eFB4wdQKukMj9D9AozIIOVG6nAqaBKLLWvEeU5+lpJPODN9xdgyr0N/Vwv62m?= =?us-ascii?q?tnQ+g1JIJfD1j6tSU2ixG7FdG2vceWDl24hTEW4Sphs6QfT2iVbEViRcNS7rAv?= =?us-ascii?q?AMowojAYfjNr/tA4CghLvahXW8A4EPI3tDFkjKFHrzbIyLWvEDZSSdI8ls1DcD?= =?us-ascii?q?UOr4Et5z5VSVrAb/joFfAK/R8ywcu4jk0YEqte3ajQkj8TFsE8WWlWaXQDMtkw?= =?us-ascii?q?=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BeAgAwZu1chxkEb0JlHgEGBwaBZYJ6U?= =?us-ascii?q?jIoh12FMYoWgg2aVAkBAwEMIwwBAYRAAoJjHAYBBDQTAQMBAQQBAQIBAQMBEwE?= =?us-ascii?q?BAQgNCQgpIwyCOiKCbwECA0ABATgPCxguLCuDOwGCCg+oY4IggnkBAQWBMgGBC?= =?us-ascii?q?YNDgScDBoE0hn2CEYJFF4F/gREngj0uPoJhAoIuhRWoVwmIQ4xbIYIfimaJRJJ?= =?us-ascii?q?FgSuPHoFmgXh9Qy4aVoFOgg8ag1aFFIVBPQECMI8QAQE?= X-IPAS-Result: =?us-ascii?q?A0BeAgAwZu1chxkEb0JlHgEGBwaBZYJ6UjIoh12FMYoWgg2?= =?us-ascii?q?aVAkBAwEMIwwBAYRAAoJjHAYBBDQTAQMBAQQBAQIBAQMBEwEBAQgNCQgpIwyCO?= =?us-ascii?q?iKCbwECA0ABATgPCxguLCuDOwGCCg+oY4IggnkBAQWBMgGBCYNDgScDBoE0hn2?= =?us-ascii?q?CEYJFF4F/gREngj0uPoJhAoIuhRWoVwmIQ4xbIYIfimaJRJJFgSuPHoFmgXh9Q?= =?us-ascii?q?y4aVoFOgg8ag1aFFIVBPQECMI8QAQE?= X-IronPort-AV: E=Sophos;i="5.60,523,1549926000"; d="scan'208";a="307483218" X-MGA-submission: =?us-ascii?q?MDE5aTChDIMq7RZxve6D0QpgkBYQ5ERgQb/Ekm?= =?us-ascii?q?Ms6Pu4yn/I/yBfc68UD1PZz/pH/UnWp7IIsqRjcOd4RNzKChezkyKHwd?= =?us-ascii?q?20XCAClgFUF5rkrvtbjJXjUOceal8zfpnQ4nC9OlIFMWedgPr+SGpUl9?= =?us-ascii?q?ElePbUZVab0XCHmJXHCq9zFw=3D=3D?= Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 18:49:09 +0200 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E9056221DD for ; Tue, 28 May 2019 12:49:07 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Tue, 28 May 2019 12:49:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=happyleptic.org; h=mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=2hHvDyL/iU77DKDvv83R11hpB34ZAe4 lZ8rb3VqNFRg=; b=mB02Jnl5QMvAnYdcu6xKcjwawRdqNbOLTlZxMaIKYEg/vnP atHiNzrjovIyIf093UbLrURM86r7NVorFv9deKIVeFZqyrHQbSrGfQSuFEi/ujEC PXgAzuDLBOcWpDEWsTE2Oay+y8hEgM2/22yN55skO9yaFd9NoJJ/RVQdo3g6+GTw O3mpHsJ++Pairyd9ZUY0fPHnHfQeKzay8Dzns/Fcb86AyFGpa1wE6TVSTE1BvIPT xDP54uhSNKdGDL4msjwN158StsibKjhlSPIlx4NYpqdfqveX6JyO3Eaa2hOL7OYz 30K6bFVGEE6zWTSWGU2D7xgjGAEalZkZFrRdhpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=2hHvDy L/iU77DKDvv83R11hpB34ZAe4lZ8rb3VqNFRg=; b=jFnhmptc0AhZJE0oh4E8NL OGXNj1wtgzsapYjhPudAe1uRPdef4tIBfeQZcAQOK2BZ4QZiYw3ctgwfI+gV5yVb 04XJ+hp3y16yZCuWOA5/ZA1SaHo/zduN+xP3DSztYElifx/0ftvlMLYzgnfXA913 JTSYE58tDJP6yZP1wtQwjqc+jWpWO4eQd/pNY+OCCacZMmYSWb1EUCp4LZXuuEwp M1QzQLFeuMBz+xzJj3hvorugKvNJjaX4OQNLFYAN/lB1ft+FoMLKmcmOsqDSKB43 gvqAwpmi98AEDHh1/5bNEQk194k59xlkpN/iDb2qZJd7B7n09pQNAVPw9B3/cEPg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddvhedguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesth dtredtreerjeenucfhrhhomheprhhigigvugeshhgrphhphihlvghpthhitgdrohhrghen ucffohhmrghinhepghhithhhuhgsrdgtohhmnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrihigvggusehhrghpphihlhgvphhtihgtrdhorhhgnecuvehluhhsthgvrhfuihiivgep td X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0ECCDE00A1; Tue, 28 May 2019 12:49:07 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-555-g49357e1-fmstable-20190528v2 Mime-Version: 1.0 Message-Id: <8610b652-83c8-464d-b57c-c6c9b9baec41@www.fastmail.com> In-Reply-To: <8d058e9d-5293-46f1-9941-7c33fd232e04@www.fastmail.com> References: <8d058e9d-5293-46f1-9941-7c33fd232e04@www.fastmail.com> Date: Tue, 28 May 2019 18:49:06 +0200 From: rixed@happyleptic.org To: caml-list@inria.fr Content-Type: text/plain Subject: Re: [Caml-list] Only bytecode version of executable allocating huge amounts Reply-To: rixed@happyleptic.org X-Loop: caml-list@inria.fr X-Sequence: 17581 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Can it be another instance of https://github.com/ocaml/opam/issues/3636 ? On Tue, May 28, 2019, at 14:27, Jon French wrote: > Hi all, > > I'm wondering if anyone on this list might have encountered this issue > before, since it's got me pretty stumped. > > We have an OCaml project ( https://github.com/rems-project/sail ) which > tries to allocate huge amounts of memory, but only when compiled to > bytecode. The native version works perfectly fine. > > strace for an example run ends in: > > > openat(AT_FDCWD, "/home/ojno/work/sail2/lib/vector_dec.sail", O_RDONLY|O_CLOEXEC) = 3 > > lseek(3, 0, SEEK_CUR) = 0 > > read(3, "$ifndef _VECTOR_DEC\n$define _VEC"..., 65536) = 7031 > > mmap(NULL, 1965819695104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) > > brk(0x5729f32c4000) = 0x55603f2f4000 > > mmap(NULL, 1965819826176, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory) > > write(2, "Fatal error: out of memory.\n", 28Fatal error: out of memory. > > ) = 28 > > exit_group(2) = ? > > +++ exited with 2 +++ > > which naturally fails since I don't have 2 TB of memory available. > > The exact amount of the allocation varies from input to input and even > run to run, but is always that approximate size. There's no > characteristic pattern of heap or stack running out of control if I > turn on memory debugging info in $OCAMLRUNPARAM, just that one huge > allocation. When run in ocamldebug, it also doesn't appear to be > failing at a location which is sensible to be allocating such amounts > of memory -- and the location also varies with the input. And on tiny > inputs it doesn't seem to try and make the allocation at all. > > Are we actually seeing a compiler/runtime bug here? Is there something > I'm missing? > > Thanks, > > Jon French > Computer Laboratory > University of Cambridge