Go to file
Jakub Janků f784f4e6d1 main: remove msg from c->flushing asap
The msg is no longer valid after spice_msg_out_send_internal(),
so it shouldn't be present in c->flushing since the same
memory can be assigned to a new message.

This currently causes issues when transferring multiple big
files at once (tested 4 × 200 MB).
The following can happen in agent_send_msg_queue(),
after msg is flushed:

(task1, task2 refers to two distinct SpiceFileTransferTasks,
 one per file)

g_task_return_boolean(task1) ->
file_xfer_data_flushed_cb(task1) ->
spice_file_transfer_task_read_async(task1) ->
g_coroutine_object_notify() [switches from coroutine context to main]
...
file_xfer_read_async_cb(task2) ->
file_xfer_queue_msg_to_agent(task2)
[allocates new msg for task2 at the same address as the old msg] ->
file_xfer_flush_async(task2)
[inserts to c->flushing, but the old msg is still present,
 so the data in the hash table changes from task1 to task2]
...
program returns to coroutine context,
g_task_return_boolean(task1) returns ->
g_hash_table_remove() [removes the entry that now contains task2]

Consequently, flush task for task2 never finishes
and it gets stuck.

This issue is present since 2261e50a64,
that replaced g_object_notify() in spice_file_transfer_task_read_async()
with g_coroutine_object_notify().

To solve it, remove the msg from c->flushing
before finishing the flush task.

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2020-01-10 11:04:48 +01:00
build-aux build: Do additional changes to Meson distribution 2019-07-08 11:12:13 +01:00
data Drop autotools 2019-07-09 11:05:29 +01:00
doc build: Replace "join_paths" with "/" operator 2019-08-21 12:08:12 +01:00
man build: Replace "join_paths" with "/" operator 2019-08-21 12:08:12 +01:00
po po/it: Update some Italian translations 2019-12-16 16:30:54 +00:00
src main: remove msg from c->flushing asap 2020-01-10 11:04:48 +01:00
subprojects build: Fix compatibility with Meson 0.49 2019-08-29 16:58:18 +01:00
tests test-cd-emu: Test no libusb context support 2019-09-27 11:08:48 +01:00
tools spicy: Do not call gst_init directly 2019-09-23 16:13:59 +01:00
vapi build: Replace "join_paths" with "/" operator 2019-08-21 12:08:12 +01:00
.gitlab-ci.yml CI: Add usbredir packages to Windows 2019-08-27 15:20:46 +01:00
.gitmodules Move src/keycodemapdb -> subprojects/keycodemapdb 2019-02-18 18:31:35 +00:00
.gitpublish Add default .gitpublish profile 2017-04-11 15:26:26 +02:00
.mailmap .mailmap: add another Victor Toso alias 2018-06-08 17:47:55 +02:00
AUTHORS Release 0.8 2012-01-15 22:07:05 +01:00
CHANGELOG.md CHANGELOG: Prepare for v0.37 release 2019-05-16 11:47:56 +00:00
COPYING Initial import from SPICE 2010-11-23 17:00:17 +01:00
meson_options.txt Allows to enable recorder integration 2019-02-19 15:52:28 +00:00
meson.build build: Fix compatibility with Meson 0.49 2019-08-29 16:58:18 +01:00
README.md Drop autotools 2019-07-09 11:05:29 +01:00