Go to file
Hans de Goede d2e1f939fe server: Fix SpiceWorker-CRITICAL **: red_worker.c:10968:red_push_monitors_config: condition `monitors_config != NULL' failed
During my dynamic monitor support testing today, I hit the following assert
in red_worker.c:
"red_push_monitors_config: condition `monitors_config != NULL' failed"

This is caused by the following scenario:
1) Guest causes handle_dev_monitors_config_async() to be called
2) handle_dev_monitors_config_async() calls worker_update_monitors_config()
3) handle_dev_monitors_config_async() pushes worker->monitors_config, this
   takes a ref on the current monitors_config
4) Guest causes handle_dev_monitors_config_async() to be called *again*
5) handle_dev_monitors_config_async() calls worker_update_monitors_config()
6) worker_update_monitors_config() does a decref on worker->monitors_config,
   releasing the workers reference, this monitor_config from step 2 is
   not yet free-ed though as the pipe-item still holds a ref
7) worker_update_monitors_config() creates a new monitors_config with an
   initial ref-count of 1 and stores that in worker->monitors_config
8) The pipe-item of the *first* monitors_config is send, upon completion
   a decref is done on the monitors_config, and monitors_config_decref not
   only frees the monitor_config, but *also* sets worker->monitors_config
   to NULL, even though worker->monitors_config no longer refers to the
   monitor_config being freed, it refers to the 2nd monitor_config!
9) The client which was connected when this all happened disconnects
10) A new client connects, leading to the assert:
    at red_worker.c:9519
    num_common_caps=1, common_caps=0x5555569b6f60, migrate=0,
    stream=<optimized out>, client=<optimized out>, worker=<optimized out>)
    at red_worker.c:10423
    at red_worker.c:11301

Note that red_worker.c:9519 is:
        red_push_monitors_config(dcc);
gdb does not point to the actual line of the assert because the function gets
inlined.

The fix is easy and obvious, don't set worker->monitors_config to NULL in
monitors_config_decref. I'm a bit baffled as to why that code is there in
the first place, the whole point of ref-counting is to not have one single
unique place to store the reference...

This fix should not have any adverse side-effects as the 4 callers of
monitors_config_decref fall into 2 categories:
1) Code which immediately after the decref replaces worker->monitors_config
   with a new monitors_config:
   worker_update_monitors_config()
   set_monitors_config_to_primary()
2) pipe-item freeing code, which should not touch the worker state at all
   to being with

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-01-15 14:30:59 +01:00
build-aux add git-version-gen and gitlog-to-changelog 2012-10-19 14:15:06 +02:00
client spice-client: Add --hotkeys cmdline option 2012-12-19 15:07:09 +01:00
docs docs/Spice_for_newbies.odt: some updates - added copy paste and wan mention, removed vdi_port 2012-01-22 15:13:32 +02:00
m4 m4/spice-compile-warnings: Squelch _FORTIFY_SOURCE when needed to avoid glibc #warnings. 2012-06-06 17:32:02 +03:00
server server: Fix SpiceWorker-CRITICAL **: red_worker.c:10968:red_push_monitors_config: condition `monitors_config != NULL' failed 2013-01-15 14:30:59 +01:00
spice-common@b46d36bc1c update spice-common 2012-12-05 11:46:27 +01:00
tests tests/migrate.py: add --vdagent 2011-08-23 17:01:14 +03:00
tools Add casts for compatibility purposes 2012-02-14 10:44:49 +02:00
uncrustify_cfg fresh start 2009-10-14 15:06:41 +02:00
.gitignore add git-version-gen and gitlog-to-changelog 2012-10-19 14:15:06 +02:00
.gitmodules Use the spice-common submodule 2012-03-25 18:59:10 +02:00
.mailmap Add recent new committers to AUTHORS file / mailmap 2012-04-25 09:49:29 +01:00
AUTHORS Add recent new committers to AUTHORS file / mailmap 2012-04-25 09:49:29 +01:00
autogen.sh Use the spice-common submodule 2012-03-25 18:59:10 +02:00
cfg.mk Add a few more syntax-check exemptions 2012-04-25 09:49:32 +01:00
ChangeLog fresh start 2009-10-14 15:06:41 +02:00
configure.ac build: Use glib2 2012-12-12 18:15:48 +01:00
COPYING Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
GITVERSION Add --enable-werror and make it the default only for git builds 2010-07-09 12:14:32 +02:00
GNUmakefile Add a 'syntax-check' make target 2012-01-13 18:12:00 +02:00
maint.mk Add a 'syntax-check' make target 2012-01-13 18:12:00 +02:00
Makefile.am add git-version-gen and gitlog-to-changelog 2012-10-19 14:15:06 +02:00
NEWS Release 0.12.2 2012-12-20 20:39:54 +01:00
README README: make a note of SPICE_DEBUG_ALLOW_MC 2012-02-15 14:32:11 +02:00
spice-server.pc.in spice-server.pc.in: move Requires to Requires.private 2011-10-23 11:26:30 +02:00
TODO.multiclient Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00

   SPICE: Simple Protocol for Independent Computing Environments
   =============================================================

SPICE is a remote display system built for virtual environments which
allows you to view a computing 'desktop' environment not only on the
machine where it is running, but from anywhere on the Internet and
from a wide variety of machine architectures.

Installation
------------

The SPICE package uses GNU autotools, so the build install process
follows the standard process documented in the INSTALL file. As a
quick start you can do

  ./configure --prefix=/usr --sysconfdir=/etc \
        --localstatedir=/var --libdir=/usr/lib
  make
  sudo make install

Or to install into a private user specific location

  ./configure --prefix=$HOME/spice
  make
  make install

The following mandatory dependancies are required in order to
build SPICE

    Spice protocol >= 0.9.0
    Celt           >= 0.5.1.1, < 0.6.0
    Pixman         >= 0.17.7
    OpenSSL
    libjpeg
    zlib
    Cyrus-SASL

The following optional dependancies increase the available
functionality

    GE Gui         >= 0.6.0,  < 0.7.0   (GUI app support)
    OpenGL                              (GUI app support)
    Alsa                                (Linux support)
    XRandR         >= 1.2               (X11 support)
    Xinerama       >= 1.0               (X11 support)
    libcacard      >= 0.1.2             (Smartcard support)
    Slirp                               (Tunnelling support)

Communication
-------------

To communicate with the development team, or to post patches
there is a technical mailing list:

   http://lists.freedesktop.org/mailman/listinfo/spice-devel

There is also a mailing list for new release announcements:

   http://lists.freedesktop.org/archives/spice-announce/

To view known bugs, or report new bugs, in SPICE visit

   https://bugs.freedesktop.org/describecomponents.cgi?product=Spice

Bugs found when using an OS distribution's binary packages should
be reported to the OS vendors' own bug tracker first.

The latest SPICE code can be found in GIT at:

   http://cgit.freedesktop.org/spice/

Licensing
---------

SPICE is provided under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

Please see the COPYING file for the complete LGPLv2+ license
terms, or visit <http://www.gnu.org/licenses/>.

Experimental Features
---------------------
To enable multiple client connections, set:
SPICE_DEBUG_ALLOW_MC=1

-- End of readme