Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Feb 2013 20:55:58 +0200
From:      George Liaskos <geo.liaskos@gmail.com>
To:        "J.R. Oldroyd" <fbsd@opal.com>
Cc:        freebsd-chromium@freebsd.org
Subject:   Re: IPC memory leakage on latest chromium-24.0.1312.57
Message-ID:  <CANcjpOBFW6xzjtzx36jn_ADSj5zh0dnedXA68=e_HMtr0_EozA@mail.gmail.com>
In-Reply-To: <20130203122913.6c0cf4e9@shibato>
References:  <CAJuc1zNLC-ESojGq9B5-_7qr6EiwGEwxUojBE9fkU0GybEr6nw@mail.gmail.com> <1563077977.10385807.1359749865202.JavaMail.root@k-state.edu> <CAF6rxgkaqOw_CwikrWOHC26YRHjx8Ade4KORasZn8WzbmYbrVQ@mail.gmail.com> <20130203122913.6c0cf4e9@shibato>

next in thread | previous in thread | raw e-mail | index | archive | help
> I think the problem may be related to
> files/patch-ui__surface__transport_dib_linux.cc which replaces the
> immediate removal of the shm after attaching to it with removal in
> the destructor iff we're the last who is attached to it.
>
> The comment states:
> // On BSD we can't access the shared memory after is marked for
> deletion.
> but this is not true if kern.ipc.shm_allow_removed=1 which we are told
> to set in the pkg-message.

The problem is definitely in this patch, if kern.ipc.shm_allow_removed
is set then the patch is not needed at all.
The issue here is that the sysctl is not set by default and we must /
should support the default configuration.

I don't really know how to solve correctly this issue, TransportDIBs
are created from a static function and the shm keys are cached.
Simply removing the key in the destructor is not correct because there
are other TransportDIB instances which use the same key.

... and even if you handle the removal gracefully, what happens when
the process crashes? More leaks, that's why all other platforms allow
the removal immediately.

Maybe we are correct according to the Posix spec but now i understand
why almost no one follows this specific behavior.


[1] http://src.chromium.org/viewvc/chrome/trunk/src/ui/surface/transport_dib_linux.cc?revision=167669&content-type=text%2Fplain



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANcjpOBFW6xzjtzx36jn_ADSj5zh0dnedXA68=e_HMtr0_EozA>