Thanks for the detailed analysis.
It sounds like this may be a threading issue, perhaps we end up calling free
on the ScrollData
object whilst the encoding thread is still using it. (as it can be called from quite a few places)
I guess the hack fix would be to return early from match_distance if a1 or a2 are null, but this wouldn't get to the root cause
Yes. Another easy "fix" would be to add locking, but that's just lazy and might slow things down - I will try to locate the threading issue first. (starting with some thread checks first)
You may be able to avoid the crash for now by turning off scroll
encoding. In v4, this can be done using XPRA_SCROLL_ENCODING=0 xpra ...
(works for both client and server), in v4.1 you have to use --encodings=
(see #2810).
This could also just be a memory corruption from somewhere else manifesting itself there.
I have no clue as to what, because I don't actually understand the code
Mile high view: ScrollData
holds the xxhash checksums of every line of two screen updates of the same size:
update
adds a new screen update and computes the new checksums
calculate
finds the scrolling distances that can be used to generate the newest screen update from the previous one (including duplicates)
get_scroll_values
finds the best matches (without duplicates) and uses match_distance
to do this
There are a few docstrings in the source code, though they're probably not detailed enough.