[pulseaudio-discuss] Memory oddities in module-dbus-protocol
Tanu Kaskinen
tanu.kaskinen at digia.com
Thu Jan 26 04:08:06 PST 2012
On Thu, 2012-01-26 at 12:35 +0100, David Henningsson wrote:
> I'm trying to trace down a memory error in module-dbus-protocol, but I
> am confused.
>
> Either you use synchronous hooks, and then you can reference the
> original core objects, or you use asynchronous subscription events, in
> which case the pointers can become dangling at any time, so you can't
> point into the core and have to make memory copies of *everything*. Right?
Make copies, or check if the objects are still in the core before
referencing them. I tried to make those checks where needed, but
apparently I failed at that.
> The card is handled by subscription events, and I get memory errors on
> quit [1] due to it referencing the profile's name as a hash key (!). But
> while investigating I also saw pa_dbusiface_card_profile objects having
> a pointer to the profile, which is disturbing.
>
> If this is the only place where things are broken, I can fix it. But if
> the same logic faults apply to all over the dbus protocol module, that
> makes me quite uneasy with shipping it in a stable distribution,
> especially as I don't know any consumer that makes use of this information.
Now that you've pointed out this issue, I don't trust the code at all
anymore. The only sane way forward is to convert all code in the dbus
module to use hooks instead of the subscription system.
I volunteer to do that work.
--
Tanu
More information about the pulseaudio-discuss
mailing list