Comments (3)
This is a soot issue, fixed by updating to the latest soot build. I can now create the instrumented JAR. Please pull and re-build both DynamicSlicingCore and this repo.
from slicer4j.
Thank you for the fix but unfortunately I get another problem when instrumenting the Jar. This is the output of instr-debug.log
:
EDIT: I just saw, I actually do get an instrumented jar, despite the error. I nevertheless want to report the error
[main] INFO JimpleWriter - initialize (17): Initializing Instrumenter
[main] INFO JimpleWriter - initialize (29): Initialization done
[main] INFO JimpleWriter - start (36): Running packs ...
[main] INFO JimpleWriter - start (38): Writing output ...
[main] INFO JimpleWriter - start (40): Output written ...
[main] INFO JavaInstrumenter - initialize (79): Initializing Instrumenter
[main] INFO JavaInstrumenter - initialize (98): Initialization done
[main] INFO JavaInstrumenter - start (252): Running packs ...
[Thread-28] ERROR heros.solver.CountingThreadPoolExecutor - Worker thread execution failed: Failed to apply jb to <net.bytebuddy.implementation.bytecode.constant.FieldConstant: net.bytebuddy.implementation.bytecode.StackManipulation$Size apply(net.bytebuddy.jar.asm.MethodVisitor,net.bytebuddy.implementation.Implementation$Context)>
java.lang.RuntimeException: Failed to apply jb to <net.bytebuddy.implementation.bytecode.constant.FieldConstant: net.bytebuddy.implementation.bytecode.StackManipulation$Size apply(net.bytebuddy.jar.asm.MethodVisitor,net.bytebuddy.implementation.Implementation$Context)>
at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2238)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:446)
at soot.PackManager.lambda$retrieveAllBodies$2(PackManager.java:1252)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassCastException: class java.util.LinkedHashMap$Entry cannot be cast to class java.util.HashMap$TreeNode (java.util.LinkedHashMap$Entry and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap')
at java.base/java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1882)
at java.base/java.util.HashMap$TreeNode.treeify(HashMap.java:1998)
at java.base/java.util.HashMap.treeifyBin(HashMap.java:767)
at java.base/java.util.HashMap.putVal(HashMap.java:639)
at java.base/java.util.HashMap.put(HashMap.java:607)
at com.google.common.collect.StandardTable.getOrCreate(StandardTable.java:137)
at com.google.common.collect.StandardTable.put(StandardTable.java:148)
at com.google.common.collect.HashBasedTable.put(HashBasedTable.java:51)
at soot.FastHierarchy.resolveMethod(FastHierarchy.java:807)
at soot.FastHierarchy.resolveMethod(FastHierarchy.java:760)
at soot.SootMethodRefImpl.tryResolve(SootMethodRefImpl.java:216)
at soot.SootMethodRefImpl.tryResolve(SootMethodRefImpl.java:202)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:304)
at soot.toolkits.exceptions.UnitThrowAnalysis$ValueSwitch.caseInstanceInvokeExpr(UnitThrowAnalysis.java:1181)
at soot.toolkits.exceptions.UnitThrowAnalysis$ValueSwitch.caseSpecialInvokeExpr(UnitThrowAnalysis.java:1003)
at soot.jimple.internal.AbstractSpecialInvokeExpr.apply(AbstractSpecialInvokeExpr.java:117)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:296)
at soot.toolkits.exceptions.UnitThrowAnalysis$UnitSwitch.caseInvokeStmt(UnitThrowAnalysis.java:802)
at soot.jimple.internal.JInvokeStmt.apply(JInvokeStmt.java:99)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:280)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:275)
at soot.toolkits.graph.ExceptionalUnitGraph.buildExceptionDests(ExceptionalUnitGraph.java:277)
at soot.toolkits.graph.ExceptionalUnitGraph.initialize(ExceptionalUnitGraph.java:220)
at soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java:127)
at soot.jimple.toolkits.scalar.UnreachableCodeEliminator.internalTransform(UnreachableCodeEliminator.java:86)
at soot.BodyTransformer.transform(BodyTransformer.java:47)
at soot.Transform.apply(Transform.java:126)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:64)
at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:112)
at soot.Pack.apply(Pack.java:126)
at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2236)
... 5 more
Exception in thread "Thread-28" java.lang.RuntimeException: Failed to apply jb to <net.bytebuddy.implementation.bytecode.constant.FieldConstant: net.bytebuddy.implementation.bytecode.StackManipulation$Size apply(net.bytebuddy.jar.asm.MethodVisitor,net.bytebuddy.implementation.Implementation$Context)>
at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2238)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:446)
at soot.PackManager.lambda$retrieveAllBodies$2(PackManager.java:1252)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassCastException: class java.util.LinkedHashMap$Entry cannot be cast to class java.util.HashMap$TreeNode (java.util.LinkedHashMap$Entry and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap')
at java.base/java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1882)
at java.base/java.util.HashMap$TreeNode.treeify(HashMap.java:1998)
at java.base/java.util.HashMap.treeifyBin(HashMap.java:767)
at java.base/java.util.HashMap.putVal(HashMap.java:639)
at java.base/java.util.HashMap.put(HashMap.java:607)
at com.google.common.collect.StandardTable.getOrCreate(StandardTable.java:137)
at com.google.common.collect.StandardTable.put(StandardTable.java:148)
at com.google.common.collect.HashBasedTable.put(HashBasedTable.java:51)
at soot.FastHierarchy.resolveMethod(FastHierarchy.java:807)
at soot.FastHierarchy.resolveMethod(FastHierarchy.java:760)
at soot.SootMethodRefImpl.tryResolve(SootMethodRefImpl.java:216)
at soot.SootMethodRefImpl.tryResolve(SootMethodRefImpl.java:202)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:304)
at soot.toolkits.exceptions.UnitThrowAnalysis$ValueSwitch.caseInstanceInvokeExpr(UnitThrowAnalysis.java:1181)
at soot.toolkits.exceptions.UnitThrowAnalysis$ValueSwitch.caseSpecialInvokeExpr(UnitThrowAnalysis.java:1003)
at soot.jimple.internal.AbstractSpecialInvokeExpr.apply(AbstractSpecialInvokeExpr.java:117)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:296)
at soot.toolkits.exceptions.UnitThrowAnalysis$UnitSwitch.caseInvokeStmt(UnitThrowAnalysis.java:802)
at soot.jimple.internal.JInvokeStmt.apply(JInvokeStmt.java:99)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:280)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:275)
at soot.toolkits.graph.ExceptionalUnitGraph.buildExceptionDests(ExceptionalUnitGraph.java:277)
at soot.toolkits.graph.ExceptionalUnitGraph.initialize(ExceptionalUnitGraph.java:220)
at soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java:127)
at soot.jimple.toolkits.scalar.UnreachableCodeEliminator.internalTransform(UnreachableCodeEliminator.java:86)
at soot.BodyTransformer.transform(BodyTransformer.java:47)
at soot.Transform.apply(Transform.java:126)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:64)
at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:112)
at soot.Pack.apply(Pack.java:126)
at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2236)
... 5 more
Exception in thread "main" java.lang.RuntimeException: Failed to apply jb to <net.bytebuddy.implementation.bytecode.constant.FieldConstant: net.bytebuddy.implementation.bytecode.StackManipulation$Size apply(net.bytebuddy.jar.asm.MethodVisitor,net.bytebuddy.implementation.Implementation$Context)>
at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2238)
at soot.SootMethod.retrieveActiveBody(SootMethod.java:446)
at soot.PackManager.lambda$retrieveAllBodies$2(PackManager.java:1252)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassCastException: class java.util.LinkedHashMap$Entry cannot be cast to class java.util.HashMap$TreeNode (java.util.LinkedHashMap$Entry and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap')
at java.base/java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1882)
at java.base/java.util.HashMap$TreeNode.treeify(HashMap.java:1998)
at java.base/java.util.HashMap.treeifyBin(HashMap.java:767)
at java.base/java.util.HashMap.putVal(HashMap.java:639)
at java.base/java.util.HashMap.put(HashMap.java:607)
at com.google.common.collect.StandardTable.getOrCreate(StandardTable.java:137)
at com.google.common.collect.StandardTable.put(StandardTable.java:148)
at com.google.common.collect.HashBasedTable.put(HashBasedTable.java:51)
at soot.FastHierarchy.resolveMethod(FastHierarchy.java:807)
at soot.FastHierarchy.resolveMethod(FastHierarchy.java:760)
at soot.SootMethodRefImpl.tryResolve(SootMethodRefImpl.java:216)
at soot.SootMethodRefImpl.tryResolve(SootMethodRefImpl.java:202)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:304)
at soot.toolkits.exceptions.UnitThrowAnalysis$ValueSwitch.caseInstanceInvokeExpr(UnitThrowAnalysis.java:1181)
at soot.toolkits.exceptions.UnitThrowAnalysis$ValueSwitch.caseSpecialInvokeExpr(UnitThrowAnalysis.java:1003)
at soot.jimple.internal.AbstractSpecialInvokeExpr.apply(AbstractSpecialInvokeExpr.java:117)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:296)
at soot.toolkits.exceptions.UnitThrowAnalysis$UnitSwitch.caseInvokeStmt(UnitThrowAnalysis.java:802)
at soot.jimple.internal.JInvokeStmt.apply(JInvokeStmt.java:99)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:280)
at soot.toolkits.exceptions.UnitThrowAnalysis.mightThrow(UnitThrowAnalysis.java:275)
at soot.toolkits.graph.ExceptionalUnitGraph.buildExceptionDests(ExceptionalUnitGraph.java:277)
at soot.toolkits.graph.ExceptionalUnitGraph.initialize(ExceptionalUnitGraph.java:220)
at soot.toolkits.graph.ExceptionalUnitGraph.<init>(ExceptionalUnitGraph.java:127)
at soot.jimple.toolkits.scalar.UnreachableCodeEliminator.internalTransform(UnreachableCodeEliminator.java:86)
at soot.BodyTransformer.transform(BodyTransformer.java:47)
at soot.Transform.apply(Transform.java:126)
at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:64)
at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:112)
at soot.Pack.apply(Pack.java:126)
at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2236)
... 5 more
I pulled, cleaned and re-built both, Core and Slicer4J
from slicer4j.
I do not get this error, however, it seems like disabling soot's unreachable code optimization may work. I'll try that and update the code and let you know.
from slicer4j.
Related Issues (20)
- Declaring, modifying, and using class fields HOT 1
- toString() methods and data classes. HOT 1
- Question: Can Slicer4J run on the whole test suite? HOT 1
- Missing .gitmodules file HOT 2
- Library classes in jar are thrown out during instrumentation HOT 2
- Can I use Slicer4J on jdk 1.8 version? HOT 2
- Instrumentation failure, Resolved Field is Null HOT 4
- defects4j HOT 1
- exception in java -cp "Slicer4J/target/slicer4j-jar-with-dependencies.jar:Slicer4J/target/lib/*" ca.ubc.ece.resess.slicer.dynamic.slicer4j.Slicer -h HOT 2
- python3 run_benchmarks.py does not find javaslicer HOT 1
- does not find line number if the slicing criterion is in the test class HOT 1
- having trouble understanding JacksonCore_4b benchmark slicing criterion HOT 8
- Java version clarification
- Could not find or load main class SliceMe, MavenReportException: Error while generating Javadoc. HOT 2
- False positives by Slicer4J
- False negatives by Slicer4J
- Analyze .jar file that does not contain line number HOT 3
- Instructions to run on more Defects4J projects HOT 6
- The content of the trace.log HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slicer4j.