Xpra: Ticket #554: mmap error when closing window whilst encoding pixels

Caught this during testing:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/server/source.py", line 1574, in data_to_packet
    encode_and_queue()
  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 886, in make_data_packet_cb
    packet = self.make_data_packet(*data)
  File "/usr/lib64/python2.7/site-packages/xpra/server/window_source.py", line 1066, in make_data_packet
    mmap_data = mmap_send(self._mmap, self._mmap_size, image, self.rgb_formats, self.supports_transparency)
  File "/usr/lib64/python2.7/site-packages/xpra/server/picture_encode.py", line 322, in mmap_send
    mmap_data, mmap_free_size = mmap_write(mmap, mmap_size, data)
  File "/usr/lib64/python2.7/site-packages/xpra/net/mmap_pipe.py", line 162, in mmap_write
    mmap_data_start = ctypes.c_uint.from_buffer(mmap_area, 0)
TypeError: expected a single-segment buffer object


Fri, 04 Apr 2014 02:37:18 GMT - Antoine Martin: status changed; resolution, milestone set

Was caused by the new more thorough window cleanup code added in r5650, fixed in r6011.


Sat, 05 Apr 2014 03:14:54 GMT - Antoine Martin:

Another related race fixed in r6024.

Sending via mmap is done in two parts:

This problem could also have occurred if the mmap references got cleaned up in between the two calls. This change also makes r6011 redundant and it is now unapplied in r6028.

But then.. I found that r6024 was wrong, so r6035 fixes that!

Backports for v0.12.x in: r6027 (+fix in r6036)


Sat, 23 Jan 2021 04:59:12 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/554