[Spice-devel] [PATCH spice-gtk 11/15] display: don't reschedule stream if disconnected from session

Marc-André Lureau marcandre.lureau at redhat.com
Tue Nov 25 05:19:24 PST 2014


Avoid the following critical when a channel is disconnected with a
pending stream (the streams are cleared on channel reset, after
coroutine exit)

  (process:17188): GSpice-CRITICAL **: spice_session_get_mm_time: assertion 'session != NULL' failed

  #0  0x00007ffff71c24e5 in spice_session_get_mm_time (session=0x0) at spice-session.c:1999
  #1  0x00007ffff71d438c in display_stream_schedule (st=0xa33040) at channel-display.c:1014
  #2  0x00007ffff71d4a09 in display_stream_render (st=0xa33040,
      st at entry=<error reading variable: value has been optimized out>) at channel-display.c:1165
  #3  0x0000003e1944a553 in g_timeout_dispatch (source=0xad64e0, callback=<optimized out>, user_data=<optimized out>) at gmain.c:4520
  #4  0x0000003e19449aeb in g_main_context_dispatch (context=0x6a32b0) at gmain.c:3111
  #5  0x0000003e19449aeb in g_main_context_dispatch (context=context at entry=0x6a32b0) at gmain.c:3710
  #6  0x0000003e19449e88 in g_main_context_iterate (context=0x6a32b0, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at gmain.c:3781
  #7  0x0000003e1944a1b2 in g_main_loop_run (loop=0x97e200) at gmain.c:3975
  #8  0x0000003e1c9ebb35 in gtk_main () at gtkmain.c:1207
  #9  0x0000000000430185 in main (argc=1, argv=0x7fffffffdcb8) at virt-viewer-main.c:119
---
 gtk/channel-display.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 940a5a7..17e2f6e 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -1003,15 +1003,16 @@ static void display_handle_stream_create(SpiceChannel *channel, SpiceMsgIn *in)
 /* coroutine or main context */
 static gboolean display_stream_schedule(display_stream *st)
 {
+    SpiceSession *session = spice_channel_get_session(st->channel);
     guint32 time, d;
     SpiceStreamDataHeader *op;
     SpiceMsgIn *in;
 
     SPICE_DEBUG("%s", __FUNCTION__);
-    if (st->timeout)
+    if (st->timeout || !session)
         return TRUE;
 
-    time = spice_session_get_mm_time(spice_channel_get_session(st->channel));
+    time = spice_session_get_mm_time(session);
     in = g_queue_peek_head(st->msgq);
 
     if (in == NULL) {
-- 
2.1.0



More information about the Spice-devel mailing list