Kiarahmani / CLOTHO

Directed Test Generation for Weakly Consistent Database Systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors at first run

rnbguy opened this issue · comments

First of all, great work!

I am trying to run your tool on ArchLinux based machine. I noticed few hiccups.

  1. To persist the exports from . scripts/env.sh, ./clotho.sh --setup 2 is needed to run with dot-operator, i.e. . ./clotho.sh --setup 2.
  2. The file paths for rt.jar and jce.jar are assumed. I had to put correct paths for my machine.
  3. I am stuck at ./clotho.sh --analyze write_skew. It throws error for not being able to link z3 library.
...
     [java] Exception in thread "main" java.lang.UnsatisfiedLinkError: no libz3java in java.library.path
     [java] 	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
     [java] 	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
     [java] 	at java.lang.System.loadLibrary(System.java:1122)
     [java] 	at com.microsoft.z3.Native.<clinit>(Native.java:14)
     [java] 	at com.microsoft.z3.Context.<init>(Context.java:62)
     [java] 	at Z3.Z3Driver.<init>(Z3Driver.java:64)
     [java] 	at Transformer.main(Transformer.java:138)
...

I see, com.microsoft.z3.jar is present at analyzer/lib and it is properly mentioned in build.xml or in .classpath. But my Java is not strong. Can you tell me, what should I do to here?

Hello @rnbguy

I was able to solve this by changing the java.library.path that is hardcoded at the end of analyzer/build.xml

<!-- TODO: is hard coded for the system under test-->
<sysproperty key="java.library.path" path="path/to/your/z3/build"/>

However, I still cannot run CLOTHO and it seems to be some problem with z3

[java] ASSERTION VIOLATION
[java] File: ../src/api/api_ast.cpp
[java] Line: 906
[java] UNEXPECTED CODE WAS REACHED.
[java] Z3 4.8.11.0
[java] Please file an issue with this message and more detail about how you encountered it at https://github.com/Z3Prover/z3/issues/new

After a quick search, I found this issue that suggests it might have to do with having different versions of the libraries, so I tried installing z3 from scratch again but that didn't do it.

I'm stuck here

@lenacgs I had some free minutes to look at this problem again. I was able to fix the problem. Java library path should contain the directory path containing libz3java.so. Compiling Z3-4.8.6 from Github worked for me. 4.8.10 doesn't work. You may use any recent version that works.

Recap.

  1. Check if the paths inside scripts/env.sh are correct and modify if necessary. Use locate command to locate the jars in your system.
  2. Compile/Download/Install libz3java.so and note/find its location.
  3. Modify analyzer/build.xml to set
<sysproperty key="java.library.path" path="path/to/directory/containing/libz3java.so"/>
  1. Execute
. ./clotho.sh --setup 2
make benchmark=write_skew
./clotho.sh --analyze write_skew
./clotho.sh --show write_skew 1

It should work by now :)