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

2.1.0 closable leak when extracting zip file #17

Closed
richstokes129 opened this issue Jul 10, 2019 · 2 comments
Closed

2.1.0 closable leak when extracting zip file #17

richstokes129 opened this issue Jul 10, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@richstokes129
Copy link

when calling ZipFile.extractAll with StrictMode on there is a crash due to a unclosed resource.

Similar to issue #3

'mainapp E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:223)
at java.io.RandomAccessFile.(RandomAccessFile.java:282)
at net.lingala.zip4j.io.inputstream.SplitInputStream.(SplitInputStream.java:22)
at net.lingala.zip4j.tasks.ExtractAllFilesTask.prepareZipInputStream(ExtractAllFilesTask.java:59)
at net.lingala.zip4j.tasks.ExtractAllFilesTask.executeTask(ExtractAllFilesTask.java:26)
at net.lingala.zip4j.tasks.ExtractAllFilesTask.executeTask(ExtractAllFilesTask.java:13)
at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:41)
at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:35)
at net.lingala.zip4j.ZipFile.extractAll(ZipFile.java:431)'

@srikanth-lingala
Copy link
Owner

After analysing this, I think the only way it happens currently is when you enter wrong password for an AES encrypted zip file. In this case, I see a bug that does not close the resource properly. Can you please confirm if you got this in the same circumstances? If not, it would be great if you can post your code and also, if possible, the zip file with which this happens. Thanks.

@srikanth-lingala srikanth-lingala self-assigned this Jul 10, 2019
@srikanth-lingala srikanth-lingala added the bug Something isn't working label Jul 10, 2019
@srikanth-lingala
Copy link
Owner

As I did not get any further feedback to my question, I presume that this exception occurs only in the scenario outlined in my comment above. I have included a fix for it in version 2.1.1 which is released today. If you still get this exception, please reopen this issue along with your code sample and if possible also the zip file. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants