[Spice-devel] [PATCH spice-gtk v2] vmcstream: set the right result for the task

Christophe Fergeau cfergeau at redhat.com
Wed Jul 27 13:59:18 UTC 2016


On Wed, Jul 27, 2016 at 03:31:10PM +0200, Fabiano FidĂȘncio wrote:
> >> diff --git a/src/vmcstream.c b/src/vmcstream.c
> >> index c536f71..32d8b5e 100644
> >> --- a/src/vmcstream.c
> >> +++ b/src/vmcstream.c
> >> @@ -399,9 +399,13 @@ spice_vmc_output_stream_write_finish(GOutputStream *stream,
> >>  {
> >>      SpiceVmcOutputStream *self = SPICE_VMC_OUTPUT_STREAM(stream);
> >>      GAsyncResult *res = g_task_propagate_pointer(G_TASK(simple), error);
> >> +    gssize bytes_written;
> >>
> >>      SPICE_DEBUG("spicevmc write finish");
> >> -    return spice_vmc_write_finish(self->channel, res, error);
> >> +    bytes_written = spice_vmc_write_finish(self->channel, res, error);
> >> +    g_object_unref(res);
> >> +
> >> +    return bytes_written;
> >>  }
> >>
> >>  static void
> >>
> >>
> >> (but this is arguably a slightly different bug which was already existing
> >> before your change).
> >
> > Feel free to squash my patch into your change or push both separately.
> 
> Hmm. With your patch I can see the following critical
> (remote-viewer:18180): GSpice-CRITICAL **:
> spice_vmc_input_stream_read_all_async: assertion 'self->task == NULL'
> failed

I'm quite confused here, my patch is changing
spice_vmc_output_stream_write_finish() and the assert is in
spice_vmc_input_stream_read_all_async(), is this corrupting memory?
And I don't see how not leaking memory should affect self->task being
NULL/concurrent reads on an input stream??

> So, please, let's go for my patch and then we can get back to your
> changes later on.

If you want, but there's something odd/fishy going on, is this easy to
trigger in remote-viewer?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160727/fc6a9fb0/attachment.sig>


More information about the Spice-devel mailing list