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

pkg/uzlib: warn about memory leak during compression #20293

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

mguetschow
Copy link
Contributor

@mguetschow mguetschow commented Jan 24, 2024

Contribution description

uzlib (zlib-compatible compression/decompression) contains a memory leak during compression. Add a warning to the documentation until the issue is resolved upstream, see pfalcon/uzlib#41 (comment)

@github-actions github-actions bot added Area: doc Area: Documentation Area: pkg Area: External package ports labels Jan 24, 2024
@mguetschow mguetschow requested review from benpicco and maribu January 24, 2024 12:20
@Teufelchen1 Teufelchen1 enabled auto-merge January 24, 2024 15:58
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Jan 24, 2024
@riot-ci
Copy link

riot-ci commented Jan 24, 2024

Murdock results

✔️ PASSED

a9e0a0d pkg/uzlib: warn about memory leak during compression

Success Failures Total Runtime
1 0 1 59s

Artifacts

@Teufelchen1 Teufelchen1 added this pull request to the merge queue Jan 24, 2024
Merged via the queue into RIOT-OS:master with commit de89843 Jan 24, 2024
28 checks passed
@mguetschow mguetschow deleted the uzlib-warning branch January 25, 2024 10:09
@@ -4,6 +4,10 @@
* @ingroup sys_compression
* @brief Deflate/Zlib-compatible LZ77 compression/decompression library
*
* @warning During compression, uzlib allocates memory on the heap without freeing it.
* Do not use this package in production code!
* See https://github.com/pfalcon/uzlib/issues/41#issuecomment-1907807048
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds a lot scarier than it is, AFAIU the API is just a bit bad in that it allocates the memory on it's own and int a bit of an opaque location, but it's the outbuf that then contains the result of the compression.

So it should be enough if we free free(comp.out.outbuf) once we are done with it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and it should be possible to fix this with a simple git patch or upstream PR.

@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants