[Spice-devel] keyboard and Mouse Fails....

Neal Prager nprager at vbridges.com
Fri Jun 8 07:53:33 PDT 2012


After further investigation we've found the root cause of this problem,
which was last discussed in a February thread.   To recap, the symptom was
that keyboard and mouse input was sometimes not being processed by the X11
spice client when it was invoked with fullscreen=auto-config.

The reason for this behavior was that in the invoking code we were closing
all file descriptors, including 0, 1, and 2, before doing a fork/exec of
the spice client.   As a result the spice client obtained file descriptors
with values 1 and 2 when it created its first event Trigger on start-up.
As a result any output to stderr was then written to the ProcessLoop
trigger's pipe, with disastrous results.   (As the Trigger class is written
to never expect more than one byte to be written into the pipe, an event
storm on fd 1 occured, effectively starving all other input - including X
Windows mouse and keyboard - from the select loop of
EventSources::wait_events.)

We've fixed the problem locally by changing our invocation of spicec to
leave the stdio file descriptors open.   However, in the interest of
defensive programming I'd suggest that the spice client do some kind of
check on the stderr file descriptor before logging anything to that stream
- this could be done in Application::init_logger() and enforced in
Application::spice_log().

thanks
Neal Prager
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120608/bf851f03/attachment.htm>


More information about the Spice-devel mailing list