[virt-tools-list] [virt-viewer 2/2] session: Don't hold VirtViewerDisplay refs on channel destroy

Marc-André Lureau mlureau at redhat.com
Wed Nov 20 09:40:05 UTC 2013


ack, thanks for the detailed explanation

----- Original Message -----
> On Tue, Nov 19, 2013 at 04:19:25PM -0500, Marc-André Lureau wrote:
> > 
> > 
> > ----- Original Message -----
> > > VirtViewerSessionSpice creates a reference-holding VirtViewerDisplay
> > > array and associates it with the display SpiceChannel with
> > > g_object_set_data(channel, "virt-viewer-displays").
> > > 
> > > When virt_viewer_session_spice_channel_destroy() is called and the
> > > display
> > > channel is being destroyed, we should ensure these VirtViewerDisplay
> > > references are dropped or the displays could outlive the session.
> > 
> > Should't it unref when the channel is disposed?
> 
> The backtrace below triggers during spice_channel_display_dispose (frame
> #31), we start disposing the display channel, the session gets destroyed,
> but the VirtViewerDisplaySpice are still alive through that
> SpiceChannel:virt-viewer-displays array. and then some VirtViewerDisplaySpice
> code runs and tries to use the VirtViewerSession that was just disposed.
> After spice_channel_display_dispose() finishes running, the gobject data
> 'virt-viewer-displays' will get freed, and the VirtViewerDisplay will be
> disposed of (that is, if we did not crash when trying to use the session).
> 
> By setting virt-viewer-displays to NULL in this patch, we make sure the
> VirtViewerDisplay are freed at the same time as the VirtViewerSessionSpice.
> It makes to do it here as the 'virt-viewer-displays' data is associated
> with the display channel in VirtViewerSessionSpice.
> 
> Christophe
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list




More information about the virt-tools-list mailing list