github/codeql

Create database failed with "diagnostic.trap.gz, 22593: java.io.EOFException: Unexpected end of ZLIB input stream"

pang0lin opened this issue · 9 comments

When I create database with java code, it comes with error .
image
Even though it create a database successfully, but the created database does not have the complete source files. In my case, I have total 5000+ files in my code, otherwise the database only have 438 files.

Do you have a repository that can reproduce this error?

@smowton I have uploaded my code in https://github.com/pang0lin/qltest. I used ecj.jar to create database instead of javac. I have used it a lot of times with other source code, it works well. However, the code above returns errors.

I'm afraid I wasn't able to reproduce the problem with that repository, possibly because I had to guess how to build the code.

The run.sh script included in the repository doesn't work on its own because (a) there are many external library dependencies not included in the repo, and (b) there are .java files in the classes directory that do not compile (are they decompilations of class files perhaps?), such as classes/com/js/oa/portal/bean/CustomDesktopEJBBean.java which declares a variable of type Iterator<E> when there is no E in scope.

I worked around these by (a) deleting the .java files in classes and moving classes to the -classpath argument instead of the -sourcepath, and (b) guessing external dependencies:

javax.servlet-api-4.0.1.jar
jsp-api-2.2.jar
jasper-runtime-5.5.23.jar
apache-jsp-8.0.33.jar
javax.el-api-3.0.0.jar
hibernate-2.1.8.jar
jdom-1.1.3.jar
log4j-1.2.17.jar
dom4j-1.6.1.jar
ejb-api-3.0.jar
commons-lang-2.6.jar

With classes and these jar files on the classpath, the command java -jar ecj-4.6.1.jar -encoding UTF-8 -8 -warn:none -proceedOnError -noExit -cp classes:... org/apache/jsp/desktop_jsp.java org/apache/jsp/keylog_jsp.java org/apache/jsp/common_jsp.java org/apache/jsp/errorMsg_jsp.java successfully created a database.

If you are able to provide an example that is more directly reproducible I would be happy to try again.

I also encountered this issue when I was using the project https://github.com/waderwu/extractor-java to build a database based on certain source code.

@Siebene Can you give an example that reproduces the error? What CodeQL version were you using?

@smowton Hello, you can take a look at this https://github.com/Siebene/codeql-problem. I often use the run.py in this project, and it has been working fine for the majority of the time.

@smowton Hello, you can take a look at this https://github.com/Siebene/codeql-problem. I often use the run.py in this project, and it has been working fine for the majority of the time.

师傅解决了吗,我也遇到了这个问题

Check for an out of memory error logged in the database's log directory -- if you find one, you can try increasing the amount of memory the extractor is allowed to use (default 1GB) as described at #15217

@smowton Hello, you can take a look at this https://github.com/Siebene/codeql-problem. I often use the run.py in this project, and it has been working fine for the majority of the time.

师傅解决了吗,我也遇到了这个问题

一般是缺依赖了,我记得可以看有个报错日志。这个报错我从日志里面看大概是缺了依赖导致死循环递归了