caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list]  Cannot execute "main" function
@ 2015-07-17 18:35 Shuai Wang
  2015-07-17 18:50 ` Kenneth Adam Miller
  2015-07-17 18:51 ` Ivan Gotovchits
  0 siblings, 2 replies; 12+ messages in thread
From: Shuai Wang @ 2015-07-17 18:35 UTC (permalink / raw)
  To: caml-list, Shuai Wang

[-- Attachment #1: Type: text/plain, Size: 912 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2410 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 18:35 [Caml-list] Cannot execute "main" function Shuai Wang
@ 2015-07-17 18:50 ` Kenneth Adam Miller
  2015-07-17 18:53   ` Shuai Wang
  2015-07-17 18:51 ` Ivan Gotovchits
  1 sibling, 1 reply; 12+ messages in thread
From: Kenneth Adam Miller @ 2015-07-17 18:50 UTC (permalink / raw)
  To: Shuai Wang; +Cc: caml users

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

Can you post your build specification?

On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang <wangshuai901@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 2831 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 18:35 [Caml-list] Cannot execute "main" function Shuai Wang
  2015-07-17 18:50 ` Kenneth Adam Miller
@ 2015-07-17 18:51 ` Ivan Gotovchits
  2015-07-17 19:07   ` Shuai Wang
  1 sibling, 1 reply; 12+ messages in thread
From: Ivan Gotovchits @ 2015-07-17 18:51 UTC (permalink / raw)
  To: Shuai Wang; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

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 <wangshuai901@gmail.com> 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
>

[-- Attachment #2: Type: text/html, Size: 3607 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 18:50 ` Kenneth Adam Miller
@ 2015-07-17 18:53   ` Shuai Wang
  2015-07-17 18:57     ` Kenneth Adam Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Shuai Wang @ 2015-07-17 18:53 UTC (permalink / raw)
  To: Kenneth Adam Miller; +Cc: caml users

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]

Here is my compilation script.

ocamlbuild -use-ocamlfind  XXX1.native XXX2.native ... init.native
 -ocamlopt "-inline 20" -ocamlopt -nodynlink

And our tool always execute init.native.




On Fri, Jul 17, 2015 at 2:50 PM, Kenneth Adam Miller <
kennethadammiller@gmail.com> wrote:

> Can you post your build specification?
>
> On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang <wangshuai901@gmail.com>
> 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
>>
>
>

[-- Attachment #2: Type: text/html, Size: 3579 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 18:53   ` Shuai Wang
@ 2015-07-17 18:57     ` Kenneth Adam Miller
  2015-07-17 19:08       ` Shuai Wang
  0 siblings, 1 reply; 12+ messages in thread
From: Kenneth Adam Miller @ 2015-07-17 18:57 UTC (permalink / raw)
  To: Shuai Wang; +Cc: caml users

[-- Attachment #1: Type: text/plain, Size: 1818 bytes --]

Right, I was wondering if I should tell you that. That means:

let _ =
  my main definition...

or

let () =
  my main definition...

each get evaluated very similarly to how a main function would. Is there
code that you can post in order that I/we can help you?

On Fri, Jul 17, 2015 at 2:53 PM, Shuai Wang <wangshuai901@gmail.com> wrote:

> Here is my compilation script.
>
> ocamlbuild -use-ocamlfind  XXX1.native XXX2.native ... init.native
>  -ocamlopt "-inline 20" -ocamlopt -nodynlink
>
> And our tool always execute init.native.
>
>
>
>
> On Fri, Jul 17, 2015 at 2:50 PM, Kenneth Adam Miller <
> kennethadammiller@gmail.com> wrote:
>
>> Can you post your build specification?
>>
>> On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang <wangshuai901@gmail.com>
>> 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
>>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 4361 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 18:51 ` Ivan Gotovchits
@ 2015-07-17 19:07   ` Shuai Wang
  2015-07-17 19:11     ` Ivan Gotovchits
  0 siblings, 1 reply; 12+ messages in thread
From: Shuai Wang @ 2015-07-17 19:07 UTC (permalink / raw)
  To: Ivan Gotovchits; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 2280 bytes --]

Hello Ivan,

Thank you for your reply! aha, it is not related to BAP ;)

I didn't touch the code in init.ml for a long time, and I have tried to
roll back
to previous version which works fine. But it is still trapped in this way..

By looking at the ltrace output, IMHO, is there any chance that some
setting up code of runtime system does not work well? I am probably wrong.

Sincerely,
Shuai






On Fri, Jul 17, 2015 at 2:51 PM, Ivan Gotovchits <ivg@ieee.org> wrote:

> 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 <wangshuai901@gmail.com>
> 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
>>
>
>

[-- Attachment #2: Type: text/html, Size: 4654 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 18:57     ` Kenneth Adam Miller
@ 2015-07-17 19:08       ` Shuai Wang
  0 siblings, 0 replies; 12+ messages in thread
From: Shuai Wang @ 2015-07-17 19:08 UTC (permalink / raw)
  To: Kenneth Adam Miller; +Cc: caml users

[-- Attachment #1: Type: text/plain, Size: 2416 bytes --]

Thank you Kenneth, here is the starting of my init.ml, I simplified it to
make it more understandable,  did I make any stupid problem.. ? Criticise
me if it was true..
I didn't touch this part for a long time..



  let main () =
    if Array.length Sys.argv <> 2 then
      print_string "XXX\n"
    else if check_strip Sys.argv.(1) == false then
      print_string "XXX\n"
    else
      XXX

let () =
  main ()




On Fri, Jul 17, 2015 at 2:57 PM, Kenneth Adam Miller <
kennethadammiller@gmail.com> wrote:

> Right, I was wondering if I should tell you that. That means:
>
> let _ =
>   my main definition...
>
> or
>
> let () =
>   my main definition...
>
> each get evaluated very similarly to how a main function would. Is there
> code that you can post in order that I/we can help you?
>
> On Fri, Jul 17, 2015 at 2:53 PM, Shuai Wang <wangshuai901@gmail.com>
> wrote:
>
>> Here is my compilation script.
>>
>> ocamlbuild -use-ocamlfind  XXX1.native XXX2.native ... init.native
>>  -ocamlopt "-inline 20" -ocamlopt -nodynlink
>>
>> And our tool always execute init.native.
>>
>>
>>
>>
>> On Fri, Jul 17, 2015 at 2:50 PM, Kenneth Adam Miller <
>> kennethadammiller@gmail.com> wrote:
>>
>>> Can you post your build specification?
>>>
>>> On Fri, Jul 17, 2015 at 2:35 PM, Shuai Wang <wangshuai901@gmail.com>
>>> 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
>>>>
>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 5491 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 19:07   ` Shuai Wang
@ 2015-07-17 19:11     ` Ivan Gotovchits
  2015-07-17 19:13       ` Shuai Wang
  0 siblings, 1 reply; 12+ messages in thread
From: Ivan Gotovchits @ 2015-07-17 19:11 UTC (permalink / raw)
  To: Shuai Wang; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 2531 bytes --]

Can you show the output of `ldd` on your main executable, e.g.,  `ldd
init.native`?

On Fri, Jul 17, 2015 at 3:07 PM, Shuai Wang <wangshuai901@gmail.com> wrote:

> Hello Ivan,
>
> Thank you for your reply! aha, it is not related to BAP ;)
>
> I didn't touch the code in init.ml for a long time, and I have tried to
> roll back
> to previous version which works fine. But it is still trapped in this way..
>
> By looking at the ltrace output, IMHO, is there any chance that some
> setting up code of runtime system does not work well? I am probably wrong.
>
> Sincerely,
> Shuai
>
>
>
>
>
>
> On Fri, Jul 17, 2015 at 2:51 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>
>> 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 <wangshuai901@gmail.com>
>> 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
>>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 5158 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 19:11     ` Ivan Gotovchits
@ 2015-07-17 19:13       ` Shuai Wang
  2015-07-17 19:16         ` Kenneth Adam Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Shuai Wang @ 2015-07-17 19:13 UTC (permalink / raw)
  To: Ivan Gotovchits; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 3206 bytes --]

☁  src [master] ⚡ ldd init.native
linux-vdso.so.1 =>  (0x00007fff55dfe000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007fa4fc9c0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa4fc6c4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa4fc4bf000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa4fc101000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa4fcbfe000)

On Fri, Jul 17, 2015 at 3:11 PM, Ivan Gotovchits <ivg@ieee.org> wrote:

> Can you show the output of `ldd` on your main executable, e.g.,  `ldd
> init.native`?
>
> On Fri, Jul 17, 2015 at 3:07 PM, Shuai Wang <wangshuai901@gmail.com>
> wrote:
>
>> Hello Ivan,
>>
>> Thank you for your reply! aha, it is not related to BAP ;)
>>
>> I didn't touch the code in init.ml for a long time, and I have tried to
>> roll back
>> to previous version which works fine. But it is still trapped in this
>> way..
>>
>> By looking at the ltrace output, IMHO, is there any chance that some
>> setting up code of runtime system does not work well? I am probably wrong.
>>
>> Sincerely,
>> Shuai
>>
>>
>>
>>
>>
>>
>> On Fri, Jul 17, 2015 at 2:51 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>>
>>> 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 <wangshuai901@gmail.com>
>>> 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
>>>>
>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 6316 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 19:13       ` Shuai Wang
@ 2015-07-17 19:16         ` Kenneth Adam Miller
  2015-07-17 19:35           ` Shuai Wang
  0 siblings, 1 reply; 12+ messages in thread
From: Kenneth Adam Miller @ 2015-07-17 19:16 UTC (permalink / raw)
  To: Shuai Wang; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 3628 bytes --]

