<p dir="ltr"><br>
On May 14, 2016 17:29, "Victor Toso" <<a href="mailto:victortoso@redhat.com">victortoso@redhat.com</a>> wrote:<br>
><br>
> We are checking self->priv->error but accessing the argument GError *<br>
> which is NULL and leads to a segfault.<br>
><br>
> Program received signal SIGSEGV, Segmentation fault.<br>
> spice_file_transfer_task_completed (self=self@entry=0x7fffd0006f00, error=0x0) at channel-main.c:2963<br>
> 2963 VDAgentFileXferStatusMessage msg = {<br>
> (gdb) bt<br>
> #0 spice_file_transfer_task_completed (self=self@entry=0x7fffd0006f00, error=0x0) at channel-main.c:2963<br>
> #1 in file_xfer_data_flushed_cb (source_object=0x7cc1d0, res=0x953390, user_data=user_data@entry=0x7fffd0006f00) at channel-main.c:1857<br>
> #2 in g_task_return_now (task=0x953390) at gtask.c:1108<br>
> #3 in g_task_return (task=0x953390, type=<optimized out>) at gtask.c:1166<br>
> #4 in flush_foreach_remove (key=<optimized out>, value=<optimized out>, user_data=<optimized out>) at channel-main.c:928<br>
> #5 in g_hash_table_foreach_remove_or_steal (hash_table=0x70cea0, func=func@entry=0x7ffff5616f10 <flush_foreach_remove>, user_data=user_data@entry=0x0, notify=notify@entry=1) at ghash.c:1492<br>
> #6 in g_hash_table_foreach_remove (hash_table=<optimized out>, func=func@entry=0x7ffff5616f10 <flush_foreach_remove>, user_data=user_data@entry=0x0) at ghash.c:1538<br>
> #7 in file_xfer_flushed (success=0, channel=0x7cc1d0) at channel-main.c:936<br>
> #8 spice_main_channel_reset_agent (channel=0x7cc1d0) at channel-main.c:466<br>
> #9 set_agent_connected (channel=0x7cc1d0, connected=connected@entry=0) at channel-main.c:1572<br>
> #10 in spice_main_channel_reset (channel=0x7cc1d0, migrating=0) at channel-main.c:485<br>
> #11 in spice_channel_coroutine (data=0x7cc1d0) at spice-channel.c:2564<br>
> #12 in coroutine_trampoline (cc=0x7cb860) at coroutine_ucontext.c:63<br>
> #13 in continuation_trampoline (i0=<optimized out>, i1=<optimized out>) at continuation.c:55<br>
> #14 in ?? () from /lib64/libc.so.6<br>
> #15 in ?? ()<br>
> #16 in ?? ()<br>
> Backtrace stopped: Cannot access memory at address<br>
> ---<br>
> src/channel-main.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/src/channel-main.c b/src/channel-main.c<br>
> index 2905d7b..692cfe7 100644<br>
> --- a/src/channel-main.c<br>
> +++ b/src/channel-main.c<br>
> @@ -2964,7 +2964,7 @@ static void spice_file_transfer_task_completed(SpiceFileTransferTask *self,<br>
> if (self->priv->error) {<br>
> VDAgentFileXferStatusMessage msg = {<br>
> .id = self->priv->id,<br>
> - .result = error->code == G_IO_ERROR_CANCELLED ?<br>
> + .result = self->priv->error->code == G_IO_ERROR_CANCELLED ?<br>
> VD_AGENT_FILE_XFER_STATUS_CANCELLED : VD_AGENT_FILE_XFER_STATUS_ERROR,<br>
> };<br>
> agent_msg_queue_many(self->priv->channel, VD_AGENT_FILE_XFER_STATUS,<br>
> --<br>
> 2.5.5<br>
></p>
<p dir="ltr">Victor, as we talked on IRC your patch solves the problem, fust to comments:</p>
<p dir="ltr">First one, shouldn't we emmit self->priv->error instead of error in the end of this function?</p>
<p dir="ltr">Second one, from a quick look in the code, I have the impression that we can get rid of the private Error variable and just use the error that we are propagating between the callbacks. A deeper read in the code would be needed though in order to affirm that.</p>
<p dir="ltr">Best Regards,</p>