logo       

[ xsb-Bugs-1831053 ] XSB-Interprolog crashing in JNI interface: msg#00489

Subject: [ xsb-Bugs-1831053 ] XSB-Interprolog crashing in JNI interface
Bugs item #1831053, was opened at 2007-11-13 04:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101176&aid=1831053&group_id=1176

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: C interface
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: XSB-Interprolog crashing in JNI interface

Initial Comment:
We've been using Interprolog, with the JNI interface, and we have it
working fine.  (However, it may be that we have made some changes to
it to make it work.  Those changes should have been propagated back to 
the most recent release of Interprolog from Declarativa, but there may
still be some problems.)
</begin>  Here is my bug report for JNI crash in Interprolog--Java interface.   
On my computer, it crashes for parameter 462 and not 461. Either case, I am 
sure it will crash for 600. (Or choose a number
large enough for which it will crash).   There is a bug in the Java Prolog 
interface of Interprolog.



C:\visual>javac -classpath grappa1_2.jar; interprolog.jar; -
Xlint:unchecked   debugCrash.java

C:\visual>java -classpath grappa1_2.jar;interprolog.jar;  d
ebugCrash "c:\\tools\\xsb\\3.1\\XSB\\config\\x86-pc-windows\\bin" 
[xsb_configuration loaded]
[sysinitrc loaded]
[interprolog loaded]
[Compiling .\debug]
++Warning[XSB]: [Compiler] .\debug: Singleton variable Head in a clause of 
len/2 

[debug compiled, cpu time used: 0.6100 seconds]
[debug loaded]
debug loaded okay
ended prolog thing..
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d886564, pid=5904, tid=1428 
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode)
# Problematic frame:
# V  [jvm.dll+0xc6564]
#
# An error report file with more information is saved as hs_err_pid5904.log
#
# If you would like to submit a bug report, please visit: 
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

C:\work\windows\scanner\visual> 




Code:


debugCrash.java

import java.io.*;

import com.declarativa.interprolog.*;
import com.xsb.interprolog .*;


public class debugCrash  {

       public static void main(String[] args) {



               if(args.length != 1) {
                       System.out.println("usage java debugCrash <XsbBinPath> 
"); 
                       System.exit(1);
               }

               String xsbDir = args[0];

               PrologEngine prologEngine = new NativeEngine(xsbDir);


               if( prologEngine.deterministicGoal ("consult('" + "debug" + 
"')") )
                       System.out.println("debug loaded okay");
               else
                       System.out.println("debug not loaded"); 

               TermModel list = (TermModel) prologEngine.
                       deterministicGoal("crash(Users, 462), 
buildTermModel(Users,Out)",
"[Out]")[0];


               prologEngine.shutdown ();

               System.out.println("End of code");

       }

}




debug.p:


len([], 0).
len([Head|Tail], L) :-
       len(Tail, TL), L is TL + 1.


gen(0, []).
gen(L, [Head|Tail]) :-
       TL is L -1,
       gen(TL, Tail),
       Head = hostAndUser(localhost2,'S-1-1-0')
       %Head = hostAndUser(l, sssss)
.


/*

Head = hostAndUser(localhost2,'S-1-1-0') 

crashes for 462, not 461

*/

crash(P, Size) :-
       gen(Size, P), writeln('ended prolog thing..').


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101176&aid=1831053&group_id=1176

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/


<Prev in Thread] Current Thread [Next in Thread>