Frequent crashes when using touch screen (clutter_actor_iter_next: assertion 'ri->age == ri->root->priv->age' failed)
Affected version
Ubuntu 20.04, gnome-shell 3.36.3, Lenovo Yoga C930.
Bug summary
When using the touchscreen, every now and then gnome-shell will crash. Certain programs close, others don't, and the shell restarts. This happens every five minutes or so if you're using the touchscreen a lot, which renders it basically unusable.
I saved the syslogs from many of these crashes over many weeks and the one point they all have in common is the following line:
clutter_actor_iter_next: assertion 'ri->age == ri->root->priv->age' failed
As far as I can tell by looking at the code this means that somewhere a child of an Actor was added or removed while iterating over that Actor's children, but I can't imagine that's very helpful.
Relevant logs, screenshots, screencasts etc.
I had a go at getting the core dump for one of these crashes and tried to get a backtrace out of it using Apport. I'm also attaching my syslog, note that these logs contain snippets from my syslog relevant to the crashes, the snippets being separated by empty lines.
I found this issue and this one, but neither mentions the failed assert that I'm seeing. However, a user did report an identical problem with a Dell computer here.