If you are certain that you can do a make clean, git checkout of the
previous revision to where this wasn't occurring, rebuild and confirm that
this still happens, then it certainly seems like this is a environment
issue.

On Fri, Jul 17, 2015 at 3:13 PM, Shuai Wang <wangshuai901@gmail.com> wrote:

> ☁  src [master] ⚡ ldd init.native
> linux-vdso.so.1 =>  (0x00007fff55dfe000)
> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> (0x00007fa4fc9c0000)
> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa4fc6c4000)
> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa4fc4bf000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa4fc101000)
> /lib64/ld-linux-x86-64.so.2 (0x00007fa4fcbfe000)
>
> On Fri, Jul 17, 2015 at 3:11 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>
>> Can you show the output of `ldd` on your main executable, e.g.,  `ldd
>> init.native`?
>>
>> On Fri, Jul 17, 2015 at 3:07 PM, Shuai Wang <wangshuai901@gmail.com>
>> wrote:
>>
>>> Hello Ivan,
>>>
>>> Thank you for your reply! aha, it is not related to BAP ;)
>>>
>>> I didn't touch the code in init.ml for a long time, and I have tried to
>>> roll back
>>> to previous version which works fine. But it is still trapped in this
>>> way..
>>>
>>> By looking at the ltrace output, IMHO, is there any chance that some
>>> setting up code of runtime system does not work well? I am probably
>>> wrong.
>>>
>>> Sincerely,
>>> Shuai
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Jul 17, 2015 at 2:51 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>>>
>>>> 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 <wangshuai901@gmail.com>
>>>> 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
>>>>>
>>>>
>>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 6915 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 19:16         ` Kenneth Adam Miller
@ 2015-07-17 19:35           ` Shuai Wang
  2015-07-17 19:37             ` Kenneth Adam Miller
  0 siblings, 1 reply; 12+ messages in thread
From: Shuai Wang @ 2015-07-17 19:35 UTC (permalink / raw)
  To: Kenneth Adam Miller; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 3995 bytes --]

OK, my bad. I figured out the problem due to my carelessness...
really sorry for troubling you guys. I hope I didn't waste too much of your
time = (

On Fri, Jul 17, 2015 at 3:16 PM, Kenneth Adam Miller <
kennethadammiller@gmail.com> wrote:

> If you are certain that you can do a make clean, git checkout of the
> previous revision to where this wasn't occurring, rebuild and confirm that
> this still happens, then it certainly seems like this is a environment
> issue.
>
> On Fri, Jul 17, 2015 at 3:13 PM, Shuai Wang <wangshuai901@gmail.com>
> wrote:
>
>> ☁  src [master] ⚡ ldd init.native
>> linux-vdso.so.1 =>  (0x00007fff55dfe000)
>> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
>> (0x00007fa4fc9c0000)
>> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa4fc6c4000)
>> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa4fc4bf000)
>> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa4fc101000)
>> /lib64/ld-linux-x86-64.so.2 (0x00007fa4fcbfe000)
>>
>> On Fri, Jul 17, 2015 at 3:11 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>>
>>> Can you show the output of `ldd` on your main executable, e.g.,  `ldd
>>> init.native`?
>>>
>>> On Fri, Jul 17, 2015 at 3:07 PM, Shuai Wang <wangshuai901@gmail.com>
>>> wrote:
>>>
>>>> Hello Ivan,
>>>>
>>>> Thank you for your reply! aha, it is not related to BAP ;)
>>>>
>>>> I didn't touch the code in init.ml for a long time, and I have tried
>>>> to roll back
>>>> to previous version which works fine. But it is still trapped in this
>>>> way..
>>>>
>>>> By looking at the ltrace output, IMHO, is there any chance that some
>>>> setting up code of runtime system does not work well? I am probably
>>>> wrong.
>>>>
>>>> Sincerely,
>>>> Shuai
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Jul 17, 2015 at 2:51 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>>>>
>>>>> 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 <wangshuai901@gmail.com>
>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 7496 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] Cannot execute "main" function
  2015-07-17 19:35           ` Shuai Wang
