Trying to reproduce the memleak (#2730), I modified the simulate_console_user.py script and ran it in an xterm:
windows.1.geometry=(1147, 229, 1423, 1408).
Semi reliably, the scroll paints end up corrupting the screen during the last part of the test (after
screenshot of the paint corruption
(ignore the black box that cuts the xterm near
sleep(0.5) - that's an artifact of using
scrot for the screenshot)
Could be caused by:
Looks like this is caused by the switch to non-opengl windows for 'text' content added in r26145.
r26274 makes it possible to force opengl on for all windows that can support opengl, including 'text' windows (
xpra attach --opengl=force) and the corruption disappears.
Simply turning on paint debugging with
XPRA_PAINT_BOX=1 xpra attach made the bug "disappear", so it looks like a race condition of some sort.
I'm not sure if r26276 makes it harder to hit the bug, should not hurt to have it?
r26277 seems to make it easier to reproduce the bug?
r26281 improves the cairo scroll paint code slightly.
Testing with the changes from r26277, the corruption seems to occur where the edge of the scroll bar on the left hand side aligns with the terminal output. The scroll list ends up divided there (the page scrolls up, the scroll bar moves in the opposite direction).
patch to save and replay scrolls later
replay in two separate windows (original and copy)
Bug could be server-side?
script to generate scrolling data from 2 pictures
Running the test script to generate scroll data:
$ test_scrolling.py ./scroll-27.png ./scroll-28.png 0, 28, 1339, 1181, 0, -26 0, 1235, 1339, 80, 0, -26 0, 1172, 1339, 37, 0, 26 0, 1237, 1339, 26, 0, 52
This matches the data captured from the client, and replaying the scroll changes produces an image that's wrong. Can be seen using:
$ cairo_replayscroll2.py ./scroll-28.png scroll-28.txt
The 3rd chunk is wrong and overlaps with data from the 2nd chunk (omitting horizontal coordinates which are always the same):
Overlaps should never occur!
Fixed in r26287. (also avoid harmless debug overflow in r26284)
Explanation: comment:6 is wrong. Overlaps can and do happen, we should not try to avoid them at all costs. The cost of splitting one large scroll region can be higher. We have to keep track of which lines have been sent using 'scroll', that was also used to shortcut out and skip sending the same line again... but that was done badly: when we're in the loop because we're counting how many lines to include in a scroll region, we need to keep counting, not skip it.
Backport to v3.0.x in r26288.
For those stuck on v3.0.9 and earlier, you can start your server with:
XPRA_SCROLL_ENCODING=0 xpra start ...
To disable scroll encoding completely. The loss of performance with some workloads can be pretty significant.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2757