Bug 36056 - XCB codegen should give a meaningful error message on malformed fieldref
Summary: XCB codegen should give a meaningful error message on malformed fieldref
Status: RESOLVED MOVED
Alias: None
Product: XCB
Classification: Unclassified
Component: Utils (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 09:38 UTC by Trevour
Modified: 2019-02-16 19:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Trevour 2011-04-07 09:38:22 UTC
Take the following example protocol:

<?xml version="1.0" encoding="utf-8"?>

<xcb header="bad" extension-name="bad" extension-xname="BAD">
        <request name="BadRequest" code="0">
                <field type="CARD32" name="sizeField" />
                <list type="CARD8" name="dataVector">
                        <fieldref>vectorSize</fieldref>
                </list>
        </request>
</xcb>

When running it through XCB's codegen, the result is a backtrace and a TypeError that NoneType can't be concatenated with 'str'. As it stands, the error gives no hint that the issue is that vectorSize isn't a previously defined field in the request, which can be easily overlooked(especially if the error is a simple shift failure). Not having any experience in Python, I can't suggest what would be the best fix, but it looks like adding a check in get_type_impl(state.py) for id == NoneType should be sufficient for a simple "Check your fieldrefs" diagnostic.
Comment 1 GitLab Migration User 2019-02-16 19:44:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxcb-cursor/issues/4.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.