From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 15C8F7EEF8 for ; Fri, 17 Jul 2015 20:51:26 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ivg@ieee.org) identity=pra; client-ip=209.85.215.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ivg@ieee.org designates 209.85.215.44 as permitted sender) identity=mailfrom; client-ip=209.85.215.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="ivg@ieee.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-la0-f44.google.com) identity=helo; client-ip=209.85.215.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ivg@ieee.org"; x-sender="postmaster@mail-la0-f44.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DpAQApTqlVmyzXVdFagkaBIWkGgx2lYQaSL4IkhXsCgUIHTAEBAQEBARIBAQEBAQYLCwkhLoQkAQEDARIRUAYFCwsLNwICIQESAQUBHAYTIod3AwoIDaxbgSw+MYs/kFUNhS4BAQEBBgEBAQEBHQqGFIUugk2BZwEBUAeCaIFDBZFYgnSHT4JpgWeBQ5AZg0aCFxIjgRURBoIcHIFvIjEBAYELgT4BAQE X-IPAS-Result: A0DpAQApTqlVmyzXVdFagkaBIWkGgx2lYQaSL4IkhXsCgUIHTAEBAQEBARIBAQEBAQYLCwkhLoQkAQEDARIRUAYFCwsLNwICIQESAQUBHAYTIod3AwoIDaxbgSw+MYs/kFUNhS4BAQEBBgEBAQEBHQqGFIUugk2BZwEBUAeCaIFDBZFYgnSHT4JpgWeBQ5AZg0aCFxIjgRURBoIcHIFvIjEBAYELgT4BAQE X-IronPort-AV: E=Sophos;i="5.15,497,1432591200"; d="scan'208";a="170665488" Received: from mail-la0-f44.google.com ([209.85.215.44]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 17 Jul 2015 20:51:25 +0200 Received: by lahh5 with SMTP id h5so65941491lah.2 for ; Fri, 17 Jul 2015 11:51:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3TGg2zvqerHY6s4143SqFRM9XUsa9PmD7Lgt+lqcWsM=; b=Zo8sz0dfiPD6mdCQvyFJWUMjk5TKFZBYhp+j6fZVBMj5V75E6HCfaf2nNhB0NRrM4K KfWxqykuyuEEOzlFguP8/4dMAIoAcAk/5bD1Gsd7dtlylx6H1kC9yzoC4YU2+DbxdTfp fUhdmNPrEu0liFIeTsleMkc2Bpes1lDhIpfa+o8qwf1eGxJH6kTe6wyKSCQhAXPSl1Ij OoSyNTbgfantzI5RkMLj+FxQVKfO+O8s8wJhVA3DZuxjO8Te4SNKKwrDucdn7alpp2VU aPhW4TQVEvTEXlLcbt53lli71eL7lpoSiWpJMzsPrjGDqJxsYzOvlxgkHDSuu8wHTC9C wZAQ== X-Gm-Message-State: ALoCoQkanYthPuLZ4mvY6hHb/ZwS3o8+fbD/pXURBQLamp1aeUB2HjqWbZzuBfY4IJTEM6FDgxpr MIME-Version: 1.0 X-Received: by 10.152.87.131 with SMTP id ay3mr15645973lab.27.1437159084707; Fri, 17 Jul 2015 11:51:24 -0700 (PDT) Received: by 10.114.26.99 with HTTP; Fri, 17 Jul 2015 11:51:24 -0700 (PDT) In-Reply-To: References: Date: Fri, 17 Jul 2015 14:51:24 -0400 Message-ID: From: Ivan Gotovchits To: Shuai Wang Cc: caml-list Content-Type: multipart/alternative; boundary=001a11c23c9ebaf6e7051b16ac50 Subject: Re: [Caml-list] Cannot execute "main" function --001a11c23c9ebaf6e7051b16ac50 Content-Type: text/plain; charset=UTF-8 In OCaml all module level expressions are evaluated in order of their appearance. If you have some function that you designate as a "main" function*, then before this function is entered all modules on which module, containing "main" function, depends. So you need to find, whether you added some code, that evaluates before your main. * there is no such function as main function in OCaml. All modules are evaluated in the order of their occurrence on the compilation string. Usually, the order is defined by a build tool, like `ocamlbuild`, that will put the entry module in the last place, and topologically sort the preceding modules. P.S. I hope that this is not related to BAP? ;) On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang wrote: > Dear list, > > > I am working on some tools written in OCaml (compiled by OCaml version > 4.01.0). > > This morning I changed some code, compiled it and let it processing some > large data (~ 4G), it never stops after over 2 hours. > > I feed the tool with a tiny input which took less than 1 second to process > before, and I figured out that now it takes around 2.5 minutes before > entering into "main" function! > > I tried to clean the whole codebase, and recompile it ( I use ocamlbuild > 4.01.0), but the same wired situation still happens.. > > I did this: > > ltrace ./init.native input > > and I got this output flushing out for a very long time (sorry mail list > blocks my large image.. ): > > http://i.stack.imgur.com/sEkKk.png > > > > Is anyone aware this kind of issue before..? Am I messed up something..? > I have been working on OCaml for a relatively long time and I didn't > encounter this kind of stuff before... > > > Sincerely, > Shuai > --001a11c23c9ebaf6e7051b16ac50 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In OCaml all module level expressions are evaluated in ord= er of their appearance. If you have some function
that you designate as= a "main" function*, then before this function is entered all mod= ules on which module,=C2=A0
containing "main" function,= depends. So you need to find, whether you added some code, that evaluates = before=C2=A0
your main.

* there is no su= ch function as main function in OCaml. All modules are evaluated in the ord= er of their occurrence
on the compilation string. Usually, the or= der is defined by a build tool, like `ocamlbuild`, that will put the entry = module=C2=A0
in the last place, and topologically sort the preced= ing modules.

P.S. I hope that this is not related = to BAP? ;)=C2=A0

On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang &l= t;wangshuai901@= gmail.com> wrote:
Dear list,

I = am working on some tools written in OCaml (compiled by OCaml version 4.01.0= ).=C2=A0

This morning I changed some code, comp= iled it and let it processing some large data (~ 4G), it never stops after = over 2 hours.=C2=A0

I feed the tool with a tiny= input which took less than 1 second to process before, and =C2=A0I figured= out that now it takes around 2.5 minutes before entering into "main&q= uot; function!

<= div style=3D"font-size:12.8000001907349px">I tried to clean the whole codeb= ase, and recompile it ( I use ocamlbuild 4.01.0), but the same wired situat= ion still happens..=C2=A0
=
I did this:

=C2=A0 =C2=A0 ltrace ./init.native input

and I got this output flushing out for a very long time (sorry= mail list blocks my large image.. ):



=

Is anyon= e aware this kind of issue before..? Am I messed up something..?=C2=A0
I have been working on OCaml f= or a relatively long time and I didn't encounter this kind of stuff bef= ore...


Sincerely,
S= huai

--001a11c23c9ebaf6e7051b16ac50--