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

Regression: Javascript JIT Engine broken in Qt 5.8 RC (Linux, gcc-64)

    XMLWordPrintable

Details

    • fffb997e192a72b4dcd66edc2fbad5473dd359f3 (qtdeclarative)

    Description

      There is a problem with the Javascript/QML Engine in Qt 5.8 RC. When I run this minimal example with qmlscene 5.8 on my system I get erroneous runtime behaviour:

      import QtQuick 2.7
      
      Text {
          function broken(n) {
              var x = 2.;
              console.log("x start = " + x);
              while (n/x > 1000) {
                  x += 2.;
                  console.log("x in while = " + x);
              }
              console.log("x end = " + x);
              return x;
          }
      
          text: (broken(4000) === 4) ? "result ok" : "error in js engine?"
      }
      

      With Qt 5.7, I get the expected result:

      qml: x start = 2
      qml: x in while = 4
      qml: x end = 4

      With Qt 5.8 RC, I get (for given parameters):

      qml: x start = 2
      qml: x in while = 4
      qml: x end = 0

      Reordering the print statements in the code sometimes result in a working program. Some parameters even cause an endless loop with x being corrupted within the loop.

      I reproduced this on two different Ubuntu 16.10 machines with the gcc-64 build. I cannot reproduce this on Windows with the msvc2013-64 build.

      Attachments

        For Gerrit Dashboard: QTBUG-57779
        # Subject Branch Project Status CR V

        Activity

          People

            shausman Simon Hausmann
            pwuertz Peter Würtz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes