I confirm this is an InterProlog JNI problem, however it manifests in the latest XSB (such as today's CVS tarball), whereas it does NOT manifest on xsb 337. All this on Mac OS X 10.6.8. 

Anybody using the InterProlog NativeEngine with later XSB versions?

Essentially, on the latest xsb the JNI callback function InterProlog uses (CallObjectMethod) works if running on the main (initial) Java thread, but not on another (the "Prolog handler") thread. Moving all JNI calls and dynlib loading to the Prolog handler thread does not fix it:-(

What changes might there have been from XSB 337 to current on C interface stack or other memory management? Tried to diff the whole source trees but the results are bit overwhelming... any clues welcome.


On Mar 20, 2013, at 23:15 , Sergio Castro wrote:

I am having certain problems executing the unit tests for InterProlog 2.2a4.

If I execute the tests for the sockets interface to XSB (XSBSubprocessEngineTest), the tests get always frozen in "Running: testJavaThreads(com.declarativa.interprolog.XSBSubprocessEngineTest)" (and the cpu of my machine starts to make a horrible noise).

When I try to execute the native engine tests (XSBNativeEngineTest) this is all the output I see in the console.

Welcome sergioc to InterProlog 2.1.4 on Java 1.7.0_17 (Oracle Corporation), Mac OS X 10.8.3
/opt/local/lib/XSB/config/i386-apple-darwin12.2.1/bin
[xsb_configuration loaded]
[sysinitrc loaded]
[interprolog loaded, cpu time used: 0.0040 seconds]
NativeEngineTest version:XSB Prolog 3.3.7
[Compiling /var/folders/c7/ztwxdnk17dq35bb32pc2phjm0000gq/T/IP_4459170407565190423/tests]
[tests compiled, cpu time used: 0.0170 seconds]
[tests loaded]
starting testNativeEngine
Starting thread with goal to be interrupted...
About to interrupt...
Starting loop...
Finished loop...
Finished extra goal.
Partial Forward Continuation...
... interprologSendReceive/2
... javaMessage/7
... _$call/1
... call/1
... catch/3
... call/1
... c_callloop_query_loop/1
... c_callloop/0
... ll_code_call/3
... call/1
... catch/3
Exception in thread "Prolog handler" com.declarativa.interprolog.util.IPException: Problem executing Prolog command, result==2
    at com.xsb.interprolog.NativeEngine.realCommand(NativeEngine.java:143)
    at com.xsb.interprolog.AbstractNativeEngine$1.run(AbstractNativeEngine.java:94)


Thanks for any help,

Sergio

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar_______________________________________________
Xsb-users mailing list
Xsb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xsb-users