I don't think this is a proper fix as it would break the proper
refcounting on Linux systems. I have tested conn_info_destroy pretty
extensively on Linux and it works well. Could you explain your test
case? This may be a bsd-ism that we need to work around.
Regards
-steve
On Wed, 2009-04-15 at 16:02 +0200, Jérôme Flesch wrote:
> Hi,
>
> Here is a patch to fix a shared memory leak in WhiteTank when used on
> FreeBSD systems.
>
> The problem was that the connection ref counter wasn't decremented as it
> should when a client disconnected (see patch) and so the shared memory
> segment was never destroyed by ipc.c:conn_info_destroy().
> plain text document attachment (whitetank-fix-ipc-shm-leak.patch)
> diff -ru openais-whitetank-9-old/exec/ipc.c openais-whitetank-9/exec/ipc.c
> --- exec/ipc.c 2009-04-15 15:08:23.000000000 +0200
> +++ exec/ipc.c 2009-04-15 15:09:54.000000000 +0200
> @@ -630,7 +630,6 @@
> res = 0;
> break;
> }
> - openais_conn_refcount_dec (conn_info);
> }
> #if defined(OPENAIS_SOLARIS) || defined(OPENAIS_BSD) ||
> defined(OPENAIS_DARWIN)
> /* On many OS poll never return POLLHUP or POLLERR.
> @@ -638,9 +637,11 @@
> */
> if (res == 0) {
> ipc_disconnect (conn_info);
> + openais_conn_refcount_dec (conn_info);
> return (0);
> }
> #endif
> + openais_conn_refcount_dec (conn_info);
> }
>
> openais_conn_refcount_inc (conn_info);
> _______________________________________________
> Openais mailing list
> [email protected]
> https://lists.linux-foundation.org/mailman/listinfo/openais
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais