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

David T. Lewis lewis at mail.msen.com
Sat Oct 8 19:23:17 UTC 2016


On Sat, Oct 08, 2016 at 10:01:35AM -0700, tim Rowledge wrote:
> 
> 
> > On 08-10-2016, at 6:19 AM, David T. Lewis <lewis at mail.msen.com> wrote:
> > 
> > 
> > On Fri, Oct 07, 2016 at 08:43:23PM -0700, tim Rowledge wrote:
> >> 
> >> Right, well I think I have a handle on this oddity. It???s both trickier and simpler than I expected.
> >> 
> >> We (as in Pi Towers) built a new package with the 20160818 0858 vm. Yippee!
> >> 
> >> Oh pooh; install it and the bug is still there. Damn. How is this possible?
> >> 
> >> Binary diff all the vm files (such fun) and they???re all identical. But when the vm is in my working directory it is fine - in the /usr/lib/blah end-user location, bug. How is it possible?
> >> 
> >> Actually I???m going to stop there and see if anyone else spots what is happening, just for fun.
> >> 
> > 
> > Keyboard settings. Your personal account on the PI is configured for a
> > different keyboard setting than whatever is delivered by default for Raspian.
> 
> That???s so close it???s worthy of applause.
> 
> The one key difference between running the ???0818??? vm in my local dir and in the ???production??? dir is the content of the ???squeak??? shell script. The production version is (for various reasons I can???t work out really) the script that we worked out to run the composition input subsystem a while back. I???m not sure why the lines that test for the need for the -compositioninput flag aren???t in the dev version.
> 
> It???s not even the use of the flag, but a side-effect of exporting $LANG. Combined, I strongly suspect but can???t prove yet, with *not* having all the additional support libraries etc installed. My guess right now is that there is a bug in the relevant code in sqUnixEvent or vm-display-X11 that looks for $LANG when it should only do that if the flag is also set.
> 
> I guess I have to install all the extra stuff on one of my Pi to see if that stops the problem even with $LANG getting exported. And any help on spotting where the actual bug is would be nice. X stuff is pretty opaque.
> 

Here is how to debug the X11 events that are delivered to the Squeak VM:

First start Squeak (Scratch) on your Raspberry Pi. The VM will open a new
X11 window as a container, then open a second child X11 window inside the
first. The child X11 window is used for the actual Squeak display. The
vm-display-X11 VM module looks for events delivered to that child window,
and turns the interesting ones into Squeak events that are delivered to
the image.

Open a separate terminal window in the desktop on your Pi to use for
event display.

In that window, use the xwininfo utlity to find the X11 window ID for
the child window used for Squeak display. Run xwininfo -tree, then click
anywhere on the Squeak display to get the information:

   pi at raspberrypi:~/squeak/VM-Git/opensmalltalk-vm/image $ xwininfo -tree
   
   xwininfo: Please select the window about which you
             would like information by clicking the
             mouse in that window.
   
   xwininfo: Window id: 0x2c00001 "SpurVMMaker.image"
   
     Root window id: 0x25 (the root window) (has no name)
     Parent window id: 0x1400c48 (has no name)
        1 child:
        0x2c00002 (has no name): ()  1124x804+0+0  +11+100

The window we want is the child window, which in this example has X11
window ID 0x2c00002.

Use the xev utility to show X11 events delivered to this window from
the X11 server. In this case we only want keyboard events (see the xev man
page for other options):

   pi at raspberrypi:~/squeak/VM-Git/opensmalltalk-vm/image $ xev -id 0x2c00002 -event keyboard
   
   KeymapNotify event, serial 13, synthetic NO, window 0x0,
       keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
              0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
   
   KeymapNotify event, serial 13, synthetic NO, window 0x0,
       keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
              0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
   
   KeymapNotify event, serial 13, synthetic NO, window 0x0,
       keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
              0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
   
   KeymapNotify event, serial 13, synthetic NO, window 0x0,
       keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
              0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
   
   KeyPress event, serial 13, synthetic NO, window 0x2c00002,
       root 0x25, subw 0x0, time 2779572111, (283,270), root:(294,370),
       state 0x0, keycode 43 (keysym 0x66, f), same_screen YES,
       XLookupString gives 1 bytes: (66) "f"
       XmbLookupString gives 1 bytes: (66) "f"
       XFilterEvent returns: False

This will continuously display the X11 event information as it is delivered
to vm-display-11. If it scrolls by too quickly to see what is happening, you
can redirect the output of xev to a file, type a few keystrokes in Squeak,
stop the xev program, and review the file to see what happened.

HTH,
Dave



More information about the Vm-dev mailing list