[pulseaudio-discuss] [PATCH] bluetooth: Free backends before devices and adapters.
tanuk at iki.fi
Mon Jul 2 14:40:40 UTC 2018
On Sun, 2018-07-01 at 21:47 +0300, Juho Hämäläinen wrote:
> On [ pe 29.06.18 18:54 ], Tanu Kaskinen wrote:
> > On Thu, 2018-06-28 at 14:58 +0300, Juho Hämäläinen wrote:
> > > When bluetooth daemon disappears gracefully transports are freed before
> > > the daemon disappears from DBus bus. However if bluetooth daemon
> > > segfaults or is killed abruptly the daemon disappears from the bus
> > > before PulseAudio is able to clean the transports. As the devices
> > > and adapters are freed before ofono or native backends, PulseAudio
> > > segfaults when dangling pointers are used when freeing the backends.
> > > Fix by freeing the backends before devices and adapters when bluetooth
> > > daemon disappears from DBus bus.
> > >
> > > Signed-off-by: Juho Hämäläinen <jusa at hilvi.org>
> > > ---
> > > src/modules/bluetooth/bluez5-util.c | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
> > I suppose it's the hf_audio_card.transport pointers that are dangling?
> > Rather than having unobvious ordering requirements, it would seem
> > better to me to notify the backends when the transports are freed so
> > that they can drop their references. There's already the destroy()
> > callback that could be used for this. What do you think?
> I was thinking the same, using destroy() callback with hf_audio_card,
> but as it is more or less reasonable to free the transports before the
> devices etc, I went with the simpler reordering instead. I can make new
> patch with the destroy() callback as well.
Thanks, I would prefer a new patch.
More information about the pulseaudio-discuss