Multitouch stops reporting new touch events
I'm seeing a bug with a multitouch touchscreen on Xorg 1.19.2. This particular case is using a usb hid_multitouch device with evdev, though libinput reproduces the same issue. If I quickly tap the screen with multiple fingers for about 10 seconds it will stop responding to new touch events. The X server is otherwise responsive other than new touch events. Reinserting the USB touchscreen allows the touch device to continue working. I found it was getting stuck here: https://gitlab.freedesktop.org/xorg/xserver/blob/server-1.19-branch/dix/touch.c#L155
When it stops responding to touch dev->last.touches[i].active stays active forever. As a workaround at line 168 if I add "emulate_pointer = true;" then the screen is able to continue receiving touch events. I'm not familiar enough with the intention of this code to know the correct fix. The attached gdb log shows this stepping through those for loops to set emulate_pointer.
This issue was found upgrading from Debian Jessie to Debian Stretch, and the 1.18 release in Jessie did not reproduce the problem. I did also try Debian Buster's 1.20.3 and the issue is present there as well.