Giter VIP home page Giter VIP logo

Comments (6)

Lms24 avatar Lms24 commented on August 19, 2024 1

Hello Khaled,

thank you for your reply. I finally managed to execute the SLicer4J by using the python script. Also, runBenchmarks.py works now (except for the 3 projects that are actually not in the repo but I assume rather some sort of symlink to the project).

It seems like my mistake was to rename the top level directories DymanicSlicingCore and Slicer4J. Pulling the newest changes, restoring the folder structure as described in your post and rebuilding everything fixed the issues.

Thank you for your hints. I'll be sure to cite you correctly if I'm able to integrate this tool into my project.

from slicer4j.

Lms24 avatar Lms24 commented on August 19, 2024

A further try of executing the benchmarks with python3 run_benchmarks.py yielded the following output:

====================
Benchmark: javaslicer-bench1-intra-procedural
********************
Original exec time (s): 0.08215594291687012
********************
Running Slicer4J
Instrumentation time (s): 0.5224616527557373
Error: Main class Bench could not be found or loaded
Caused by: java.lang.ClassNotFoundException: Bench
Execution time (s): 0.06292152404785156
Traceback (most recent call last):
  File "/home/lukas/workspace/master-jsr/slicer/slicer4j/benchmarks/run_benchmarks.py", line 178, in <module>
    run_slicer4j(project, jar_name, project_arg, "", "", "")
  File "/home/lukas/workspace/master-jsr/slicer/slicer4j/benchmarks/run_benchmarks.py", line 132, in run_slicer4j
    line = sc.split(", ")[0]
AttributeError: 'NoneType' object has no attribute 'split'

from slicer4j.

asoifer avatar asoifer commented on August 19, 2024

Hi, I think that you are trying to run the slicer on Windows.
The script was made for running on Linux, so you have to change ":" by ";" in Java commands.
On the other hand you have to replace the cat and grep invocations for reading log information.

Fortunately, I did this. So I'm attaching another script, for windows,
Regards.

slicer4j.zip

from slicer4j.

Lms24 avatar Lms24 commented on August 19, 2024

Hi, thanks for the advice. I only tried running the slicer on Linux (ArchLinux), though.

from slicer4j.

asoifer avatar asoifer commented on August 19, 2024

Right, I thought you were on Windows because I had the same error before.

from slicer4j.

khaled-e-a avatar khaled-e-a commented on August 19, 2024

Hi Lukas, thank you for considering using Slicer4J in your work!

java -cp "../../Slicer4J/target/slicer4j-jar-with-dependencies.jar:Slicer4J/target/lib/*" ca.ubc.ece.resess.slicer.dynamic.slicer4j.Slicer -h

For this command, the JVM cannot find the soot.Type class because the class path is not written properly. It should be like this if you are running from SliceMe folder:

java -cp "../../Slicer4J/target/slicer4j-jar-with-dependencies.jar:../../Slicer4J/target/lib/*" ca.ubc.ece.resess.slicer.dynamic.slicer4j.Slicer -h

or this if you run from the main Slicer4J directory

java -cp "Slicer4J/target/slicer4j-jar-with-dependencies.jar:Slicer4J/target/lib/*" ca.ubc.ece.resess.slicer.dynamic.slicer4j.Slicer -h

As for the script not working, I suspect the instrumentation didn't work for some reason, it could be related to the location of installation of DynamicSlicingCore, as the script refers to that location to fetch the classes to be injected in the instrumented JAR. The DynamicSlicingCore should be installed in the parent directory of Slicer4J:

| - DynamicSlicingCore 
|      |----- core
|      |----- DynamicSlicingLoggingClasses
| - Slicer4J
|     |-----Slicer4J
|     |-----scripts
. . .

Please let me know if that's your directory structure and the script is still not working.

from slicer4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.