Open AhmedHamdyYassin12 opened 2 years ago
What version of soot and what JRE/JDK version do you use?
Soot version:
4.4.1
Command line:
-process-dir src/main/java rnd.samples.Test
Max memory:
1446 MB
Stack trace:
java.lang.NullPointerException: Cannot invoke "String.split(String)" because the return value of "java.lang.System.getProperty(String)" is null
at soot.JastAddJ.Program.initPaths(Program.java:336)
at soot.SootResolver.initializeProgram(SootResolver.java:99)
at soot.SootResolver.getProgram(SootResolver.java:402)
at soot.JastAddInitialResolver.formAst(JastAddInitialResolver.java:62)
at soot.JavaClassSource.resolve(JavaClassSource.java:63)
at soot.SootResolver.bringToHierarchyUnchecked(SootResolver.java:274)
at soot.SootResolver.bringToHierarchy(SootResolver.java:243)
at soot.SootResolver.bringToSignatures(SootResolver.java:313)
at soot.SootResolver.processResolveWorklist(SootResolver.java:198)
at soot.SootResolver.resolveClass(SootResolver.java:155)
at soot.Scene.loadClass(Scene.java:1016)
at soot.Scene.loadClassAndSupport(Scene.java:1003)
at soot.Scene.loadNecessaryClasses(Scene.java:1968)
at soot.Main.run(Main.java:240)
at soot.Main.main(Main.java:142)
Is there any resolution for this? I am facing the same issue with OpenJDK-21 as well as OpenJDK-17.
I think the problem is in Program.java:332-350
...
String[] bootclasspaths;
if(options().hasValueForOption("-bootclasspath"))
bootclasspaths = options().getValueForOption("-bootclasspath").split(File.pathSeparator);
else
bootclasspaths = System.getProperty("sun.boot.class.path").split(File.pathSeparator);
for(int i = 0; i < bootclasspaths.length; i++) {
classPaths.add(bootclasspaths[i]);
//System.err.println("Adding classpath " + bootclasspaths[i]);
}
String[] extdirs;
if(options().hasValueForOption("-extdirs"))
extdirs = options().getValueForOption("-extdirs").split(File.pathSeparator);
else
extdirs = System.getProperty("java.ext.dirs").split(File.pathSeparator);
for(int i = 0; i < extdirs.length; i++) {
classPaths.add(extdirs[i]);
//System.err.println("Adding classpath " + extdirs[i]);
}
...
Both calls to System.getProperty
return null
for me.
I met the same problem.
Got NPE for bootclasspaths = System.getProperty("sun.boot.class.path").split(File.pathSeparator);
soot version: 0b0293994fa393f7129f820912324013279693e9
I find a solution https://github.com/soot-oss/soot/issues/1466#issuecomment-705016104 and it works for me. I put both the class file and java source file in the same directory. After removed the java source file from that directory, the exception gone away!
Steps to reproduce: 1.) ...
Files used to reproduce: ...
Soot version:
Command line:
Max Memory:
Stack trace: