Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pang0lin opened this issue Jan 6, 2023 · 8 comments
Labels
question Further information is requested

Comments

@pang0lin
Copy link

pang0lin commented Jan 6, 2023

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.

@pang0lin pang0lin added the question Further information is requested label Jan 6, 2023
@smowton
Copy link
Contributor

smowton commented Jan 6, 2023

Do you have a repository that can reproduce this error?

@pang0lin
Copy link
Author

pang0lin commented Jan 8, 2023

@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.

@smowton
Copy link
Contributor

smowton commented Jan 9, 2023

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.

@Siebene
Copy link

Siebene commented Jul 31, 2023

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.

@smowton
Copy link
Contributor

smowton commented Jul 31, 2023

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

@Siebene
Copy link

Siebene commented Aug 1, 2023

@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.

@Drun1baby
Copy link

@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
Copy link
Contributor

smowton commented Jan 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants