Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad memory cleanup of DLL using Thread module #4173

Closed
vicuna opened this issue Nov 28, 2006 · 11 comments
Closed

Bad memory cleanup of DLL using Thread module #4173

vicuna opened this issue Nov 28, 2006 · 11 comments

Comments

@vicuna
Copy link

vicuna commented Nov 28, 2006

Original bug ID: 4173
Reporter: matt
Status: acknowledged (set by @xavierleroy on 2007-11-10T12:30:56Z)
Resolution: open
Priority: high
Severity: minor
Version: 3.09.2
Category: otherlibs
Monitored by: braibant matt

Bug description

English 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

File attachments

@vicuna
Copy link
Author

vicuna commented Dec 14, 2006

Comment author: matt

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

@vicuna
Copy link
Author

vicuna commented Jul 4, 2012

Comment author: @xavierleroy

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?

@vicuna
Copy link
Author

vicuna commented Jul 6, 2012

Comment author: matt

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.

@vicuna
Copy link
Author

vicuna commented Jul 11, 2012

Comment author: @alainfrisch

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.

@vicuna
Copy link
Author

vicuna commented Aug 2, 2012

Comment author: @xavierleroy

By the same reasoning, I changed the target from 4.00.1 to 4.01

@vicuna
Copy link
Author

vicuna commented Jun 14, 2013

Comment author: @alainfrisch

Ditto.

@vicuna
Copy link
Author

vicuna commented Sep 4, 2013

Comment author: @damiendoligez

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).

@vicuna
Copy link
Author

vicuna commented Nov 20, 2015

Comment author: @xavierleroy

Any update on this problem report? I'ts been open for so long that we should either do something about it or close it as "cannot fix".

@xavierleroy
Copy link
Contributor

13 years after the initial report, and 7 years after the last confirmation, I think it's time to remove the "high-priority" tag (which I just did) and to close this report (which I haven't done yet). Note that the "unloadability" of OCaml code using the Thread library has changed, and hopefully improved, following commits such as c91db73 and e26c27e, not to mention the merge of #71 (the "unloadable runtime proposal").

@vicuna vicuna added the bug label Mar 19, 2019
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 18, 2020
@xavierleroy
Copy link
Contributor

Too hard to reproduce + too many recent changes in relevant parts of the runtime system = closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants