Skip to content
New issue

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

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

Already on GitHub? # to your account

WebP Encoder Memory Leak #1957

Closed
mseele opened this issue Jul 10, 2023 · 5 comments
Closed

WebP Encoder Memory Leak #1957

mseele opened this issue Jul 10, 2023 · 5 comments

Comments

@mseele
Copy link

mseele commented Jul 10, 2023

The latest version of https://github.com/jaredforth/webp seems to have an memory leak on decoding: jaredforth/webp#27

Maybe it makes sense to fix the version of https://github.com/NoXF/libwebp-sys to 0.2.2 to avoid the memory leak (NoXF/libwebp-sys#20)!?

@fintelia
Copy link
Contributor

I don't think there's anything this crate actually needs to do? When webp or libwebp-sys figure out what's wrong and publish a new version, we'll pull it in automatically (assuming the changes are semver compatible, and I don't see why they wouldn't be)

@mseele
Copy link
Author

mseele commented Jul 11, 2023

@fintelia Fair enough. My point was that the memory leak was introduced via a semver-compatible version, which means that all new installs or upgrades of the image crate will get the memory leak, which I thought should be avoided.

@oldmanfleming
Copy link

@fintelia

Just following up on this one. It seems there has been a series of patch versions released for the webp crate that indicate various memory leak fixes:

version 0.2.5:

version 0.2.4

version 0.2.3:

I'm wondering if its possible to bump image's webp dependency version to make these fixes available?

@fintelia
Copy link
Contributor

fintelia commented Aug 7, 2023

You should actually get the patched versions automatically if you run cargo update. In a Cargo.toml file, version = "0.2.2" actually means the same thing as version = "^0.2.2", i.e. any version "0.2.x" where x>=2.

@oldmanfleming
Copy link

oldmanfleming commented Aug 7, 2023

Ah thanks so much for the quick response! I'm new to the Rust ecosystem and didn't realize thats how the versioning worked. I just wen't into my cargo.lock and indeed confirmed I'm on webp 0.2.4. I ran cargo update and got bumped to 0.2.5. I'll do some testing and see if my observed memory leak issues are resolved with their latest patch.

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

No branches or pull requests

3 participants