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

QtScript: recursive function leads to crash on windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.7.3, 4.8.5, 4.8.6, 5.3.2
    • Qt Script
    • None

      Hy,

      i have a big problem with recursive function (javacript) and the QScriptEngine (with using QScriptContext)

      I've created the following github-repo the demonstrate the problem: https://github.com/tonka3000/QtScriptRecursiveFunctionBug

      The problem:
      I have a simple QScriptEngine instance an create a new context (with pushContext) to avoid garbage in the global object (and i set some variables for this context like f.e. __filename or __dirname). This system works fine for month, but know i have a critical bug/crash on windows systems.

      If i have a script with a recursive function (see the crash.js script in the github-repo) which call itself 1000 times, the app will crash if i will call popContext at the end of QScriptEngine::evaluate. If i call this function only 500 times, it works great. This happens only on windows systems (x86 & x64), on Mac OS X and Linux everything works fine.
      When i remove the context nothing will crash but i get garbage in my global object and i can't really set variables in the context (because it is the global context)

      Greetings
      Tonka

        1. qtbug41558_stack.tasks
          0.4 kB
        2. qtbug41558_stack.txt
          1 kB
        3. qtbug41558_valgrind.txt
          7 kB
        4. qtbug41558.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            shausman Simon Hausmann
            tonka3000 tonka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes