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

When the ternary operator is used in a xsl file, then it can cause a crash when being use with QXmlQuery

    XMLWordPrintable

    Details

      Description

      When the ternary operator is used in a xsl file, then it can cause a crash when being use with QXmlQuery.

      This does not always happen with the attached files, but when it does when running:

      xmlpatterns test.xsl test.xml
      

      it crashes with:

      #0	0x0000000100120b3f in QListData::size() const at /Users/andy/dev/qt5.9/qtbase/include/QtCore/../../src/corelib/tools/qlist.h:113
      #1	0x00000001001fb9f5 in QList<QExplicitlySharedDataPointer<QPatternist::VariableReference> >::count() const at /Users/andy/dev/qt5.9/qtbase/include/QtCore/../../src/corelib/tools/qlist.h:343
      #2	0x00000001001fb9c9 in QPatternist::VariableDeclaration::usedByMany() const at /Users/andy/dev/qt5.9/qtbase/include/QtXmlPatterns/5.9.0/QtXmlPatterns/private/../../../../../../qtxmlpatterns/src/xmlpatterns/expr/qvariabledeclaration_p.h:146
      #3	0x00000001001fb278 in QPatternist::EvaluationCache<false>::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qevaluationcache_tpl_p.h:211
      #4	0x00000001001f1f28 in QPatternist::SingleContainer::compressOperands(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qsinglecontainer.cpp:74
      #5	0x00000001001baa24 in QPatternist::Expression::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpression.cpp:239
      #6	0x00000001001f8d71 in QPatternist::UnlimitedContainer::compressOperands(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qunlimitedcontainer.cpp:69
      #7	0x00000001001baa24 in QPatternist::Expression::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpression.cpp:239
      #8	0x00000001001ea482 in QPatternist::PairContainer::compressOperands(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qpaircontainer.cpp:78
      #9	0x00000001001baa24 in QPatternist::Expression::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpression.cpp:239
      #10	0x00000001001fd9ce in QPatternist::ValueComparison::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qvaluecomparison.cpp:102
      #11	0x00000001001f844b in QPatternist::TripleContainer::compressOperands(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qtriplecontainer.cpp:78
      #12	0x00000001001baa24 in QPatternist::Expression::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpression.cpp:239
      #13	0x00000001001d2456 in QPatternist::IfThenClause::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qifthenclause.cpp:87
      #14	0x00000001001f1f28 in QPatternist::SingleContainer::compressOperands(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qsinglecontainer.cpp:74
      #15	0x00000001001baa24 in QPatternist::Expression::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpression.cpp:239
      #16	0x00000001001b5957 in QPatternist::CurrentItemStore::compress(QExplicitlySharedDataPointer<QPatternist::StaticContext> const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qcurrentitemstore.cpp:101
      #17	0x00000001001c00dc in QPatternist::ExpressionFactory::createExpression(QExplicitlySharedDataPointer<QPatternist::Tokenizer> const&, QExplicitlySharedDataPointer<QPatternist::StaticContext> const&, QXmlQuery::QueryLanguage, QExplicitlySharedDataPointer<QPatternist::SequenceType const> const&, QUrl const&, QXmlName const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpressionfactory.cpp:288
      #18	0x00000001001c1759 in QPatternist::ExpressionFactory::createExpression(QIODevice*, QExplicitlySharedDataPointer<QPatternist::StaticContext> const&, QXmlQuery::QueryLanguage, QExplicitlySharedDataPointer<QPatternist::SequenceType const> const&, QUrl const&, QXmlName const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/expr/qexpressionfactory.cpp:123
      #19	0x00000001001398cd in QXmlQueryPrivate::expression(QIODevice*) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/api/qxmlquery_p.h:252
      #20	0x000000010015765b in QXmlQuery::setQuery(QIODevice*, QUrl const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/api/qxmlquery.cpp:429
      #21	0x0000000100157b8d in QXmlQuery::setQuery(QUrl const&, QUrl const&) at /Users/andy/dev/qt5.9/qtxmlpatterns/src/xmlpatterns/api/qxmlquery.cpp:497
      

        Attachments

        1. test.xml
          1 kB
        2. test.xsl
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            andysh Andy Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes