Closed Y4er closed 1 year ago
After debugging, it looks like tai-e is using the wrong version of jre when parsing ir, resulting in not finding the StringConcatFactory.makeConcatWithConstants function. But I clearly specified -java 8, that's weird.
public com.vmware.vcops.casa.support.HttpMapResponse[] manageCertOnCluster(java.lang.String, java.lang.String)
{
com.vmware.vcops.casa.security.SecurityController r6;
com.vmware.vcops.casa.security.WebServerCertificateAction $r2;
java.lang.String r0, $r1, r3, $r4, $r11, $r15;
com.vmware.vcops.casa.security.WebServerCertificateType $r5;
org.slf4j.Logger $r10, $r14;
com.vmware.vcops.casa.support.HttpMapResponse[] $r8;
com.vmware.vcops.casa.exception.CasaException $r12, $r16;
java.lang.IllegalArgumentException $r9, $r13;
com.vmware.vcops.casa.security.SecurityService $r7;
r6 := @this: com.vmware.vcops.casa.security.SecurityController;
r0 := @parameter0: java.lang.String;
r3 := @parameter1: java.lang.String;
label1:
$r1 = virtualinvoke r0.<java.lang.String: java.lang.String toUpperCase()>();
$r2 = staticinvoke <com.vmware.vcops.casa.security.WebServerCertificateAction: com.vmware.vcops.casa.security.WebServerCertificateAction valueOf(java.lang.String)>($r1);
label2:
goto label4;
label3:
$r13 := @caughtexception;
$r14 = r6.<com.vmware.vcops.casa.security.SecurityController: org.slf4j.Logger log>;
$r15 = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(r0) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Illegal enum for certificate action: \u0001");
interfaceinvoke $r14.<org.slf4j.Logger: void error(java.lang.String)>($r15);
$r16 = new com.vmware.vcops.casa.exception.CasaException;
specialinvoke $r16.<com.vmware.vcops.casa.exception.CasaException: void <init>(java.lang.Throwable)>($r13);
throw $r16;
label4:
$r4 = virtualinvoke r3.<java.lang.String: java.lang.String toUpperCase()>();
$r5 = staticinvoke <com.vmware.vcops.casa.security.WebServerCertificateType: com.vmware.vcops.casa.security.WebServerCertificateType valueOf(java.lang.String)>($r4);
label5:
goto label7;
label6:
$r9 := @caughtexception;
$r10 = r6.<com.vmware.vcops.casa.security.SecurityController: org.slf4j.Logger log>;
$r11 = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(r3) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Illegal enum for certificate type: \u0001");
interfaceinvoke $r10.<org.slf4j.Logger: void error(java.lang.String)>($r11);
$r12 = new com.vmware.vcops.casa.exception.CasaException;
specialinvoke $r12.<com.vmware.vcops.casa.exception.CasaException: void <init>(java.lang.Throwable)>($r9);
throw $r12;
label7:
$r7 = r6.<com.vmware.vcops.casa.security.SecurityController: com.vmware.vcops.casa.security.SecurityService securityService>;
$r8 = virtualinvoke $r7.<com.vmware.vcops.casa.security.SecurityService: com.vmware.vcops.casa.support.HttpMapResponse[] delegateActivateWebServerCert(com.vmware.vcops.casa.security.WebServerCertificateAction,com.vmware.vcops.casa.security.WebServerCertificateType)>($r2, $r5);
return $r8;
catch java.lang.IllegalArgumentException from label1 to label2 with label3;
catch java.lang.IllegalArgumentException from label4 to label5 with label6;
}
java.lang.invoke.StringConcatFactory
does not exist in jdk1.8 (according to Java doc, this class was introduced since Java 9), which may be the cause. How about replace -java 8
by -pp
(use JDK 17 as library)?
Exceptions are still thrown after replacing -java 8
with -pp
Exception in thread "main" pascal.taie.ir.proginfo.MethodResolutionFailedException: Cannot resolve <java.lang.runtime.ObjectMethods: java.lang.Object bootstrap(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.TypeDescriptor,java.lang.Class,java.lang.String,java.lang.invoke.MethodHandle[])>
at pascal.taie.ir.proginfo.MethodRef.resolve(MethodRef.java:180)
at pascal.taie.analysis.pta.plugin.invokedynamic.LambdaAnalysis.isLambdaMetaFactory(LambdaAnalysis.java:122)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at pascal.taie.analysis.pta.plugin.invokedynamic.LambdaAnalysis.onNewMethod(LambdaAnalysis.java:104)
at pascal.taie.analysis.pta.plugin.CompositePlugin.lambda$onNewMethod$3(CompositePlugin.java:115)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at pascal.taie.analysis.pta.plugin.CompositePlugin.onNewMethod(CompositePlugin.java:115)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.processNewMethod(DefaultSolver.java:497)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.addCSMethod(DefaultSolver.java:780)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.processCallEdge(DefaultSolver.java:453)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.analyze(DefaultSolver.java:300)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.solve(DefaultSolver.java:238)
at pascal.taie.analysis.pta.PointerAnalysis.runAnalysis(PointerAnalysis.java:118)
at pascal.taie.analysis.pta.PointerAnalysis.analyze(PointerAnalysis.java:106)
at pascal.taie.analysis.pta.PointerAnalysis.analyze(PointerAnalysis.java:63)
at pascal.taie.analysis.AnalysisManager.runProgramAnalysis(AnalysisManager.java:147)
at pascal.taie.analysis.AnalysisManager.runAnalysis(AnalysisManager.java:120)
at pascal.taie.analysis.AnalysisManager.lambda$execute$0(AnalysisManager.java:104)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.analysis.AnalysisManager.lambda$execute$1(AnalysisManager.java:103)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at pascal.taie.analysis.AnalysisManager.execute(AnalysisManager.java:102)
at pascal.taie.Main.executePlan(Main.java:143)
at pascal.taie.Main.lambda$main$0(Main.java:57)
at pascal.taie.util.Timer.lambda$runAndCount$0(Timer.java:112)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.util.Timer.runAndCount(Timer.java:111)
at pascal.taie.util.Timer.runAndCount(Timer.java:107)
at pascal.taie.Main.main(Main.java:49)
Is java.lang.runtime.ObjectMethods
a phantom class? Could you please show the content of this class? (You can call ClassHierarchy.getClass("java.lang.runtime.ObjectMethods")
to obtain this class, and view its content in debugger).
my all lib https://mega.nz/file/qMthwYpB#lR1HIbuM81SV1msYPw_CA9k7rSrgRop0OeB20TAErlQ
first ClassNameExtractor get all classname
c.txt
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\classes.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\main.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.servlet-api-4.0.1.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\accessors-smart-1.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\activation-1.1.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\annotations-api.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\asm-5.0.4.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\aspectjrt-1.7.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\aspectjweaver-1.7.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\bc-fips-1.0.2.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\bcpkix-fips-1.0.6.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\casa-client-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\casa-common-1.0.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\casa-rest-client-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-ant.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-ha.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-storeconfig.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-tribes.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\classmate-1.3.1.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-cli-1.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-codec-1.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-collections-3.2.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-configuration-1.10.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-digester-1.8.1.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-fileupload-1.3.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-io-2.4.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-lang-2.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-lang3-3.12.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-logging-1.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-net-3.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-validator-1.4.1.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\ecj-4.6.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\el-api.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\gson-2.9.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\guava-18.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\hibernate-validator-6.0.14.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\hsqldb-2.2.9.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\httpclient-4.3.6.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\httpcore-4.3.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\install-upgrade-model-1.0.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\install-upgrade-server-1.0.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jackson-annotations-2.13.4.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jackson-core-2.13.4.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jackson-databind-2.13.4.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jasper-el.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jasper.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jaspic-api.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.activation-api-1.2.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.el-2.2.6.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.el-api-3.0.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.mail-1.6.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jaxb-api-2.3.1.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jboss-logging-3.3.2.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jjwt-api-0.11.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jjwt-impl-0.11.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jjwt-jackson-0.11.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\json-20090211.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\json-path-2.4.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\json-smart-2.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jsoup-1.14.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jsp-api.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\log4j-api-2.17.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\log4j-core-2.17.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\log4j-slf4j-impl-2.17.2.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\metrics-core-3.1.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-all-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-buffer-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-dns-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-haproxy-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-http-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-http2-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-memcache-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-mqtt-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-redis-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-smtp-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-socks-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-stomp-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-xml-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-common-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-handler-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-handler-proxy-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-classes-macos-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-native-macos-4.1.80.Final-osx-aarch_64.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-native-macos-4.1.80.Final-osx-x86_64.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-classes-epoll-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-classes-kqueue-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-epoll-4.1.80.Final-linux-aarch_64.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-epoll-4.1.80.Final-linux-x86_64.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-kqueue-4.1.80.Final-osx-aarch_64.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-kqueue-4.1.80.Final-osx-x86_64.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-unix-common-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-rxtx-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-sctp-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-udt-4.1.80.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\servlet-api.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\slf4j-api-1.7.13.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-aop-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-beans-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-context-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-core-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-expression-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-hateoas-0.19.0.RELEASE.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-jcl-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-plugin-core-1.2.0.RELEASE.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-plugin-metadata-1.2.0.RELEASE.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-restdocs-core-2.0.3.RELEASE.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-config-5.7.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-core-5.7.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-crypto-5.7.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-web-5.7.5.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-web-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-webmvc-5.3.20.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\springfox-core-2.4.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\springfox-schema-2.4.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\tomcat-util.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\tomcat-websocket.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\trove4j-3.0.3.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\validation-api-2.0.1.Final.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vcops-common-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vcops-platform-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vcops-security-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-adapters-sdk-1.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-jmx-metrics-1.0.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-logging-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-rmi-1.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-trustmanager-3.0-SNAPSHOT.jar
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\websocket-api.jar
get c.txt
pascal.taie.analysis.pta.plugin.taint.TaintAnalysis
/*
* Tai-e: A Static Analysis Framework for Java
*
* Copyright (C) 2022 Tian Tan <tiantan@nju.edu.cn>
* Copyright (C) 2022 Yue Li <yueli@nju.edu.cn>
*
* This file is part of Tai-e.
*
* Tai-e is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Tai-e is distributed in the hope that it will be useful,but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Tai-e. If not, see <https://www.gnu.org/licenses/>.
*/
package pascal.taie.analysis.pta.plugin.taint;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import pascal.taie.World;
import pascal.taie.analysis.graph.callgraph.Edge;
import pascal.taie.analysis.pta.PointerAnalysisResult;
import pascal.taie.analysis.pta.core.cs.context.Context;
import pascal.taie.analysis.pta.core.cs.element.*;
import pascal.taie.analysis.pta.core.heap.HeapModel;
import pascal.taie.analysis.pta.core.heap.Obj;
import pascal.taie.analysis.pta.core.solver.EntryPoint;
import pascal.taie.analysis.pta.core.solver.Solver;
import pascal.taie.analysis.pta.core.solver.SpecifiedParamProvider;
import pascal.taie.analysis.pta.plugin.Plugin;
import pascal.taie.analysis.pta.pts.PointsToSet;
import pascal.taie.ir.exp.InvokeExp;
import pascal.taie.ir.exp.InvokeInstanceExp;
import pascal.taie.ir.exp.Var;
import pascal.taie.ir.stmt.Invoke;
import pascal.taie.language.classes.JClass;
import pascal.taie.language.classes.JMethod;
import pascal.taie.language.type.ClassType;
import pascal.taie.language.type.Type;
import pascal.taie.util.collection.Maps;
import pascal.taie.util.collection.MultiMap;
import pascal.taie.util.collection.Pair;
import java.util.*;
public class TaintAnalysis implements Plugin {
private static final Logger logger = LogManager.getLogger(TaintAnalysis.class);
/**
* Map from method (which is source method) to set of types of
* taint objects returned by the method calls.
*/
private final MultiMap<JMethod, Type> sources = Maps.newMultiMap();
/**
* Map from method (which causes taint transfer) to set of relevant
* {@link TaintTransfer}.
*/
private final MultiMap<JMethod, TaintTransfer> transfers = Maps.newMultiMap();
private final Set<Sink> sinks = new HashSet<>();
/**
* Map from variable to taint transfer information.
* The taint objects pointed to by the "key" variable are supposed
* to be transferred to "value" variable with specified type.
*/
private final MultiMap<Var, Pair<Var, Type>> varTransfers = Maps.newMultiMap();
private Solver solver;
private CSManager csManager;
private Context emptyContext;
private TaintManager manager;
private TaintConfig config;
/**
* Retrieves variable from a call site and index.
*/
private static Var getVar(Invoke callSite, int index) {
InvokeExp invokeExp = callSite.getInvokeExp();
return switch (index) {
case TaintTransfer.BASE -> ((InvokeInstanceExp) invokeExp).getBase();
case TaintTransfer.RESULT -> callSite.getResult();
default -> invokeExp.getArg(index);
};
}
@Override
public void onStart() {
HeapModel heapModel = solver.getHeapModel();
JClass httpRequestWrapper = World.get().getClassHierarchy().getClass("javax.servlet.http.HttpServletRequestWrapper");
JClass servletRequestWrapper = World.get().getClassHierarchy().getClass("javax.servlet.ServletRequestWrapper");
World.get().getClassHierarchy().allClasses().filter(c -> c.hasAnnotation("org.springframework.stereotype.Controller")).forEach(clazz -> {
clazz.getDeclaredMethods().forEach(method -> {
if (method.getName().equals("manageCertOnCluster")) {
Obj mockObj = heapModel.getMockObj(UUID.randomUUID().toString(), UUID.randomUUID().toString(), clazz.getType());
SpecifiedParamProvider.Builder builder = new SpecifiedParamProvider.Builder(method).addThisObj(mockObj);
List<Type> paramTypes = method.getParamTypes();
for (int i = 0; i < paramTypes.size(); i++) {
Type type = paramTypes.get(i);
Obj mockParam = heapModel.getMockObj(UUID.randomUUID().toString(), UUID.randomUUID().toString(), type, method);
builder.addParamObj(i, mockParam);
if (type instanceof ClassType) {
World.get().getClassHierarchy().getClass(type.getName()).getDeclaredMethods().forEach(m -> sources.put(m, m.getReturnType()));
}
}
SpecifiedParamProvider provider = builder.build();
solver.addEntryPoint(new EntryPoint(method, provider));
}
});
});
httpRequestWrapper.getDeclaredMethods().stream().filter(jMethod -> jMethod.getName().startsWith("get")).forEach(m -> {
sources.put(m, m.getReturnType());
});
servletRequestWrapper.getDeclaredMethods().stream().filter(jMethod -> jMethod.getName().startsWith("get")).forEach(m -> {
sources.put(m, m.getReturnType());
});
World.get().getClassHierarchy().getClass("java.lang.Runtime").getDeclaredMethods().stream().filter(jMethod -> jMethod.getName().equals("exec")).forEach(this::add2Sink);
World.get().getClassHierarchy().getClass("java.lang.ProcessBuilder").getDeclaredMethods().stream().filter(jMethod -> jMethod.getName().equals("<init>") || jMethod.getName().equals("start")).forEach(this::add2Sink);
// print sources
System.out.println("sources....");
sources.forEach((k, v) -> System.out.println(k.getMethodSource() + "\t" + v.getName()));
System.out.println();
// print sink
System.out.println("sinks....");
sinks.forEach(s -> System.out.println(s));
System.out.println();
}
Sink add2Sink(JMethod jMethod) {
for (int i = 0; i < jMethod.getParamCount(); i++) {
sinks.add(new Sink(jMethod, i));
}
return null;
}
@Override
public void setSolver(Solver solver) {
this.solver = solver;
csManager = solver.getCSManager();
emptyContext = solver.getContextSelector().getEmptyContext();
manager = new TaintManager(solver.getHeapModel());
config = TaintConfig.readConfig(solver.getOptions().getString("taint-config"), solver.getHierarchy(), solver.getTypeSystem());
// logger.info(config);
config.getSources().forEach(s -> sources.put(s.method(), s.type()));
config.getTransfers().forEach(t -> transfers.put(t.method(), t));
config.getSinks().forEach(s -> sinks.add(s));
}
@Override
public void onNewCallEdge(Edge<CSCallSite, CSMethod> edge) {
Invoke callSite = edge.getCallSite().getCallSite();
JMethod callee = edge.getCallee().getMethod();
// generate taint value from source call
Var lhs = callSite.getLValue();
if (lhs != null && sources.containsKey(callee)) {
sources.get(callee).forEach(type -> {
Obj taint = manager.makeTaint(callSite, type);
solver.addVarPointsTo(edge.getCallSite().getContext(), lhs, emptyContext, taint);
});
}
// process taint transfer
transfers.get(callee).forEach(transfer -> {
Var from = getVar(callSite, transfer.from());
Var to = getVar(callSite, transfer.to());
// when transfer to result variable, and the call site
// does not have result variable, then "to" is null.
if (to != null) {
Type type = transfer.type();
varTransfers.put(from, new Pair<>(to, type));
Context ctx = edge.getCallSite().getContext();
CSVar csFrom = csManager.getCSVar(ctx, from);
transferTaint(solver.getPointsToSetOf(csFrom), ctx, to, type);
}
});
}
private void transferTaint(PointsToSet pts, Context ctx, Var to, Type type) {
PointsToSet newTaints = solver.makePointsToSet();
pts.objects().map(CSObj::getObject).filter(manager::isTaint).map(manager::getSourceCall).map(source -> manager.makeTaint(source, type)).map(taint -> csManager.getCSObj(emptyContext, taint)).forEach(newTaints::addObject);
if (!newTaints.isEmpty()) {
solver.addVarPointsTo(ctx, to, newTaints);
}
}
@Override
public void onNewPointsToSet(CSVar csVar, PointsToSet pts) {
varTransfers.get(csVar.getVar()).forEach(p -> {
Var to = p.first();
Type type = p.second();
transferTaint(pts, csVar.getContext(), to, type);
});
}
@Override
public void onFinish() {
Set<TaintFlow> taintFlows = collectTaintFlows();
solver.getResult().storeResult(getClass().getName(), taintFlows);
}
private Set<TaintFlow> collectTaintFlows() {
PointerAnalysisResult result = solver.getResult();
Set<TaintFlow> taintFlows = new TreeSet<>();
sinks.forEach(sink -> {
int i = sink.index();
result.getCallGraph().getCallersOf(sink.method()).forEach(sinkCall -> {
Var arg = sinkCall.getInvokeExp().getArg(i);
result.getPointsToSet(arg).stream().filter(manager::isTaint).map(manager::getSourceCall).map(sourceCall -> new TaintFlow(sourceCall, sinkCall, i)).forEach(taintFlows::add);
});
});
return taintFlows;
}
}
then run tai-e
-cp
E:\tools\code\casa\src\main\webapp\WEB-INF\lib\classes.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\main.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.servlet-api-4.0.1.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\accessors-smart-1.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\activation-1.1.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\annotations-api.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\asm-5.0.4.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\aspectjrt-1.7.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\aspectjweaver-1.7.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\bc-fips-1.0.2.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\bcpkix-fips-1.0.6.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\casa-client-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\casa-common-1.0.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\casa-rest-client-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-ant.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-ha.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-storeconfig.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina-tribes.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\catalina.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\classmate-1.3.1.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-cli-1.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-codec-1.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-collections-3.2.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-configuration-1.10.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-digester-1.8.1.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-fileupload-1.3.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-io-2.4.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-lang-2.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-lang3-3.12.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-logging-1.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-net-3.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\commons-validator-1.4.1.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\ecj-4.6.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\el-api.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\gson-2.9.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\guava-18.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\hibernate-validator-6.0.14.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\hsqldb-2.2.9.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\httpclient-4.3.6.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\httpcore-4.3.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\install-upgrade-model-1.0.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\install-upgrade-server-1.0.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jackson-annotations-2.13.4.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jackson-core-2.13.4.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jackson-databind-2.13.4.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jasper-el.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jasper.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jaspic-api.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.activation-api-1.2.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.el-2.2.6.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.el-api-3.0.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\javax.mail-1.6.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jaxb-api-2.3.1.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jboss-logging-3.3.2.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jjwt-api-0.11.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jjwt-impl-0.11.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jjwt-jackson-0.11.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\json-20090211.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\json-path-2.4.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\json-smart-2.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jsoup-1.14.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\jsp-api.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\log4j-api-2.17.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\log4j-core-2.17.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\log4j-slf4j-impl-2.17.2.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\metrics-core-3.1.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-all-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-buffer-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-dns-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-haproxy-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-http-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-http2-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-memcache-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-mqtt-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-redis-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-smtp-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-socks-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-stomp-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-codec-xml-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-common-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-handler-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-handler-proxy-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-classes-macos-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-native-macos-4.1.80.Final-osx-aarch_64.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-resolver-dns-native-macos-4.1.80.Final-osx-x86_64.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-classes-epoll-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-classes-kqueue-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-epoll-4.1.80.Final-linux-aarch_64.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-epoll-4.1.80.Final-linux-x86_64.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-kqueue-4.1.80.Final-osx-aarch_64.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-kqueue-4.1.80.Final-osx-x86_64.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-native-unix-common-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-rxtx-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-sctp-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\netty-transport-udt-4.1.80.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\servlet-api.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\slf4j-api-1.7.13.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-aop-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-beans-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-context-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-core-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-expression-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-hateoas-0.19.0.RELEASE.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-jcl-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-plugin-core-1.2.0.RELEASE.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-plugin-metadata-1.2.0.RELEASE.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-restdocs-core-2.0.3.RELEASE.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-config-5.7.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-core-5.7.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-crypto-5.7.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-security-web-5.7.5.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-web-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\spring-webmvc-5.3.20.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\springfox-core-2.4.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\springfox-schema-2.4.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\tomcat-util.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\tomcat-websocket.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\trove4j-3.0.3.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\validation-api-2.0.1.Final.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vcops-common-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vcops-platform-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vcops-security-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-adapters-sdk-1.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-jmx-metrics-1.0.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-logging-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-rmi-1.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\vrops-trustmanager-3.0-SNAPSHOT.jar;E:\tools\code\casa\src\main\webapp\WEB-INF\lib\websocket-api.jar
-pp
--input-classes=c.txt
-m
com.example.casa.Main
-ap
-a
pta=action:dump;action-file:result.txt;taint-config:src\test\resources\pta\taint\taint-config.yml
error
Exception in thread "main" pascal.taie.ir.proginfo.MethodResolutionFailedException: Cannot resolve <java.lang.runtime.ObjectMethods: java.lang.Object bootstrap(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.TypeDescriptor,java.lang.Class,java.lang.String,java.lang.invoke.MethodHandle[])>
at pascal.taie.ir.proginfo.MethodRef.resolve(MethodRef.java:180)
at pascal.taie.analysis.pta.plugin.invokedynamic.LambdaAnalysis.isLambdaMetaFactory(LambdaAnalysis.java:122)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at pascal.taie.analysis.pta.plugin.invokedynamic.LambdaAnalysis.onNewMethod(LambdaAnalysis.java:104)
at pascal.taie.analysis.pta.plugin.CompositePlugin.lambda$onNewMethod$3(CompositePlugin.java:115)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at pascal.taie.analysis.pta.plugin.CompositePlugin.onNewMethod(CompositePlugin.java:115)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.processNewMethod(DefaultSolver.java:497)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.addCSMethod(DefaultSolver.java:780)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.processCallEdge(DefaultSolver.java:453)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.analyze(DefaultSolver.java:300)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.solve(DefaultSolver.java:238)
at pascal.taie.analysis.pta.PointerAnalysis.runAnalysis(PointerAnalysis.java:118)
at pascal.taie.analysis.pta.PointerAnalysis.analyze(PointerAnalysis.java:106)
at pascal.taie.analysis.pta.PointerAnalysis.analyze(PointerAnalysis.java:63)
at pascal.taie.analysis.AnalysisManager.runProgramAnalysis(AnalysisManager.java:147)
at pascal.taie.analysis.AnalysisManager.runAnalysis(AnalysisManager.java:120)
at pascal.taie.analysis.AnalysisManager.lambda$execute$0(AnalysisManager.java:104)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.analysis.AnalysisManager.lambda$execute$1(AnalysisManager.java:103)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at pascal.taie.analysis.AnalysisManager.execute(AnalysisManager.java:102)
at pascal.taie.Main.executePlan(Main.java:143)
at pascal.taie.Main.lambda$main$0(Main.java:57)
at pascal.taie.util.Timer.lambda$runAndCount$0(Timer.java:112)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.util.Timer.runAndCount(Timer.java:111)
at pascal.taie.util.Timer.runAndCount(Timer.java:107)
at pascal.taie.Main.main(Main.java:49)
@Y4er Thank you for your info. As shown in your screenshot, java.lang.runtime.ObjectMethods
is a phantom class, thus its methods cannot be resolved. It looks like an issue of soot-based front end, and we did not expect such cases before.
I just updated LambdaAnalysis.isLambdaMetaFactory()
in commit 7ece279, which should be able to fix the exception.
Another error was reported with -pp
Exception in thread "main" pascal.taie.util.AnalysisException: void cannot be dispatched
at pascal.taie.language.classes.ClassHierarchyImpl.dispatch(ClassHierarchyImpl.java:321)
at pascal.taie.analysis.graph.callgraph.CallGraphs.resolveCallee(CallGraphs.java:91)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.lambda$processCall$5(DefaultSolver.java:426)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.processCall(DefaultSolver.java:424)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.analyze(DefaultSolver.java:296)
at pascal.taie.analysis.pta.core.solver.DefaultSolver.solve(DefaultSolver.java:238)
at pascal.taie.analysis.pta.PointerAnalysis.runAnalysis(PointerAnalysis.java:118)
at pascal.taie.analysis.pta.PointerAnalysis.analyze(PointerAnalysis.java:106)
at pascal.taie.analysis.pta.PointerAnalysis.analyze(PointerAnalysis.java:63)
at pascal.taie.analysis.AnalysisManager.runProgramAnalysis(AnalysisManager.java:147)
at pascal.taie.analysis.AnalysisManager.runAnalysis(AnalysisManager.java:120)
at pascal.taie.analysis.AnalysisManager.lambda$execute$0(AnalysisManager.java:104)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.analysis.AnalysisManager.lambda$execute$1(AnalysisManager.java:103)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at pascal.taie.analysis.AnalysisManager.execute(AnalysisManager.java:102)
at pascal.taie.Main.executePlan(Main.java:143)
at pascal.taie.Main.lambda$main$0(Main.java:57)
at pascal.taie.util.Timer.lambda$runAndCount$0(Timer.java:112)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.util.Timer.runAndCount(Timer.java:111)
at pascal.taie.util.Timer.runAndCount(Timer.java:107)
at pascal.taie.Main.main(Main.java:49)
Using -java 8
instead of -pp
parameter does not give this exception.
Resolved, update tai-e to 7ece279 and use -java 8
. thanks! @silverbullettt
@Y4er No worries ;-)
Describe the bug
at pascal.taie.analysis.pta.core.solver.DefaultSolver#processNewMethod
<java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.invoke.MethodType); lang.Object[])>
function does not exist in jdk1.8Tai-e arguments
c.txt is a collection of all class names of
-cp
error analyzing
com.vmware.vcops.casa.security.SecurityController#manageCertOnCluster
functionOverride TaintAnalysis class to add entrypoint and source for my analysis
Runtime environment infomation
win10 idea 0934e7979547a2877c749a8fdc0b0c4dc709c30d