<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hey guys, <DIV><BR class="khtml-block-placeholder"></DIV><DIV>I found a problem with running some little apps. </DIV><DIV>I use some very simple apps to check the event stream from the X server. All of them started crashing when I started testing MPX today. The X Server and XCB are both pulled from git (X server last week, XCB today). </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>There are some weird behaviours: </DIV><DIV>* Using plain Xlib (in Ubunty Breezy) works, linking against XCB makes it crash. </DIV><DIV>* Using PointerMotionMask as well instead of just DeviceMotion will not crash the program, </DIV><DIV>* If I hook up xmond between the server and the client, I can see the input extension events but they never arrive at the client. From what I can tell by debugging the X server before they are sent out, their values are sane.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here is a very simple program that will crash. </DIV><DIV>=======</DIV><DIV>#include &lt;stdio.h&gt;</DIV><DIV>#include &lt;X11/X.h&gt;</DIV><DIV>#include &lt;X11/Xlib.h&gt;</DIV><DIV>#include &lt;X11/extensions/XInput.h&gt;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>int main (int argc, char** argv)</DIV><DIV>{</DIV><DIV>    Display* display;</DIV><DIV>    Window win;</DIV><DIV>    XDevice* dev;</DIV><DIV>    XEventClass class_1;</DIV><DIV>    XSetWindowAttributes attr;</DIV><DIV>    int screen;</DIV><DIV>    int win_width, win_height;</DIV><DIV>    int type_1;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    display = XOpenDisplay(argv[1]);</DIV><DIV>    screen = DefaultScreen(display);</DIV><DIV>    assert(display != NULL);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    win_width = 640;</DIV><DIV>    win_height = 480;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    dev = XOpenDevice(display, atoi(argv[2]));</DIV><DIV>    assert(dev != NULL);</DIV><DIV>    DeviceMotionNotify(dev, type_1, class_1);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    attr.background_pixel = WhitePixel(display, screen);</DIV><DIV>    attr.event_mask = ExposureMask | StructureNotifyMask; //| PointerMotionMask;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    win = XCreateWindow(display,</DIV><DIV>            RootWindow(display, 0),</DIV><DIV>            0, 0,</DIV><DIV>            win_width,</DIV><DIV>            win_height,</DIV><DIV>            7,</DIV><DIV>            DefaultDepth(display, 0),</DIV><DIV>            InputOutput,</DIV><DIV>            DefaultVisual(display, 0),</DIV><DIV>            CWBackPixel | CWEventMask,</DIV><DIV>            &amp;attr);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    XMapWindow(display, win);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    XSelectExtensionEvent(display, win, &amp;class_1, 1);</DIV><DIV>    XSync(display, False);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    while(1)</DIV><DIV>    {</DIV><DIV>        XEvent e;</DIV><DIV>        XNextEvent(display, &amp;e);</DIV><DIV>        XDeviceMotionEvent* mev;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>        switch(e.type)</DIV><DIV>        {</DIV><DIV>            default:</DIV><DIV>                if (e.type == type_1)</DIV><DIV>                {</DIV><DIV>                    printf("Motion notify\n");</DIV><DIV>                    printf(" state %d\n", mev-&gt;state);</DIV><DIV>                    printf(" devstate %d\n", mev-&gt;device_state);</DIV><DIV>                } else</DIV><DIV>                {</DIV><DIV>                    printf("Unknown event type %d\n", e.type);</DIV><DIV>                }</DIV><DIV>                break;</DIV><DIV>        }</DIV><DIV>    }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    XCloseDisplay(display);</DIV><DIV>    return 0;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>=======</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>(gdb) run roo:1 2</DIV><DIV>Starting program: /home/whot/code/junk/X/XCB_segfault/xcbsegfault roo:1 2</DIV><DIV>Unknown event type 19</DIV><DIV>Unknown event type 12</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Program received signal SIGSEGV, Segmentation fault.</DIV><DIV>0xb7d5985c in memcpy () from /lib/tls/i686/cmov/libc.so.6</DIV><DIV>(gdb) bt</DIV><DIV>#0  0xb7d5985c in memcpy () from /lib/tls/i686/cmov/libc.so.6</DIV><DIV>#1  0xb7e747f2 in XNextEvent (dpy=0xbfc496e4, event=0xbfc496e4) at NextEvent.c:52</DIV><DIV>#2  0x08048895 in main (argc=3, argv=0xbfc49844) at main.c:55</DIV><DIV>(gdb) up 1</DIV><DIV>#1  0xb7e747f2 in XNextEvent (dpy=0xbfc496e4, event=0xbfc496e4) at NextEvent.c:52</DIV><DIV>52              *event = qelt-&gt;event;</DIV><DIV>(gdb)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Cheers, </DIV><DIV>  Peter</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--</DIV><DIV>Multi-Pointer X Server</DIV><DIV><A href="http://wearables.unisa.edu.au/mpx">http://wearables.unisa.edu.au/mpx</A></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>