Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Matthieu Dubuget <matthieu.dubuget@laposte.net>
To: caml-list@yquem.inria.fr
Subject: caml_startup/caml_cleanup
Date: Thu, 16 Nov 2006 13:02:56 +0100	[thread overview]
Message-ID: <455C5370.5070603@laposte.net> (raw)

Hello,

I have a problem related to memory allocated by caml_startup. (May
push toward a caml_cleanup function as proposed there for another
reason http://caml.inria.fr/mantis/view.php?id=385).

If you have any advice to help me solve this, please, send it to me!

Using OCaml I have written two DLLs (Windows). Let's call them A.dll
and B.dll.

I use them from LabVIEW (National Instrument). But that's not the key
point: see later.

LabVIEW automatically loads the libraries when I open a LabVIEW
program using them, and unload the libraries when the program is
closed. I can check that by adding a DllMain C function in my DLL,
with appropriate MessageBox.

With A.dll, I experience no problem at all, and it works fine.

B.dll also works fine. But under some conditions, AFTER B.dll has been
unloaded, LabVIEW crashes.

- Only if caml_startup was called (and also if this was the only
  function called from the library)

- I experience this with B.dll only. Not A.dll. I'm going to narrow
  the problem by removing functionnalities from B.dll step by
  step. But I would like to avoid this, because it will be long.

- If B.dll is produced with :
  * MSVC and OCAML MSVC 3.08.3, I just experience a crash
 
  * with  MSVC and OCAML MSVC 3.09.3,
    or    mingw gcc and ocaml mingw (3.09.3 or 3.08.3)

    I get a windows error:

    FRENCH: L'instruction à "0x....." emploie l'adresse mémoire
    "0x...". La mémoire ne peut être "read".

    APROXIMATIVE TRANSLATION: The instruction at "0x..." use memory
    address "0x...". The memory can not be read.

- Why did I said that LabVIEW is not the problem?

    - Because we reproduced the problem loading and unloadind B.dll in
      Java.

    - Because I experienced the problem another way: I did a little C
      program that load/unload B.DLL and exits. This program was run
      from an *eshell* emacs session. And after that. I experienced
      the window error box when calling another program (It was
      omake).

Thanks in advance for any help.

Salutations.

Matt
 



             reply	other threads:[~2006-11-16 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 12:02 Matthieu Dubuget [this message]
2006-11-17  8:20 ` [Caml-list] caml_startup/caml_cleanup : problem with threads Matthieu Dubuget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455C5370.5070603@laposte.net \
    --to=matthieu.dubuget@laposte.net \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox