https://bugs.kde.org/show_bug.cgi?id=415872

--- Comment #2 from Tom B <t...@r.je> ---
It seems to be something to do with how often the script triggers signals. 

If I rate limit the events (using the system clock to keep track of how often
they are fired) to once per frame it works fine. See my workaround for the
script here:

https://github.com/TRPB/kwin-tiling/commit/f69bdfc68989aeb6d15124a1106154c050067b4b

I have still had this crash randomly but not in a reproducible way and far less
frequently. 

The issue is connecting events:

e.g.


     client.clientStepUserMovedResized.connect(function() {


When this does something to the client (or other windows) too frequently, more
than once per frame as best as I can work out. Rate limit of once per 1ms =
crash, 25ms = no crash. 1 frame being 16ms. i. This is likely a symptom not the
underlying cause.

While I worked out what caused it in this instance, other events seem to cause
the same problem when triggered too frequently.

It would be better if:

A) The 1 event per frame rate limit was imposed by the scripting engine
or
B) It allows more than 1 event/frame but doesn't segfault


I will point out that this is likely a workaround rather than a fix. Whatever
causes the segfault is probably because two things happen out of the intended
sequence. By rate limiting the events, it significantly reduces the chances of
this happening. That said, after applying the rate limit to the script I could
never trigger the crash when  dragging windows. 

I'll try rate limiting every event registered by the script to 25ms and see if
I get any other random crashes. 

Rate limiting the calls to events registered in the `.connect` function could
be a very simple fix in the scripting engine if it works.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to