Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#79585 - [python-pycosat] version 0.6.4 leaks memory (patch attached)

Attached to Project: Arch Linux
Opened by Maks Verver (maksverver) - Tuesday, 05 September 2023, 21:02 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 06 September 2023, 18:35 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

pycosat-0.6.4 still contains the memory leak that it was supposed to fix.

I reported the bug upstream here: https://github.com/conda/pycosat/issues/70

But the project doesn't look very actively maintained, considering that there is an issue about a new release open since Nov 4, 2022: https://github.com/conda/pycosat/issues/57

So maybe you can just add a patch to Arch package instead.

I've attached a patch to pycosat.c, which was produced with `git diff 0.6.4 HEAD pycosat.c`.

I've tested the patch locally. Seems to fix the memory leak and doesn't seem to have any other effects.
This task depends upon

Closed by  Antonio Rojas (arojas)
Wednesday, 06 September 2023, 18:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-pycosat 0.6.4-3
Comment by loqs (loqs) - Tuesday, 05 September 2023, 22:52 GMT
What pycosat.c.diff did you use? The one I just generated (attached) does not compile as [1] changes PyMem_Malloc to PyMem_Calloc without adding PyMem_Calloc's second argument [2].
On this system HEAD of main is at 401bc68a8fe6695fe43503e2315be84bd7cefae6 and cebd3a917ac76d966ad459e4939bcbb15842ac6c is tagged as both v0.6.4 and 0.6.4.
[1] https://github.com/conda/pycosat/commit/1593815c8c8c790d3fbde60808bc502d05fba7c7
[2] https://docs.python.org/3/c-api/memory.html#memory-interface
Comment by loqs (loqs) - Tuesday, 05 September 2023, 23:07 GMT
Skipping the last commit produced a diff with the checksum you were using. So to make the command reproducible use commits for the range `git diff --patience cebd3a917ac76d966ad459e4939bcbb15842ac6c 4145cc7348a1432f6672b90e713abc1c9414f79d pycosat.c`
Which I believe should be the same as applying these three commits:
https://github.com/conda/pycosat/commit/52ae2b6c7d427587ad66900d617ce915fe856246
https://github.com/conda/pycosat/commit/c2ea9b492610d161c8a8e582fe41c88dd866c694
https://github.com/conda/pycosat/commit/7ee1cd60a86174b39a163ce2a1c48ecff82a36fb

Loading...