Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spf run example/TestArray.java encounter exception #4

Open
idiomaticrefactoring opened this issue May 6, 2018 · 3 comments
Open

spf run example/TestArray.java encounter exception #4

idiomaticrefactoring opened this issue May 6, 2018 · 3 comments

Comments

@idiomaticrefactoring
Copy link

idiomaticrefactoring commented May 6, 2018

Hi:
1: When I run spf examples/TestArray.java it occured exception,details is:

Exception in thread "main" java.lang.UnsatisfiedLinkError: gov.nasa.jpf.symbc.Debug.printPC(Ljava/lang/String;)V
at gov.nasa.jpf.symbc.Debug.printPC(Native Method)

2: But when I Verify TestArray.jpf,it can run.But it can't handle arrList.get(x)_ == 9 and can't generate x<10 [testcase.] How can I know how it handle the library call and How can I look the constraints to help me understand the error

RESULTS is:
Contents of arr:
0 1 2 3 4 5 6 7 8 9 --------->property violated
pc 1 constraint # = 1
x >= 10
=================== Method Sequences
[(expected = java.lang.IndexOutOfBoundsException.class), testarray.testArrayList(10);, ##EXCEPTION## "java.lang.IndexOutOfBoundsException: Index: 0, Size: 10..."]

So am I doing any things wrong? Thank you.
image
image
TestArray.jpf:
target=TestArray classpath=${jpf-symbc}/build/examples sourcepath=${jpf-symbc}/src/examples symbolic.method =TestArray.testArrayList(sym) symbolic.min_int=-100 symbolic.max_int=100 #symbolic.dp=z3 #vm.storage.class=nil #listener = .symbc.SymbolicListener #listener = .listener.ChoiceTracker listener = gov.nasa.jpf.symbc.sequences.SymbolicSequenceListener

@R1kM
Copy link
Contributor

R1kM commented May 7, 2018

Hi,

Regarding your first issue, how are you executing TestArray.java? It seems that you are missing the actual definition of the native method getSolvedPC, can you make sure that Java has access to the JNI methods in peers/gov/nasa/jpf/symbc ?

About the second issue, the range of integers is constrained in the configuration file (TestArray.jpf): you have
symbolic.min_int=-100 symbolic.max_int=100

This tells the solvers to only consider integers in this range. Depending on your needs, you can either increase the range by setting max_int to 1000, and completely remove these constraints.
In any case, you may want to use the option search.multiple_errors=true to instruct SPF not to stop at the first error.

@idiomaticrefactoring
Copy link
Author

Hi,
Thank you for your reply. @R1kM

  1. I run TestArray.java by Java Application ,so it occured errors.
  2. Just as you said,PathCondition x<10 can't generate, because I didn't set the option search.multiple_errors=true.when I did it it occured!

@Xintao-C
Copy link

Xintao-C commented Jun 8, 2020

when I run the example TestArray.jpf, I got a error "java.lang.UnsatisfiedLinkError: no libz3java in java.library.path". My computer running environment is Windows 7,JDK 1.8, Is there something wrong with me?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants