NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Memory leaks in c/pthread libraries

On Thu, May 23, 2024 at 03:09:02PM -0400, Brian Marcotte wrote:
> Since upgrading to NetBSD-10, we've seen memory leaks in several
> daemons which use libpthread:
>     gpg-agent
>     opendmarc
>     dkimpy_milter (python3)
>     syslog-ng (in some cases)
>     mysqld
>     mariadbd
> In most cases, the daemons leak as they are used, but running this
> will show the leak just sitting there:
>   gpg-agent --daemon
> I opened PR#57831 on this issue back in January.
> Has anyone noticed this?

I haven't noticed this in anything I run; but I can replicate your findings
with `gpg-agent --daemon`. ktruss shows it's doing an internal health check,
which requires creating a couple of detached pthreads, seems to wait/post
on a POSIX semaphore, not much else of interest - and leaks ~20KiB per

I couldn't replicate any leaks in some toy code that creates detached
threads and similar ops on a POSIX semaphore; nor could I figure out how
to do any useful jemalloc tracing. I can't figure out what it's doing that's
triggering the leak.

This is on netbsd-10, amd64, btw.

Paul Ripke
"Great minds discuss ideas, average minds discuss events, small minds
 discuss people."
-- Disputed: Often attributed to Eleanor Roosevelt. 1948.

Home | Main Index | Thread Index | Old Index