Hello all, I've been struggling with a problem with OCaml's C interface and can't seem to deduce the problem. Here's what's going on in a nutshell:
- I used OCaml's C interface to develop a series of OCaml wrappers for C functions. - The functions operate correctly for the most part....however when I call the functions repeatedly (anywhere between a dozen to a few hundred invocations), the function does not return and locks up. - I have been able to track down the problem to points where I call caml memory allocation calls (e.g. caml_copy_double) in the C code. Turns out that on random occasions this function does not return and ends up utilizing 100% of the CPU! My gut feeling is that I'm exceeding the memory size the OCaml runtime allocates for its internal C stack/heap and the call fails. Rather than return something like a NULL, my guess is that the allocator is waiting for space to free up. However as there is no error message or indication of what is failing, I'm not sure what to do. Any ideas for what this could be and how I can find more info? Is there any way I can print out info about the VM state? Other info: -I'm using OCaml 3.11.2 on Ubuntu 10.04 64 bit. -I'm using bytecode compiler (ocamlc), generating debug code (-g) and all my code is unoptimized (-O0). Thanks, I appreciate any help any of you can give me. -mas -- You received this message because you are subscribed to the Google Groups "ocaml-developer" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ocaml-developer?hl=en For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html
