[Vm-dev] Strange unix (Pi) vm event bug for july 2016 era vm build

tim Rowledge tim at rowledge.org
Thu Oct 6 23:26:25 UTC 2016

I have a really annoying bug afflicting a few users. As in several million…

The latest release of Raspbian includes a cog vm tagged 5.0-201607181657 and suffers from a very annoying habit of not (seemingly) passing in key-up events if another key has gone down since the first did. In ordinary typing of course this isn’t often an issue but for Scratch scripts that test things like cursor key presses (say for example, AsteroidBlaster) it gets very annoying because you get completely screwed by what seems to be a jammed key.

Aside for explanatory purpose - Scratch wants to be able to query whether a certain key is up or down, rather  than making use of events per se. To provide this I have a very simple and so far effective keyboard event listener class that merely keeps a big array of true/false for each ascii value. Scratch checks that table for the requested ascii value. 

On previous release vms and indeed a september 28 build, there was/is no problem. The key events come in, the listener gets pinged, the state is updated. Asteroids are blasted. With the july vm (the one shipped to several million kids) the up events are not coming in in quite the same way; if I press left-cursor, then right cursor, then release right and finally left, that last left-cursor-up event seems not to arrive. The *same* image on the other vm(s) works.

So far I’m completely unable to find any difference in the code! I’ve checked sqUnixEvent.c & sqUnixX11.c for example - any other plausible places where key events might get mangled? I see some recent-ish changes for some squeak/pharo labelling differences but that’s it. Can anyone recall making changes around the june/july era that might have had some effect? Not to mention something that *fixed* the problem sometime in early September?

Obviously one could say it’s fixed and to hell with it  but it would be nice to understand what on earth went wrong. I also have to work out how it didn’t get spotted during the release testing but that;s a different problem.

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: DMZ: Divide Memory by Zero

More information about the Vm-dev mailing list