Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1t3p1g committed Jan 12, 2023
1 parent f3df4fc commit c66566d
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 15 deletions.
6 changes: 3 additions & 3 deletions config/settings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ tabby.build.isJDKOnly = false
tabby.build.checkFatJar = true

# pointed-to analysis
tabby.build.isFullCallGraphCreate = false
tabby.build.isFullCallGraphCreate = true
tabby.build.thread.timeout = 2
tabby.build.isNeedToCreateIgnoreList = false

# targets to analyse
tabby.build.target = cases/emcsqlproxy.war
tabby.build.libraries = libs
tabby.build.mode = gadget
tabby.build.mode = web

# db settings
tabby.cache.path = ./cache/dev
tabby.cache.auto.remove = true
tabby.cache.auto.remove = false
tabby.cache.compress.times = 1

tabby.neo4j.username = neo4j
Expand Down
87 changes: 87 additions & 0 deletions rules/commonJars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[
"commons-collections",
"commons-codec",
"commons-fileupload",
"commons-io",
"commons-configuration",
"commons-dbcp",
"commons-lang",
"commons-logging",
"commons-pool",
"commons-beanutils",
"commons-httpclient",
"commons-cli",
"commons-dbutils",
"commons-digester",
"commons-discovery",
"commons-email",
"commons-jxpath",
"poi-",
"jetty-",
"apache-el",
"apache-jsp",
"apache-jstl",
"apache-ant",
"mybatis-",
"asm-",
"mysql-connector-java",
"netty-",
"dubbo-",
"el-api-",
"fastjson-",
"guava-",
"httpclient-",
"httpcore-",
"ibatis-sqlmap",
"itext-",
"jackson-",
"servlet-api",
"javassist-",
"spring-",
"javax.servlet.jsp.jstl-api",
"javax.ws.rs-api",
"javax.annotation-api",
"crypto-",
"ognl-",
"logback-",
"taglibs-standard-",
"zookeeper-",
"jfreechart-",
"jline-",
"xercesImpl-",
"slf4j-api",
"com.springsource.",
"sofa-runtime",
"abatis-sqlmap",
"ojdbc14",
"kryo-",
"guice-",
"xstream-",
"struts",
"xml-",
"log4j-",
"zdal-",
"aspectjweaver-",
"oceanbase-",
"org.eclipse.osgi-",
"jboss-",
"hibernate-",
"castor-",
"quartz-",
"javax.activation-",
"junit-",
"jsp-api",
"jaxb-",
"org.codehaus.groovy",
"groovy",
"json-",
"druid-",
"confkeeper-",
"aopalliance-",
"jdom-",
"validation-api",
"javax.servlet-",
"jconsole-",
"xpp3_min",
"toolkit-common-"
]
8 changes: 3 additions & 5 deletions src/main/java/tabby/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import tabby.config.GlobalConfiguration;
import tabby.core.Analyser;
import tabby.exception.JDKVersionErrorException;
import tabby.util.JavaVersion;

@Slf4j
@SpringBootApplication
Expand All @@ -41,9 +39,9 @@ public void setLogDebugLevel(){
CommandLineRunner run(){
return args -> {
try{
if(!JavaVersion.isJDK8()){ // jdk11 运行环境还有一些问题,暂时关闭
throw new JDKVersionErrorException("Error JDK version. Please using JDK8.");
}
// if(!JavaVersion.isJDK8()){
// throw new JDKVersionErrorException("Error JDK version. Please using JDK8.");
// }
setLogDebugLevel();
analyser.run();
}catch (IllegalArgumentException e){
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/tabby/core/scanner/FullCallGraphScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public void buildCallEdge(MethodReference methodRef){
}

JimpleBody body = (JimpleBody) Switcher.retrieveBody(method, method.getSignature());
if(body == null) return;

DefaultInvokeModel model = new DefaultInvokeModel();
for(Unit unit:body.getUnits()){
Stmt stmt = (Stmt) unit;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tabby/core/switcher/Switcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public static PollutedVarsPointsToAnalysis doMethodAnalysis(Context context,
}

JimpleBody body = (JimpleBody) retrieveBody(method, methodRef.getSignature());
if(body == null) return null;

UnitGraph graph = new BriefUnitGraph(body);
PollutedVarsPointsToAnalysis pta =
PollutedVarsPointsToAnalysis
Expand Down Expand Up @@ -355,7 +357,7 @@ public static Body retrieveBody(SootMethod method, String signature){
// 这里两分钟改成配置文件timeout-1,最短1分钟
body = future.get( Integer.max(GlobalConfiguration.TIMEOUT-1, 1) * 60L, TimeUnit.SECONDS);
}catch (TimeoutException e){
throw new RuntimeException("Method Fetch Timeout "+signature);
log.error("Method Fetch Timeout "+signature);
} catch (ExecutionException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
Expand Down
18 changes: 12 additions & 6 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
spring.profiles.active=default
#debug=true
#logging.level.tabby=DEBUG
logging.level.org.springframework=ERROR
logging.level.org.springframework.data=OFF
logging.level.org.hibernate=ERROR
logging.level.com.zaxxer=OFF
logging.level.tabby=INFO
logging.level.org.apache.jasper=OFF
# neo4j
#spring.data.neo4j.uri=bolt://127.0.0.1:7687
#spring.data.neo4j.username=neo4j
#spring.data.neo4j.password=password
spring.neo4j.uri=bolt://127.0.0.1:7687
spring.neo4j.authentication.username=neo4j
spring.neo4j.authentication.password=password
#spring.neo4j.uri=bolt://127.0.0.1:7687
#spring.neo4j.authentication.username=neo4j
#spring.neo4j.authentication.password=password
#spring.data.neo4j.embedded.enabled=true

spring.datasource.url=jdbc:h2:file:./cache/graphdb;MODE=MySQL;LOCK_MODE=3
#spring.datasource.url=jdbc:h2:file:./cache/graphdb;MODE=MySQL;LOCK_MODE=3;compress=true
#spring.datasource.url=jdbc:h2:mem:graphdb
spring.datasource.driverClassName=org.h2.Driver
#spring.datasource.driverClassName=org.h2.Driver
#spring.datasource.username=sa
#spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

spring.jpa.hibernate.ddl-auto=update
#spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.validator.apply_to_ddl=false
spring.jpa.properties.hibernate.validator.apply_to_ddl=false

0 comments on commit c66566d

Please sign in to comment.