On Thu, Mar 30, 2006, Claus Assmann wrote:

> application behaves fine.  Hence I'm wondering whether there is a
> memory leak in some library or the OS, which also could be triggered
> by the way my application uses it (see the recent thread about

Thanks to all of you who offered suggestion how to track down this
problem!

Summary: it was a bug in my application that showed up only on
OpenBSD as it is the only OS of those four I tried that use malloc()
in pthread_mutex_init(). There was one place in one of my libraries
where pthread_mutex_destroy() was not called when a struct was
freed that contained a mutex.

Special thanks to Anthony Howe who gave me his debugging malloc
replacement that "intercepts" the libc version, Ted Unangst for
pointing out that OpenBSD uses malloc() for mutexes, and Hannah
Schroeter for explaining her approach to the problem (I added those
write() calls to Anthony's program and wrote a simple awk script
to analyze the output and print those pointers that haven't been
free()d.)

Thanks again to everyone who answered, your help is much appreciated!

Reply via email to