Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104722

qdbusxml2cpp segfault on signal arg without annotation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.5.0 Beta1
    • 6.3.1
    • D-Bus
    • None
    • Linux/X11
    • e163c49435 (qt/qtbase/dev)

    Description

      Hi,

      I've stumbled upon a segfault while generating interfaces for MPRIS TrackList spec. I've narrowed it down to entering an infinite recursion while trying to find a type name in this particular line:

      return qtTypeName(signature, annotations, paramId, "In", isSignal);
      

       

      Issue exists on dev branch as well.

       

      Expected behaviour:

      Warning about missing annotation without a segfault

       

      Reproduction:

      <node>
        <interface name="foo.bar">
          <signal name="Foosignal">
            <arg type="a{sv}" name="Fooarg"/>
          </signal>
        </interface>
      </node>
      
      $ qdbusxml2cpp -p foobar ./mre.xml
      qdbusxml2cpp: Got unknown type `a{sv}' processing './mre.xml'
      You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description
      [1]    19406 segmentation fault (core dumped)  qdbusxml2cpp -p foobar ./mre.xml
      

      Adding proposed annotation of course works as expected.

       

      There's also an interesting behaviour if you specify direction attribute (no matter the value) for an argument in which case it's omitted completely without warnings.

      <node>
        <interface name="foo.bar">
          <signal name="Foosignal">
            <arg direction="wut" type="a{sv}" name="Fooarg"/>
          </signal>
        </interface>
      </node>
      $ qdbusxml2cpp -p foobar ./mre.xml --verbose
      $ cat foobar.h | grep Foosignal             
          void Foosignal();
      

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            danielchabrowski Daniel Chabrowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes