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

Fix mmap error when reading empty file during resume check on Linux #7808

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

Doekin
Copy link
Contributor

@Doekin Doekin commented Dec 9, 2024

This PR fixes #7790, where calling mmap() with length = 0 on Linux causes an -EINVAL error during the resume check process.

@arvidn
Copy link
Owner

arvidn commented Dec 10, 2024

There are tests with torrents that have 0-size files. Is this issue specifically when files that (when completed) are not 0-sized, but happens to have 0-size on disk during checking?

We would need an automated test to trigger this as well

@arvidn arvidn added this to the 2.0.11 milestone Dec 10, 2024
@Doekin
Copy link
Contributor Author

Doekin commented Dec 10, 2024

Exactly, you got it right.

@Doekin
Copy link
Contributor Author

Doekin commented Dec 10, 2024

I added larger files to test_checking. The test fails as expected without the mmap patch, and passes once the patch is applied.

@arvidn arvidn merged commit 8aed49e into arvidn:RC_2_0 Jan 20, 2025
4 checks passed
@arvidn
Copy link
Owner

arvidn commented Jan 20, 2025

sorry for the delay. thanks!

@Doekin
Copy link
Contributor Author

Doekin commented Jan 21, 2025

No problem, thanks for reviewing and merging!

@arvidn
Copy link
Owner

arvidn commented Jan 23, 2025

Windows seemed to have a similar issue (at least in CI), addressed by this follow-up commit: e7ac22e

@Doekin
Copy link
Contributor Author

Doekin commented Jan 23, 2025

Appreciate you stepping in to handle the Windows side

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 this pull request may close these issues.

force recheck with zero byte files gives mmap error
2 participants