Age | Commit message (Collapse) | Author | Files | Lines |
|
new symbols in spice-glib, bump before release
|
|
Since 0508f586, errno.h is included above #undef _FORTIFY_SOURCE.
But it must be placed above system headers to take effect
*** longjmp causes uninitialized stack frame ***:
/home/jwhite/xfer/spice/bin/spicy terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ffff48dc2a7]
/lib/x86_64-linux-gnu/libc.so.6(+0xef239)[0x7ffff48dc239]
/lib/x86_64-linux-gnu/libc.so.6(__longjmp_chk+0x33)[0x7ffff48dc1a3]
/home/jwhite/xfer/spice/lib/libspice-client-glib-2.0.so.8(+0x49761)[0x7ffff78f1761]
/home/jwhite/xfer/spice/lib/libspice-client-glib-2.0.so.8(+0x499a4)[0x7ffff78f19a4]
/home/jwhite/xfer/spice/lib/libspice-client-glib-2.0.so.8(+0x1bae7)[0x7ffff78c3ae7]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x135)[0x7ffff505f355]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4a688)[0x7ffff505f688]
/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0x72)[0x7ffff505fa82]
/home/jwhite/xfer/spice/bin/spicy[0x4054aa]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7ffff480bead]
/home/jwhite/xfer/spice/bin/spicy[0x405679]
|
|
There is no guarantee that a stream actually exist when min-latency
change is notified.
Check that there is an actual stream before calling cork(). All callers
where previously checking that stream existed. Add a pre-condition to
verify argument and spot that error is from spice-gtk itself.
Fixes the following crash:
#1 0x0000003c12e34105 in abort () at abort.c:92
#2 0x0000003c2c223180 in pa_stream_is_corked (s=0x0) at
pulse/stream.c:2536
#3 0x0000003c2c648cb7 in stream_cork (pulse=<value optimized out>,
s=0x7fbb38, with_flush=0) at spice-pulse.c:227
#4 0x0000003c2c649989 in playback_min_latency_changed (object=<value
optimized out>, pspec=<value optimized out>, data=0x7fbad0) at
spice-pulse.c:674
https://bugzilla.redhat.com/show_bug.cgi?id=1032785
|
|
When migration completes, unrefing the new connection leads to original
GSocket pending refs, and thus the sockets stay in CLOSE_WAIT.
This is a regression from 8029bd0 where GSocketConnection is kept around
to satisfy old glib.
https://bugzilla.redhat.com/show_bug.cgi?id=1024501
This will also probably fix:
https://bugzilla.redhat.com/show_bug.cgi?id=952375
|
|
Current code works with DIGEST-MD5, but not with PLAIN.
In particular, when using PLAIN, sasl_client_start() returns SASL_OK, which
should not be an error in spite of vague/confusing upstream documentation
about this:
http://asg.andrew.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&msg=10104
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
|
|
Fix wrong warning added in 0704147d.
(lt-spicy:17511):
GSpice-WARNING **: (channel-main.c:415):spice_main_channel_reset:
runtime check failed: (c->agent_connected == FALSE)
|
|
The coroutine entry() return value must be passed via the caller->data,
since coroutine_swap() returns from->data. (this is needed because
coroutine_swap() argument is used both to return from entry() or to send
data to a running coroutine)
When leaving a coroutine, clear its caller.
Return correct coroutine_self() before other coroutine are initialized.
|
|
Use a nicer function, with correct prefix.
Remove extra "context" from function name
|
|
Take an approach similar to gthreads, which are considered as low
level/must work features by glib, which aborts on failures.
|
|
|
|
spice_channel_type_to_string() does not return NULL
|
|
This function has an early return where we fail to unref the 'monitors'
array.
|
|
Send configured max-clipboard size to the agent, after receiving agent
capabilities.
See also spice-protocol patch description:
http://lists.freedesktop.org/archives/spice-devel/2013-November/015254.html
|
|
Introduce a helper function test_agent_cap() to clear the code a
little bit.
|
|
This simplifies the following commit which uses even more
SPICE_MAIN_CHANNEL macro, and makes the code unnecessarily heavy.
|
|
Allow to easily override default max-clipboard value with environment
variable.
|
|
Attempt to send very large clipboard data may easy cause OOM
abort, either in gdk - some patch are proposed to improve the situation,
or in spice-gtk itself.
Let's have a property that blocks unreasonably big clipboard data from
being processed (by default 100mb). Users willing to send larger data
can use the send basic drag-drop send file instead, or tweak the
property value.
|
|
Currently, spice-gtk will look in $HOME/.spicec/spice_truststore.pem
by default for its trust certificate store (to verify the certificates
used during SPICE TLS connections).
However, these days, progress is under-way to have a system-wide
certificate store [1].
In order to use it, we only need to call SSL_CTX_set_default_verify_paths()
and it will automatically use the shared system CA store if the distro
is properly setup.
We only try to use that store if there was no user-provided CA file to use,
or if we failed to load it.
[1] https://fedoraproject.org/wiki/Features/SharedSystemCertificates
|
|
|
|
coroutine_init() can fail, but spice-channel.c was not checking its return
value, which could lead to some crashes if coroutine_init() failed and we
then try to use coroutine_yieldto()
|
|
The coroutine_init function mmap's a stack for the
ucontext coroutine, but nothing ever munmaps it.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
If we fail to mmap the stack, abort the processs rather
than returning an error. This is standard practice in
glib apps, and the caller was not checking the
coroutine_init() return code leading to memory corruption.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
The IN_MAIN_CONTEXT macro checks coroutine_self()->caller against NULL to
decide whether we are in the main context or not. However, this is an
implementation detail of the ucontext coroutine implementation, in the
gthread implementation, coroutine_self()->caller will be non-NULL even in
the main context.
This commit introduces a coroutine_is_main_context() method which each
coroutine backend implements. It turns out it can be implemented the same
way for each backend.
|
|
g_object_notify_main_context() was recently changed to automatically
detect whether we are running in the main context or not, and SpiceSession
is now using g_object_notify_main_context().
In order to achieve that, IN_MAIN_CONTEXT is used, but it's not safe
to be used before coroutine_init() is called. IN_MAIN_CONTEXT expands to
(coroutine_self()->caller == NULL), but coroutine_self() will be NULL when
using gthreads for the coroutine implementation until coroutine_init() has
been called.
Before coroutine_init() has been called, we'll always be running in the
main context, so we can just add a check for coroutine_self() != NULL to
IN_MAIN_CONTEXT to solve that issue.
|
|
When leaving a coroutine, it swaps back to where it came from, not to
the leader/main coroutine.
|
|
|
|
This creates a synchronization point and allows API users to rely on the fact
that they'll always get a UUID notification before all of the channels are
created.
|
|
Modify g_object_notify_main_conetxt() to work whether it's called from the main
context or a coroutine context. Change object notify calls in SpiceSession to
use g_object_notify_main_context() instead of g_object_notify().
|
|
This reverts commit a285e0187d15ad650f6524f3811072fa55b20617.
This API was not actually needed for what I intended to use it for. So revert
for now. We can always add it back if necessary in the future.
Conflicts:
gtk/spice-widget.c
|
|
In theory, zero-ing the surface shouldn't be necessary, as only
invalidated/painted region should be shown. However, this results in
less artifacts on resolution changes (probably some regions are painted,
but with masks, blend, copy etc), in particular on console after VM
reboot.
|
|
|
|
Add defensive g_return[_val]_if_fail(SPICE_IS_DISPLAY()) to all public API
|
|
Add spice_display_get_monitor_config() to get the current configuration of the
display.
|
|
|
|
glib log handler only check for a single 'all' value, mixing it with
other domains name will disable 'all' messages.
|
|
Update map-file and spice-glib-sym-file
|
|
SpiceSeession has a 'uuid' property that is a byte array, but clients often need
the uuid in string format (for writing to disk, etc). Rather than having each
client re-implement this, expose the utility function as public API in
spice-gtk.
|
|
Fix 998529, mono (invert) cursors not visible on a black background, by doing
simple edge detection on the cursor (this is done once when the cursor
is changed and then cached, cursors are 32x32 generally) and thus having
a cursor with contrast on both dark and light backgrounds.
When (if) GDK gets invert cursor support (wayland?) then we can just use
the cursor as is. Until then X doesn't provide any way I see of solving
this otherwise. The end result was tested with the I beam cursor that
the original bug was referring to (run putty on a windows 7 vm) and
looks ok to me.
Moving the core function to spice-util for testing.
|
|
|
|
This is useful in debug messages atm.
|
|
When exiting remote-viewer after authenticating through SASL, I got
this crash:
#0 0x0000000100a51870 in ?? ()
#1 0x000000314d20c53e in _sasl_log (conn=<optimized out>, level=5, fmt=0x7fffe49893e8 "DIGEST-MD5 client mech dispose")
at common.c:1985
#2 0x00007fffe4982d88 in digestmd5_client_mech_dispose (conn_context=0xaf1900, utils=0xaefd10) at digestmd5.c:4580
#3 0x000000314d208654 in client_dispose (pconn=0xaf0710) at client.c:332
#4 0x000000314d20b76b in sasl_dispose (pconn=0xa51898) at common.c:851
#5 0x00007ffff7602dc7 in channel_reset (channel=0xa52250, migrating=0) at spice-channel.c:2493
#6 0x00007ffff760f7b7 in spice_inputs_channel_reset (channel=0xa52250, migrating=0) at channel-inputs.c:615
#7 0x00007ffff76030ac in spice_channel_reset (channel=0xa52250, migrating=0) at spice-channel.c:2551
#8 0x00007ffff76031e0 in channel_disconnect (channel=0xa52250) at spice-channel.c:2570
#9 0x00007ffff760283d in spice_channel_coroutine (data=0xa52250) at spice-channel.c:2368
#10 0x00007ffff763d14b in coroutine_trampoline (cc=0xa51900) at coroutine_ucontext.c:58
#11 0x00007ffff763ce30 in continuation_trampoline (i0=10819840, i1=0) at continuation.c:49
#12 0x00000031342479c0 in ?? () from /lib64/libc.so.6
#13 0x0000000000a51cc8 in ?? ()
#14 0x0000000000000000 in ?? ()
It turns out that the sasl_callback_t data passed when calling
sasl_client_new() must be valid until sasl_dispose() is called. I could not
find mentions of this in the official documentation but
https://mail-archives.apache.org/mod_mbox/subversion-dev/201109.mbox/%3C20110908072256.GN25324@ted.stsp.name%3E
describes what happens.
Making the sasl_callback_t structure static should be enough to guarantee
that the data will stay around long enough.
|
|
When SPICE_DEBUG is set but --spice-debug is not used, we fail
to set G_MESSAGES_DEBUG to the log domain used by spice-gtk, which
causes debug messages not to be printed as one would expect.
|
|
If spice_util_set_debug() gets called before spice_util_get_debug(),
then the value set using spice_util_set_debug() will be overridden
by the result of g_getenv("SPICE_DEBUG") != NULL the first time
spice_util_get_debug() is called.
This causes remote-viewer --spice-debug to not enable debug as
advertised if SPICE_DEBUG is not set.
An alternate fix would have been to set debug_once.status to
G_ONCE_STATUS_READY but then we would lose the thread-safety
guarantees GOnce gives us.
|
|
After the previous commit, spice_channel_switch_protocol() is now
called when needed, but it's not doing anything. What happens is
that spice_channel_switch_protocol() triggers a channel disconnection
and then it queues an idle to reconnect (after having changed the
protocol version to be used).
When spice_channel_recv_link_hdr() returns, we need to jump out of
the coroutine to let the idle trigger and the new channel coroutine
be started. But jumping out of the coroutine will call channel_disconnect()
which calls channel_reset() which disables the idle switch_protocol()
just queued. This causes the connection attempt to be apparently
stuck with nothing happening.
Falling back to the older SPICE protocol is not the only situation
when we need to drop the current connection attempt and reconnect,
we also need to do that when the remote server returns
SPICE_LINK_ERR_NEED_SECURED to let the client know it needs to use
a secure port for this channel. This is handled by the 'switch_tls'
variable set in spice_channel_recv_link_msg and handled in
spice_channel_coroutine().
'switch_tls' does the same thing as spice_channel_switch_protocol(),
except that it calls spice_channel_connect() after channel_disconnect()
has been called, which means the idle queued by channel_connect()
won't get cleared.
This all that commit does, remove the spice_channel_switch_protocol()
method and use the same codepath as 'switch_tls' to handle the
reconnection.
|
|
This partially reverts b19acbc. This commit broke the fallback
to the old protocol as it added a check for c->peer_msg != NULL
before calling switch_protocol(), but mismatch between local
and remote protocol versions is detected before c->peer_msg is
allocated, so:
if (c->peer_msg != NULL && c->link_hdr.major_version != 1) {
SPICE_DEBUG("%s: error, switching to protocol 1 (spice 0.4)",
c->name);
spice_channel_switch_protocol(channel, 1);
return TRUE;
}
will never get triggered when c->peer_hdr.major_version !=
c->link_hdr.major_version
The crash described in b19acbc occurred when calling
spice_channel_recv_link_msg() in spice_channel_coroutine()
after a call to spice_channel_recv_link_hdr() failed and did
not set c->peer_msg.
This commit removes the c>peer_msg check done before calling
spice_channel_switch_protocol() so that it gets called when needed,
but makes sure that we return FALSE to indicate that an error happened
and that we need to reconnect. This way we won't try to call
spice_channel_recv_link_msg() when c->peer_msg is NULL.
|
|
clipboard_get() exits when the clipboard data is received, or when the
agent connection state change. However, if the agent is already
disconnected, neither of those 2 conditions can be reached.
Check if the agent is connected before running loop, exit early if not.
|
|
Use swapped connection to pass data as first argument to signal handler.
|
|
spice_main_channel_reset_agent() reset connected state, and prevent
notify of property change.
This is a minor regression introduced in c3adb24425.
|
|
|
|
palette_get() used to return a ref, and palette_release() used to
release that ref.
Since ed877341, the palette is no longer refcount'ed, since its usage is
exclusively local in common/canvas code.
palette_release() shouldn't remove the palette from the cache.
https://bugzilla.redhat.com/show_bug.cgi?id=1011936
|