[squeak-dev] JNIPort preview for Squeak and Pharo available on SqueakSource

Eliot Miranda eliot.miranda at gmail.com
Wed Jun 9 18:49:35 UTC 2010


Hi Joachim,

On Wed, Jun 9, 2010 at 11:20 AM, Joachim Geidel <
joachim.geidel at onlinehome.de> wrote:

> Am 09.06.10 19:32 schrieb Levente Uzonyi:
> >> The attachment contains a stack trace of the place where a user
> interrupt
> >> has always interrupted the stuck process so far. I suspect that the
> >> finalization process somehow interferes with the registration of new
> objects
> >> in the WeakRegistry. The problem is in a loop which creates wrapper
> methods
> >> for each of the Java classes found so far. It does not always happen at
> the
> >> same iteration, I have seen it happen for the first and for the fourth
> class
> >> in the list (I checked this only twice so far).
> >
> > Thanks. It would be good to know if another process (for example the
> > finalization process) is inside the critical section, or the semaphore is
> > left without being signaled.
>
> As far as I can tell, there can only be two processes which access the
> WeakRegistry. One of them is the process running the JVM startup code, the
> other one would be the finalization process. JNIPort does not fork other
> processes. How could this be analyzed? By instrumenting the finalization
> process? How? In VisualWorks, there are code probes which can be used to
> monitor variables and more - does something similar exist in Squeak?
>
> >> What do you mean by "the jvm just failed to start"? Does it mean that
> the
> >> jvm.dll could not be found, i.e. the JNIPortJNIInterface could not load
> the
> >> library?
> >
> > Exactly. Do I have to tell the path to the dll somewhere?
>
> As far as I know, Alien does not yet accept paths to a library from
> Smalltalk.


I don't understand this. Of course Alien accepts paths to libraries from
Smalltalk.  Look at Alien class>>primLoadLibrary:, which is wrapped by Alien
class>>lookup: symbol inLibrary: libraryName.

I have not used it on Windows, so I don't know what has to be
> done there. The jvm.dll is typically located at
>  C:\Program Files\Java\jre1.6.0_NN\bin\client\jvm.dll
> where NN is the patch level of the JRE.


So you do something like

entrypoint := Alien lookup: theJREentrypoint inLibrary: 'C:\Program
Files\Java\jre1.6.0_NN\bin\client\jvm.dll'

and call through that.  Look at Alien class examples.

You could try adding the "client"
> directory to your PATH. If this doesn't help, try copying jvm.dll into the
> directory where the Squeak VM is installed, but I think this might not
> work.
> I faintly remember reading somewhere that on Windows, the jvm.dll looks for
> other dlls in ".." relative to its own location, and that this seems to be
> hardwired. I don't know for sure, however. Someone who knows more about
> Alien might know what to do (Eliot Miranda, John McIntosh,...).
>
> Joachim
>

HTH
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100609/07bfd7af/attachment.htm


More information about the Squeak-dev mailing list