Xlib - reporting X errors [+patches]
Lubos Lunak
l.lunak at suse.cz
Mon Jan 21 15:39:24 PST 2008
Hello,
the simple part: XGetErrorText() has a bug that prevents it from finding text
for errors which have error code equal to the error base for the extension
(such as BadRegion in XFixes). Attached patch ErrDes.c.patch fixes that.
Also, the errors file is missing some items, XErrorDB.patch adds those.
Please review and apply them.
The not so simple part: These fixes will take some time to be shipped with
distros, and even then, X error handlers still can't provide that useful
information. Imagine you're looking at a bugreport including a debug output
from an application saying something like "X error: error code 185, request
159/2" - you have no idea what that actually is, without knowing opcodes and
error bases of all extensions (think large codebase, not some hello-word
application initializing all needed extensions in one place).
As a small help, I suggest also applying the ErrDes_2.c.patch file, that
makes XGetErrorText() print the error number at least with the extension
name, in case the error message is missing in XErrorDB again. There is
unfortunately no XGetRequestText() that would print request name for given
opcode, and XGetErrorDatabaseText() requires extension name passed.
But the problem is, it appears that one even cannot know the opcodes and
error bases for an error:
- Xlib knows those, but they are in internal structures
- using XListExtensions() and XQueryExtension() with the same X connection in
an X error handler is not allowed by XSetErrorHandler()
- doing the same, with another connection, completely locks up whole X when
the server is grabbed
- _XPrintDefaultError() would work nicely, but it is not exported
- the default X error handler, which calls _XPrintDefaultError(), calls exit()
right after it
Does somebody see a way to handle this problem? Would it be possible to e.g.
add functions to Xlib to access the data in internal structures?
--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12 tel: +420 284 028 972
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http//www.suse.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrDes.c.patch
Type: text/x-diff
Size: 439 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080122/92133638/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XErrorDB.patch
Type: text/x-diff
Size: 3276 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080122/92133638/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ErrDes_2.c.patch
Type: text/x-diff
Size: 523 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080122/92133638/attachment-0002.patch>
More information about the xorg
mailing list