caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Java JVM is becoming more strict
@ 2011-03-25  8:21 Matthieu Dubuget
  2011-03-25 10:02 ` Florent Ouchet
  0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Dubuget @ 2011-03-25  8:21 UTC (permalink / raw)
  To: Caml Mailing List

Hello,

this post is just a short story for the archives of the mailing-list… 
This is about a three days (successful) fight against a bug.

Since more than three year, my colleague is using one DLL of mine. This 
DLL was produced with ocaml, from some caml modules and one hand written 
C file. My colleague is not perfect: he is calling this DLL from one 
Java application.

Last week, for some technical constraints, he had to upgrade the Java 
virtual machine toward a >= 1.6 version.
Since this upgrade, he experienced one exception violation on the first 
call to the DLL (ie when calling caml_startup).

It appeared that some other OCaml DLL were still working fine. We made a 
test, replacing the Caml modules with a minimal .ml file, returning 
static values: this worked without violation exception. After that, we 
printed the dependencies (ocamldep -modules) of the modules.

The problem was that some (unused) debugging code was still there in one 
of them: this module had a dependency toward Printf module. Once this 
dependency was removed, we got read of the exception violation. I wonder 
if this is a bug in OCaml, in the JVM, or a mis-use of the JVM?

Salutations

Matthieu



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Java JVM is becoming more strict
  2011-03-25  8:21 [Caml-list] Java JVM is becoming more strict Matthieu Dubuget
@ 2011-03-25 10:02 ` Florent Ouchet
  2011-03-25 10:20   ` Matthieu Dubuget
  0 siblings, 1 reply; 6+ messages in thread
From: Florent Ouchet @ 2011-03-25 10:02 UTC (permalink / raw)
  To: matthieu.dubuget; +Cc: Caml Mailing List

Hello Matthieu,

Is your application a console application or a GUI application? In the 
second case, I've already seen cases where STDIN/STDOUT/STDERR pipes are 
completly invalid while it does work in other cases.

Cheers,

- Florent

Matthieu Dubuget a écrit :
> Hello,
>
> this post is just a short story for the archives of the mailing-list… 
> This is about a three days (successful) fight against a bug.
>
> Since more than three year, my colleague is using one DLL of mine. 
> This DLL was produced with ocaml, from some caml modules and one hand 
> written C file. My colleague is not perfect: he is calling this DLL 
> from one Java application.
>
> Last week, for some technical constraints, he had to upgrade the Java 
> virtual machine toward a >= 1.6 version.
> Since this upgrade, he experienced one exception violation on the 
> first call to the DLL (ie when calling caml_startup).
>
> It appeared that some other OCaml DLL were still working fine. We made 
> a test, replacing the Caml modules with a minimal .ml file, returning 
> static values: this worked without violation exception. After that, we 
> printed the dependencies (ocamldep -modules) of the modules.
>
> The problem was that some (unused) debugging code was still there in 
> one of them: this module had a dependency toward Printf module. Once 
> this dependency was removed, we got read of the exception violation. I 
> wonder if this is a bug in OCaml, in the JVM, or a mis-use of the JVM?
>
> Salutations
>
> Matthieu
>
>
>


-- 
Florent Ouchet
PhD Student
CIS/VDS Team - TIMA Laboratory


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Java JVM is becoming more strict
  2011-03-25 10:02 ` Florent Ouchet
@ 2011-03-25 10:20   ` Matthieu Dubuget
  2011-03-25 12:57     ` Florent Ouchet
  0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Dubuget @ 2011-03-25 10:20 UTC (permalink / raw)
  To: florent.ouchet; +Cc: Caml Mailing List

-------- Original Message --------
Subject: Re: [Caml-list] Java JVM is becoming more strict
From: Florent Ouchet <florent.ouchet@imag.fr>
To: matthieu.dubuget@gmail.com
Date: 25/03/2011 11:02
> Hello Matthieu,
>
> Is your application a console application or a GUI application? In the 
> second case, I've already seen cases where STDIN/STDOUT/STDERR pipes 
> are completly invalid while it does work in other cases.


