Raise JavaNotFoundError when the java executable cannot be run - #53
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Caveats: |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/pysoot_53 |
|
@zardus rebase |
_get_java_home() falls back to running "java -XshowSettings:properties" when JAVA_HOME is unset. On a host with no usable java, subprocess.run raises FileNotFoundError, which escaped Lifter() instead of the JavaNotFoundError the same function raises when no java.home is reported, so a caller could not tell a missing JVM from a defect in its input. Catch OSError rather than FileNotFoundError: a java that exists but is not executable is the same condition, and narrowing to the one errno observed would leave the rest of that class escaping as this one did.
d3833fc to
397e186
Compare
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Rebased onto master at The only conflict was in Full suite on the rebased head: |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
With
JAVA_HOMEunset,_get_java_home()locates a JVM by runningjava -XshowSettings:properties. With no usablejavaonPATH,subprocess.runraisesFileNotFoundError, which escapesLifter()rather than theJavaNotFoundErrorthe same function raises a few lines below — so a caller that handles the typed error still cannot tell a missing JVM from a defect in the input. A corpus of roughly 19,000 units was filed as analysis errors on that.The call now raises
JavaNotFoundErrorfrom the original error, catchingOSErrorrather thanFileNotFoundErrorso that ajavawhich is present but not executable is the same condition. It does not make a jar analysable — that still needs a reachable JVM and a filename Soot accepts by suffix — only reportable.The regression clears the environment, points
PATHat an empty directory, and asserts thatLifter()on the existingsimple1.jarfixture raisesJavaNotFoundError.Validation: #53 (comment)