@ 2015-07-17 19:37             ` Kenneth Adam Miller
  0 siblings, 0 replies; 12+ messages in thread
From: Kenneth Adam Miller @ 2015-07-17 19:37 UTC (permalink / raw)
  To: Shuai Wang; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 4233 bytes --]

Nah, it's no problem at all. :)

On Fri, Jul 17, 2015 at 3:35 PM, Shuai Wang <wangshuai901@gmail.com> wrote:

> OK, my bad. I figured out the problem due to my carelessness...
> really sorry for troubling you guys. I hope I didn't waste too much of
> your time = (
>
> On Fri, Jul 17, 2015 at 3:16 PM, Kenneth Adam Miller <
> kennethadammiller@gmail.com> wrote:
>
>> If you are certain that you can do a make clean, git checkout of the
>> previous revision to where this wasn't occurring, rebuild and confirm that
>> this still happens, then it certainly seems like this is a environment
>> issue.
>>
>> On Fri, Jul 17, 2015 at 3:13 PM, Shuai Wang <wangshuai901@gmail.com>
>> wrote:
>>
>>> ☁  src [master] ⚡ ldd init.native
>>> linux-vdso.so.1 =>  (0x00007fff55dfe000)
>>> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
>>> (0x00007fa4fc9c0000)
>>> libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa4fc6c4000)
>>> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa4fc4bf000)
>>> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa4fc101000)
>>> /lib64/ld-linux-x86-64.so.2 (0x00007fa4fcbfe000)
>>>
>>> On Fri, Jul 17, 2015 at 3:11 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>>>
>>>> Can you show the output of `ldd` on your main executable, e.g.,  `ldd
>>>> init.native`?
>>>>
>>>> On Fri, Jul 17, 2015 at 3:07 PM, Shuai Wang <wangshuai901@gmail.com>
>>>> wrote:
>>>>
>>>>> Hello Ivan,
>>>>>
>>>>> Thank you for your reply! aha, it is not related to BAP ;)
>>>>>
>>>>> I didn't touch the code in init.ml for a long time, and I have tried
>>>>> to roll back
>>>>> to previous version which works fine. But it is still trapped in this
>>>>> way..
>>>>>
>>>>> By looking at the ltrace output, IMHO, is there any chance that some
>>>>> setting up code of runtime system does not work well? I am probably
>>>>> wrong.
>>>>>
>>>>> Sincerely,
>>>>> Shuai
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Jul 17, 2015 at 2:51 PM, Ivan Gotovchits <ivg@ieee.org> wrote:
>>>>>
>>>>>> 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 <wangshuai901@gmail.com>
>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

[-- Attachment #2: Type: text/html, Size: 7929 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-07-17 19:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17 18:35 [Caml-list] Cannot execute "main" function Shuai Wang
2015-07-17 18:50 ` Kenneth Adam Miller
2015-07-17 18:53   ` Shuai Wang
2015-07-17 18:57     ` Kenneth Adam Miller
2015-07-17 19:08       ` Shuai Wang
2015-07-17 18:51 ` Ivan Gotovchits
2015-07-17 19:07   ` Shuai Wang
2015-07-17 19:11     ` Ivan Gotovchits
2015-07-17 19:13       ` Shuai Wang
2015-07-17 19:16         ` Kenneth Adam Miller
2015-07-17 19:35           ` Shuai Wang
2015-07-17 19:37             ` Kenneth Adam Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).