That's it. This is a GUI ultrasonic data acquisition system. The DLL is 
used to process som datas.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Java JVM is becoming more strict
  2011-03-25 10:20   ` Matthieu Dubuget
@ 2011-03-25 12:57     ` Florent Ouchet
  2011-03-25 16:14       ` Matthieu Dubuget
  0 siblings, 1 reply; 6+ messages in thread
From: Florent Ouchet @ 2011-03-25 12:57 UTC (permalink / raw)
  To: matthieu.dubuget; +Cc: Caml Mailing List


Then you should never use standard pipes within a Windows GUI 
application unless you're 100% sure that a console will always be 
available (either attached or allocated).

Some systems have issues when standard pipes are incorrectly used, 
others do not. I'm not sure which setting triggers this behavior. 
However, JAVA is not to blame here.

- Florent

Matthieu Dubuget a écrit :
> -------- Original Message --------
> Subject: Re: [Caml-list] Java JVM is becoming more strict
> From: Florent Ouchet <florent.ouchet@imag.fr>
> To: matthieu.dubuget@gmail.com
> Date: 25/03/2011 11:02
>> Hello Matthieu,
>>
>> Is your application a console application or a GUI application? In 
>> the second case, I've already seen cases where STDIN/STDOUT/STDERR 
>> pipes are completly invalid while it does work in other cases.
>
>
> That's it. This is a GUI ultrasonic data acquisition system. The DLL 
> is used to process som datas.
-- 
Florent Ouchet
PhD Student
CIS/VDS Team - TIMA Laboratory


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Java JVM is becoming more strict
  2011-03-25 12:57     ` Florent Ouchet
@ 2011-03-25 16:14       ` Matthieu Dubuget
  2011-03-26 13:13         ` Dmitry Bely
  0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Dubuget @ 2011-03-25 16:14 UTC (permalink / raw)
  To: florent.ouchet; +Cc: Caml Mailing List

Le 25/03/2011 13:57, Florent Ouchet a écrit :
>
> Then you should never use standard pipes within a Windows GUI 
> application unless you're 100% sure that a console will always be 
> available (either attached or allocated).
Well, strictly speaking, I do not use it, ;-). There was just an unused 
function  in my code that had a dependence on Printf…

And what triggered my problem was the new version of the JVM.

My original post was only to warn others and for archives, if it can 
have somebody save time some day, because it was rather difficult to 
diagnose in the real world, compared to my abstract.

Salutations

Matthieu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Java JVM is becoming more strict
  2011-03-25 16:14       ` Matthieu Dubuget
@ 2011-03-26 13:13         ` Dmitry Bely
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Bely @ 2011-03-26 13:13 UTC (permalink / raw)
  To: Caml Mailing List

On Fri, Mar 25, 2011 at 7:14 PM, Matthieu Dubuget
<matthieu.dubuget@gmail.com> wrote:
> Le 25/03/2011 13:57, Florent Ouchet a écrit :
>>
>> Then you should never use standard pipes within a Windows GUI application
>> unless you're 100% sure that a console will always be available (either
>> attached or allocated).
>
> Well, strictly speaking, I do not use it, ;-). There was just an unused
> function  in my code that had a dependence on Printf…

Where do your call caml_startup()? If it is inside DllMain() and there
is some nontrivial initialization code that can use other DLLs, you
are in trouble.

> And what triggered my problem was the new version of the JVM.
>
> My original post was only to warn others and for archives, if it can have
> somebody save time some day, because it was rather difficult to diagnose in
> the real world, compared to my abstract.

Sure, but I don't think you should blame Java for that.

- Dmitry Bely


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-26 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25  8:21 [Caml-list] Java JVM is becoming more strict Matthieu Dubuget
2011-03-25 10:02 ` Florent Ouchet
2011-03-25 10:20   ` Matthieu Dubuget
2011-03-25 12:57     ` Florent Ouchet
2011-03-25 16:14       ` Matthieu Dubuget
2011-03-26 13:13         ` Dmitry Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).