<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.1">
</HEAD>
<BODY>
Hi,<BR>
<BR>
I build the spice from git, and do some test. I find one issue when I playing video in windows xp(sp2), here's the steps to reproduce:<BR>
1.use KMPlayer to play a video,wait for some time,the spice server will be stuck;<BR>
2.use &quot;top&quot; command to watch qemu process, find the process's cpu usage rate is 100%;<BR>
<BR>
So, I use gdb to see what happened, I found why it stucks,<BR>
<BR>
static void fill_cursor(CursorChannel *cursor_channel, SpiceCursor *red_cursor, CursorItem *cursor)<BR>
{<BR>
&nbsp;&nbsp;&nbsp; RedChannel *channel = &amp;cursor_channel-&gt;base;<BR>
<BR>
&nbsp;&nbsp;&nbsp; if (!cursor) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; red_cursor-&gt;flags = SPICE_CURSOR_FLAGS_NONE;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>
&nbsp;&nbsp;&nbsp; }<BR>
<BR>
&nbsp;&nbsp;&nbsp; if (cursor-&gt;type == CURSOR_TYPE_DEV) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QXLCursorCmd *cursor_cmd;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QXLCursor *qxl_cursor;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cursor_cmd = cursor-&gt;qxl_cursor;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qxl_cursor = (QXLCursor *)get_virt(&amp;channel-&gt;worker-&gt;mem_slots, cursor_cmd-&gt;u.set.shape,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sizeof(QXLCursor), cursor-&gt;group_id);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; red_cursor-&gt;flags = 0;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; red_cursor-&gt;header = qxl_cursor-&gt;header;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (red_cursor-&gt;header.unique) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (red_cursor_cache_find(cursor_channel, red_cursor-&gt;header.unique)) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; red_cursor-&gt;flags |= SPICE_CURSOR_FLAGS_FROM_CACHE;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (red_cursor_cache_add(cursor_channel, red_cursor-&gt;header.unique, 1)) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; red_cursor-&gt;flags |= SPICE_CURSOR_FLAGS_CACHE_ME;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (qxl_cursor-&gt;data_size) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT COLOR="#ff0000">// QXLDataChunk *chunk = (QXLDataChunk *)&amp;qxl_cursor-&gt;chunk;</FONT><BR>
<FONT COLOR="#ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // chunk-&gt;data_size is different from qxl_cursor-&gt;data_size, here is why spice server stuck,</FONT><BR>
<FONT COLOR="#ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // in my case,qxl_cursor-&gt;data_size is 4224, chunk-&gt;data_size is 128, so in red_send_data() function, it enters infinite loop.</FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add_buf(channel, BUF_TYPE_CHUNK, &amp;qxl_cursor-&gt;chunk, qxl_cursor-&gt;data_size,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get_memslot_id(&amp;channel-&gt;worker-&gt;mem_slots, cursor_cmd-&gt;u.set.shape), cursor-&gt;group_id);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp; } else {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LocalCursor *local_cursor;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASSERT(cursor-&gt;type == CURSOR_TYPE_LOCAL);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local_cursor = (LocalCursor *)cursor;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *red_cursor = local_cursor-&gt;red_cursor;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add_buf(channel, BUF_TYPE_RAW, local_cursor-&gt;red_cursor.data, local_cursor-&gt;data_size, 0,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0);<BR>
&nbsp;&nbsp;&nbsp; }<BR>
}<BR>
<BR>
Welcome for giving some comments.<BR>
<BR>
Best Regards,<BR>
Coolper
</BODY>
</HTML>