From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D95FCBC0B for ; Thu, 16 Nov 2006 13:02:57 +0100 (CET) Received: from smtp-msa-out08.orange.fr (smtp8.orange.fr [193.252.22.23]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAGC2vuH021693 for ; Thu, 16 Nov 2006 13:02:57 +0100 Received: from drakar.stremy.local (ADijon-258-1-9-208.w86-213.abo.wanadoo.fr [86.213.208.208]) by mwinf0812.orange.fr (SMTP Server) with ESMTP id DDD301C001ED for ; Thu, 16 Nov 2006 13:02:56 +0100 (CET) X-ME-UUID: 20061116120256908.DDD301C001ED@mwinf0812.orange.fr Received: from [192.168.0.25] (helo=[192.168.0.25]) by drakar.stremy.local with esmtp (Exim 3.36 #1 (Debian)) id 1Gkg2B-0000LN-00 for ; Thu, 16 Nov 2006 13:07:59 +0100 Message-ID: <455C5370.5070603@laposte.net> Date: Thu, 16 Nov 2006 13:02:56 +0100 From: Matthieu Dubuget Reply-To: matthieu.dubuget@laposte.net User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: caml_startup/caml_cleanup X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-j-chkmail-Score: MSGID : 455C5371.000 on concorde : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 455C5371.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 ocaml:01 dlls:01 dllmain:01 ocaml:01 mingw:01 gcc:01 mingw:01 3.08.3:01 emacs:01 instrument:98 .....:98 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=3D385). 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 =20 * 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 =E0 "0x....." emploie l'adresse m=E9moire "0x...". La m=E9moire ne peut =EAtre "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 =20