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.6 required=5.0 tests=DNS_FROM_RFC_POST, MISSING_HEADERS 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 6EE95BC0A for ; Fri, 17 Nov 2006 09:20:29 +0100 (CET) Received: from smtp-msa-out01.orange.fr (smtp1.orange.fr [193.252.22.30]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAH8KTHq016971 for ; Fri, 17 Nov 2006 09:20:29 +0100 Received: from drakar.stremy.local (ADijon-258-1-87-162.w90-13.abo.wanadoo.fr [90.13.190.162]) by mwinf0109.orange.fr (SMTP Server) with ESMTP id 96E601C00202 for ; Fri, 17 Nov 2006 09:20:28 +0100 (CET) X-ME-UUID: 20061117082028618.96E601C00202@mwinf0109.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 1Gkz2T-0001Hn-00 for ; Fri, 17 Nov 2006 09:25:33 +0100 Message-ID: <455D70C9.4070007@laposte.net> Date: Fri, 17 Nov 2006 09:20:25 +0100 From: Matthieu Dubuget Reply-To: matthieu.dubuget@laposte.net User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] caml_startup/caml_cleanup : problem with threads References: <455C5370.5070603@laposte.net> In-Reply-To: <455C5370.5070603@laposte.net> 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 : 455D70CD.000 on concorde : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 455D70CD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 threads:01 compilation:01 bug:01 mlvalues:01 argv:01 argv:01 bug:01 def:01 compilations:01 mingw:01 gcc:01 Matthieu Dubuget a =E9crit : > - 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.=20 > > =20 OK. I have the problem as soon as my DLL uses Thread module. What does caml_startup in this case? Here is a minimal set of files allowing to produce a problematic DLL. Do you think there is any problem with this code and the compilation command lines? demo.ml --------------- |Callback.register "wait a moment" Thread.delay --------------- bug_demo_st.c --------------- |#include |#include | |static int demo_init_done =3D 0; | |void demo_init (){ | char * argv[] =3D { "argv", NULL}; | | if (!demo_init_done) { | caml_startup (argv); | demo_init_done =3D 1; | } |} | |int demo_init_ok (void){ return demo_init_done; } --------------- bug_demo.def: --------------- |EXPORTS |demo_init |demo_init_ok --------------- And the compilations instructions I used (MinGW version) --------------- |gcc -mno-cygwin -O -mms-bitfields -c -I"C:\Program Files\Objective Caml\lib" "bug_demo_st.c" =20 | or simply: ocamlopt -c bug_demo_st.c |ocamlopt.opt -thread -output-obj -o demog.o unix.cmxa threads.cmxa demo.= ml |gcc -mno-cygwin -Wl,--kill-at -shared -o bug_demo.dll -L"C:\Program Files\Objective Caml\lib" \ | demog.o bug_demo_st.o bug_demo.def -lunix -lasmrun -lwsock32 -lthreadsnat -lthreads --------------- > - 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=20 randomly > when calling another program (It was > omake). > =20 I was not able to produce any simple test program demonstrating the DLL unloading problem (yet). Do you think I should fill a bug report or am I wrong somewhere? Salutations Matt