You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3409 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Matthieu Dubuget
Version: ocaml-3.08.2-win-msvc.exe
OS: Windows XP Pro
Submission from: dyn-83-156-145-233.ppp.tiscali.fr (83.156.145.233)
#!/bin/bash
This bug (?) report is also a shell script
Please, run inside a void directory, since it
creates some files.
I used it on Windows XP pro with cygwin shell.
I experienced the very same problem with Windows 98.
I'm not sure wether this is a bug or a bad using of
compilation tools?
The problem is that if i use a function from Printf
module inside a ocaml dll, the final program using this
DLL crashes (on caml_startup call).
Even if the funtion is nether called, which is the case
here.
If I replace the second line of the dac.ml file
with print_int dac, for example, it does not crash.
int main (){
int ok;
ok = ms_dac_init_ok();
printf ("%d\n",ok);
fflush(stdout);
ms_dac_init();
ok = ms_dac_init_ok();
printf ("%d\n",ok);
fflush(stdout);
return 0;
}
EOF
Original bug ID: 3409
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Matthieu Dubuget
Version: ocaml-3.08.2-win-msvc.exe
OS: Windows XP Pro
Submission from: dyn-83-156-145-233.ppp.tiscali.fr (83.156.145.233)
#!/bin/bash
This bug (?) report is also a shell script
Please, run inside a void directory, since it
creates some files.
I used it on Windows XP pro with cygwin shell.
I experienced the very same problem with Windows 98.
I'm not sure wether this is a bug or a bad using of
compilation tools?
The problem is that if i use a function from Printf
module inside a ocaml dll, the final program using this
DLL crashes (on caml_startup call).
Even if the funtion is nether called, which is the case
here.
If I replace the second line of the dac.ml file
with print_int dac, for example, it does not crash.
----------DAC.ML-------------
cat > dac.ml <<EOF
let affiche dac =
Printf.printf "%d\n" dac
EOF
----------MS_DAC.H-------------
cat > ms_dac.h <<EOF
void ms_dac_init ();
int ms_dac_init_ok (void);
EOF
----------MS_DAC2.C-------------
cat > ms_dac2.c <<EOF
#include "ms_dac.h"
#include <caml/callback.h>
static int ms_dac_init_done = 0;
void ms_dac_init (){
char *vide = 0l;
if (!ms_dac_init_done){
caml_startup (&vide);
ms_dac_init_done = 1;
}
}
int ms_dac_init_ok (void){
return ms_dac_init_done;
}
EOF
----------MS_DAC.DEF-------------
cat > ms_dac.def <<EOF
EXPORTS
ms_dac_init
ms_dac_init_ok
EOF
----------T.C-------------
cat > t.c <<EOF
#include <stdio.h>
#include "ms_dac.h"
int main (){
int ok;
ok = ms_dac_init_ok();
printf ("%d\n",ok);
fflush(stdout);
ms_dac_init();
ok = ms_dac_init_ok();
printf ("%d\n",ok);
fflush(stdout);
return 0;
}
EOF
Here are the commands I use to produce
my test program.
ocamlopt -output-obj -o dacl.obj dac.ml
ocamlopt -c ms_dac2.c
link -nologo -dll -out:ms_dac.dll -def:ms_dac.def dacl.obj ms_dac2.obj
-libpath:"c:\ocaml\lib" libasmrun.lib
cl -o t.exe -nologo -Ox -MT ms_dac.lib t.c
rm dac* ms* t.c t.obj
Just run the t.exe program to reproduce the bug.
Thanks for the wonderfull ocaml.
I hope this report is not noise, and won't let you loose your time
Salutations
The text was updated successfully, but these errors were encountered: