Bug 215551

Summary: libpsx memory leak
Product: Tools Reporter: Andrew G. Morgan (morgan)
Component: libcapAssignee: Andrew G. Morgan (morgan)
Status: RESOLVED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: n/a Subsystem:
Regression: No Bisected commit-id:
Attachments: Memory leak fix for libpsx.

Description Andrew G. Morgan 2022-01-30 21:09:21 UTC
Created attachment 300355 [details]
Memory leak fix for libpsx.

Kalen Hall has reported a Valgrind detected memory leak associated with a multi-threaded program linked against libcap and libpsx. Kalen has provided the attached patch to resolve it.

I'm filing this bug to track committing this fix. I first want to confirm that in-flight PSX interrupts don't trip over this in some subtle way.
Comment 1 Andrew G. Morgan 2022-02-06 01:38:34 UTC
This should be fixed with:

https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=66a8a1421e4520e9dda0a46704e25bafb989b1ae

Will include it in libcap-2.64 (which will be the next release, likely within a month).
Comment 2 Andrew G. Morgan 2022-04-10 22:41:43 UTC
It looks like this wasn't a complete fix after all. When running `make test` in the build tree, I see `libcap_psx_test` processes hanging around.
Comment 3 Andrew G. Morgan 2022-04-11 00:05:04 UTC
I'm hopeful this fixes that problem:

https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=7617af6b0754da00c1094215ee7828d6592f8ade

It eliminated the unexited `libcap_psx_test` binaries in my many subsequent test runs.

This is included in libcap-2.64. That release happened today.