Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004173OCamlOCaml otherlibspublic2006-11-28 12:452014-07-22 23:42
Reportermatt 
Assigned To 
PriorityhighSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version3.09.2 
Target Version4.02.1+devFixed in Version 
Summary0004173: Bad memory cleanup of DLL using Thread module
DescriptionEnglish readers: this post describe the problem:
 http://caml.inria.fr/pub/ml-archives/caml-list/2006/11/7fbe6817eb19bb892ca50f18ad611533.en.html [^]

Si une DLL créée avec OCaml
- fait appel au module Thread
- et que l'initialisation a été effectuée (caml_startup)
un message d'erreur Windows apparait APRÈS le déchargement de la DLL.

Ce message apparait systématiquement lors de l'arrêt d'un de nos logiciels.

Je ne suis pas parvenu à reproduire ce message avec un programme de test C : c'est pourquoi je joins un programme LabVIEW qui déclenche le message d'erreur de façon reproductible. Mais j'ai pu observer le phénomène dans un eshell (emacs) après avoir exécuté un petit programme de test ecrit en C se contentant de faire appel à caml_startup, lors de l'exécution d'une commande.

Je joins un fichier zip :
Archive: demo.zip
  Length Date Time Name
 -------- ---- ---- ----
        0 11-28-06 12:37 demo/
       34 11-16-06 16:57 demo/bug_demo.def
      277 11-17-06 08:34 demo/bug_demo_st.c
    52968 11-28-06 12:09 demo/demo.exe <- programme de test LabVIEW
       48 11-17-06 08:25 demo/demo.ml
      455 11-17-06 09:44 demo/demo_compil.sh <- génération de la DLL (MinGW)
 -------- -------
    53782 6 files

L'exécution du programme de test LabVIEW nécessite l'installation préalable du runtime LabVIEW de National Instrument, disponible ici :
ftp://ftp.ni.com/support/labview/windows/runtime/7.1/7.1.0/French/LVRunTimeEng.exe [^]
TagsNo tags attached.
Attached Fileszip file icon demo.zip [^] (19,336 bytes) 2006-11-28 12:45
c file icon test2.c [^] (1,121 bytes) 2006-12-14 18:34 [Show Content]

- Relationships

-  Notes
(0003879)
matt (reporter)
2006-12-14 18:39

The new uploaded C file is a little C program that trigs the problem: no need to use LabVIEW.
It was tested under cygwin (makes use or dlopen).
It does core dump only if demo_bug.dll makes use of Thread.

test2.c:
1/ Loads the DLL, then unloads
2/ Loads the DLL, init (calls caml_startup), then unloads
3/ Loads the Dll -> CORE DUMP when init is called
(0007635)
xleroy (administrator)
2012-07-04 19:56

I wonder whether this issue is still there after the changes in otherlibs/systhreads performed in Spring 2010 (commit 10220 in particular). Can anyone confirm or infirm?
(0007649)
matt (reporter)
2012-07-06 20:38

I reproduced the problem this evening, after I:
- installed ocaml using Jonathan Protzenko's 4.00.0-beta2 installer on an fresh XP virtual machine
- compiled http://code.google.com/p/dlfcn-win32/ [^] in order to have dlfcn with the mingw cross compiler, in order for my test2.c test program to work.

But I really don't know if this bug is really important. At least not for me.

Salutations.
(0007708)
frisch (developer)
2012-07-11 13:52

This bug is not new, and nobody seems to be strongly impacted by it. I suggest to remove it from the 4.00 target version.
(0007861)
xleroy (administrator)
2012-08-02 08:48

By the same reasoning, I changed the target from 4.00.1 to 4.01
(0009495)
frisch (developer)
2013-06-14 14:17

Ditto.
(0010309)
doligez (administrator)
2013-09-04 17:27

I think I've run into this bug when making the testsuite work on the Windows ports. I didn't have a Windows error message, but an error exit code after the program finished normally (hence tests were failing for no visible reason).

- Issue History
Date Modified Username Field Change
2006-11-28 12:45 matt New Issue
2006-11-28 12:45 matt File Added: demo.zip
2006-12-14 18:34 matt File Added: test2.c
2006-12-14 18:39 matt Note Added: 0003879
2007-11-10 13:30 xleroy Status new => acknowledged
2012-07-04 17:16 doligez Target Version => 4.00.0+dev
2012-07-04 19:56 xleroy Note Added: 0007635
2012-07-06 20:38 matt Note Added: 0007649
2012-07-11 13:52 frisch Note Added: 0007708
2012-07-12 13:56 doligez Target Version 4.00.0+dev => 4.01.0+dev
2012-07-27 12:50 frisch Category OCaml general => OCaml otherlibs
2012-07-31 13:37 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-08-02 08:48 xleroy Note Added: 0007861
2012-08-02 08:48 xleroy Target Version 4.00.1+dev => 4.01.0+dev
2013-06-14 14:17 frisch Note Added: 0009495
2013-06-14 14:17 frisch Severity major => minor
2013-06-14 14:17 frisch Target Version 4.01.0+dev => later
2013-09-04 17:27 doligez Note Added: 0010309
2013-09-04 17:27 doligez Priority normal => high
2013-09-04 17:27 doligez Target Version later => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-22 23:42 doligez Target Version 4.02.0+dev => 4.02.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker