crash from error from xcb_io.c:249

Jim Ham jimham at porcine.com
Mon Apr 12 13:01:42 PDT 2010



Julien Cristau wrote:
> [cc:ing the xcb list]
>
> On Sun, Apr 11, 2010 at 14:27:38 -0700, Jim Ham wrote:
>
>> I have an application that uses direct calls to X. This application
>> worked with a previous incarnation of X (before X.org) but crashes
>> with the following message on newer versions of X. I've tried 7.4+20 and
>> 7.5+5, both Debian on a x86 machine.
>>
>> xcb_io.c:249: process_responses: Assertion `(((long)
>> (dpy->last_request_read) - (long) (dpy->request))<= 0)' failed
>>
>> Without going into a lot of detail, here's what happens:
>>
>> The main thread blocks with a the call XNextEvent(...). A secondary
>> thread sends a user event to X with XSentEvent(...). The application
>> immediately crashes on the this first call to XSendEvent with the above
>> error message. A normal event such as a mouse click generated by the
>> Xserver does not cause a crash.
>>
>> XInitThreads() is called before any other X calls. All calls to X are
>> bracketed with XLockDisplay() and XUnlockDisplay() except for the
>> XNextEvent call in the main thread. As I mentioned, the app has worked
>> for several years.
>>
>> If this is a new problem I can certainly provide more detail. The entire
>> project may be available via SVN if necessary. There is some custom
>> hardware, but a couple of patches could fix that.
>>
> Do you have a backtrace from the assertion, or an X protocol trace of
> what happens before the crash?
>
I added a printf statement to show the contents of the user event, 
organized as 10 short ints. Here is the result. I suspect that all three 
events come before the exception but are printed out of order.

export DISPLAY=:9.0
xtrace -n -d :0 -D :9 -o xtrace.log ./dviii
initial directory is /home/jeh/dviii/trunk/src
Got connection from unknown(local)
Main PID=10613
0001:ffff:0000:0000:0000:0000:0000:0000:0000:0001:
dviii: ../../src/xcb_io.c:249: process_responses: Assertion `(((long)
(dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.
0001:ffff:0000:0000:0000:0000:0000:0000:0000:0002:
0001:ffff:0000:0000:0000:0000:0000:0000:0000:0003:
dviii: ../../src/xcb_io.c:249: process_responses: Assertion `(((long)
(dpy->last_request_read) - (long) (dpy->request)) <= 0)' failed.
export DISPLAY=:0.0

Now here is the result of the trace from xtrace for these three events. 
It looks like the contents of the event is getting trashed somehow, 
along with the exception from xcb_io.

000:<:0684: 44: Request(25): SendEvent propagate=false(0x00)
destination=0x03400001 event-mask=0 ClientMessage(33) format=0x20
window=0x03400001 type=0x13("INTEGER")
data=0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00;
000:>:0684: Event (generated) ClientMessage(33) format=0x20
window=0x03400001 type=0x13("INTEGER")
data=0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00;
000:<:0685: 44: Request(25): SendEvent propagate=false(0x00)
destination=0x03400001 event-mask=0 ClientMessage(33) format=0x20
window=0x03400001 type=0x13("INTEGER")
data=0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00;
000:>:0685: Event (generated) ClientMessage(33) format=0x20
window=0x03400001 type=0x13("INTEGER")
data=0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00;
000:<:0686: 44: Request(25): SendEvent propagate=false(0x00)
destination=0x03400001 event-mask=0 ClientMessage(33) format=0x20
window=0x03400001 type=0x13("INTEGER")
data=0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00;
000:>:0686: Event (generated) ClientMessage(33) format=0x20
window=0x03400001 type=0x13("INTEGER")
data=0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00;
(this is the end of the trace log)

Regards,

Jim

> Cheers,
> Julien
> _______________________________________________
> xorg at lists.freedesktop.org: X.Org support
> Archives: http://lists.freedesktop.org/archives/xorg
> Info: http://lists.freedesktop.org/mailman/listinfo/xorg
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.801 / Virus Database: 271.1.1/2805 - Release Date: 04/11/10 11:32:00
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jimham.vcf
Type: text/x-vcard
Size: 254 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20100412/5531ebf2/attachment.vcf>


More information about the xorg mailing list