<div dir="ltr"><div>i almost hit the bug when i connect to a vm : <a href="https://bugzilla.redhat.com/show_bug.cgi?id=997772">https://bugzilla.redhat.com/show_bug.cgi?id=997772</a></div><div><br></div><div>the log is nearly same</div>
<div>-----------------------------------------</div><div>((null):13420): SpiceWorker-Warning **: red_worker.c:1312:validate_surface: [01-20 08:51:02]canvas address is 0x7f0560000bc8 for 0 (and is NULL)</div><div><br></div>
<div>((null):13420): SpiceWorker-Warning **: red_worker.c:1313:validate_surface: [01-20 08:51:02]failed on 0</div><div>((null):13420): SpiceWorker-Warning **: red_worker.c:1314:validate_surface: [01-20 08:51:02]condition `!worker->surfaces[surface_id].context.canvas' reached</div>
<div>((null):13420): SpiceWorker-Warning **: red_worker.c:160:rendering_incorrect: [01-20 08:51:02]rendering incorrect from now on: handle_dev_update_async</div><div>---------------------------------------------------------------------</div>
<div><br></div><div>as the result client connects, only get black blank screen,  </div><div><br></div><div>i watch the stack,  the main thread didn't accept the connection and was blocked on "read" function (maybe in red_dispatcher_display_channel_create) ,  </div>
<div><br></div><div>and red_worker thread looks like in a dead loop, consumes 100% cpu, sometimes gdb attach it call qxl's interface_req_cmd_notification</div><div><br></div><div>so i guess the loop was in <red_process_commands>:</div>
<div>=======================================================</div><div>................</div><div>    while (!display_is_connected(worker) ||                                                                   ////Q1</div><div>
           // TODO: change to average pipe size?</div><div>           red_channel_min_pipe_size(&worker->display_channel->common.base) <= max_pipe_size) {</div><div>        if (!worker->qxl->st->qif->get_command(worker->qxl, &ext_cmd)) {</div>
<div>            *ring_is_empty = TRUE;;</div><div>            if (worker->repoll_cmd_ring < CMD_RING_POLL_RETRIES) {                                           ////Q2</div><div>                worker->repoll_cmd_ring++;</div>
<div>                worker->event_timeout = MIN(worker->event_timeout, CMD_RING_POLL_TIMEOUT);</div><div>                break;</div><div>            }</div><div>            if (worker->repoll_cmd_ring > CMD_RING_POLL_RETRIES ||</div>
<div>                         worker->qxl->st->qif->req_cmd_notification(worker->qxl)) {                         ////Q3</div><div>                worker->repoll_cmd_ring++;</div><div>                break;</div>
<div>            }</div><div>            continue;                                                                                      //// dead loop ?</div><div>        }</div><div>        stat_inc_counter(worker->command_counter, 1);</div>
<div>        worker->repoll_cmd_ring = 0;</div><div>        switch (ext_cmd.cmd.type) {</div><div>        case QXL_CMD_DRAW: {</div><div>.......................................</div><div>======================================================</div>
<div><br></div><div>i can not understand the code fully,  some questions?</div><div>Q1).  why  the loop begin with display NOT connect?</div><div>Q2).  when qif->get_command get false,  and repoll_cmd_ring==CMD_RING_POLL_RETRIES, req_cmd_notification get false,   dead loop ?</div>
<div>Q3).  req_cmd_notification  function hits only when repoll_cmd_ring==CMD_RING_POLL_RETRIES,  does it meet the design ?</div><div><br></div><div><br></div><div>thx all very much !</div><div><br></div></div>