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

File descriptor leak(?) in 1.0.16 #141

Closed
slonopotamus opened this issue May 12, 2024 · 1 comment · Fixed by #142
Closed

File descriptor leak(?) in 1.0.16 #141

slonopotamus opened this issue May 12, 2024 · 1 comment · Fixed by #142

Comments

@slonopotamus
Copy link
Contributor

This issue summarises current state from multiple sources.

First, #139 was merged without running tests on CI. Retrying tests shows that they do not pass on Windows, even though tests passed before that PR was merged. Tests failures in gepub test suite were somewhat hacked around in #140, but I believe this just tried to hide the issue.

1.0.16 also broke asciidoctor-epub3, so it had to lock gepub to 1.0.15 for now: asciidoctor/asciidoctor-epub3#474

I believe that the reason why file deletion fails on Windows is because file descriptor was not properly closed and is still open by the time deletion attempt happens. On Linux/macOS it is OK to delete opened files, but file descriptor leaks can cause other issues.

@artygus
Copy link
Contributor

artygus commented May 12, 2024

Phew, that's indeed caused by #139, there're two problems here

  1. entry streams were not closed properly
  2. Zip::File.open_buffer writes to provided io in some cases, which is buggy on windows rubyzip/rubyzip@cdef4a5

Sorry for troubles, I sent a PR with the fix to the upstream #142.

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

Successfully merging a pull request may close this issue.

2 participants