DMXGetScreenAttributes() causes error: _XRead: Assertion `dpy->xcb->reply_consumed + size <= dpy->xcb->reply_length' failed.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libdmx (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libdmx1
Hi,
This is a bug in either libdmx1, libx11-6, or in libxcb1 (or in the upstream source).
When I run a program that callls DMXGetScreenAtt
dmx_config: ../../src/
The program in particular if called 'dmx_config', and it comes from the OpenGL replacement software 'chromium' (http://
A back trace when running this code gives:
(gdb) bt
#0 0x00007f2b13348095 in raise () from /lib/libc.so.6
#1 0x00007f2b13349af0 in abort () from /lib/libc.so.6
#2 0x00007f2b133412df in __assert_fail () from /lib/libc.so.6
#3 0x00007f2b13e647fe in _XRead () from /usr/lib/
#4 0x00007f2b13e64839 in _XReadPad () from /usr/lib/
#5 0x00007f2b14333793 in DMXGetScreenAtt
physical_
#6 0x0000000000400b7b in main ()
Digging deeper, there seems to be a problem with the way the displayName and it's length are handled in DMXGetScreenAtt
_XReadPad(dpy, attr->displayName, rep.displayName
to
_XReadPad(dpy, attr->displayName, ((rep.displayNa
the call is successful, but the display name is truncated so that it's length is divisible by 4. As an example, if the name of the display is "localhost:1", then the revised call to _XReadPad() gives a name of "localhos". Supplying any length longer than ((rep.displayNa
With this revision above, the output from dmx_config is:
[0
{ 'display': 'localhos', 'width': 2560, 'height': 1600, 'xoff': 0, 'yoff': 0, 'screen': 0, 'xorigin': 0, 'yorigin': 0 },]
One other way to suppress the failed assertion is to modify the line:
if (!_XReply(dpy, (xReply *)&rep,
to
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
In this case, although the program dmx_config runs, it's output is random, and the display name is empty. For example, the output on one run is:
[0
{ 'display': '', 'width': 2560, 'height': 1600, 'xoff': 0, 'yoff': 0, 'screen': 0, 'xorigin': 26240, 'yorigin': 1593 },]
On another run it is:
[0
{ 'display': '', 'width': 2560, 'height': 1600, 'xoff': 0, 'yoff': 0, 'screen': 0, 'xorigin': 23776, 'yorigin': -8477 },]
Snooping around in xcb_io.c where the assertion fails (from source package libx11-6), with the display name "localhost:1", we have the following state before the assertion fails:
dpy->xcb-
size = 11
dpy->xcb-
And indeed this does not pass the assertion.
Any assistance with this would be appreciated!
Regards,
Chris
Hi cwant,
Thanks for including the attached files. Could you also include your /var/log/ Xorg.0. log?