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

Crash when evaluating JavaScript using QJSEngine

    XMLWordPrintable

Details

    • b6d1e97be274e67a47cce950ed4cf05518eebcc8

    Description

      Seems to only occur when "Use debug version of frameworks" is checked in Creator. Doesn't happen while actually debugging though.

      QV4_FORCE_INTERPRETER=1 doesn't help.

      0   libsystem_kernel.dylib        	0x00007fff7b390e3e __pthread_kill + 10
      1   libsystem_pthread.dylib       	0x00007fff7b4cf150 pthread_kill + 333
      2   libsystem_c.dylib             	0x00007fff7b2ed312 abort + 127
      3   QtCore_debug                  	0x00000001045c5548 qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) + 24
      4   QtCore_debug                  	0x00000001045c79ce QMessageLogger::fatal(char const*, ...) const + 446 (qlogging.cpp:816)
      5   QtCore_debug                  	0x00000001045bc32a qt_assert(char const*, char const*, int) + 74 (qglobal.cpp:3123)
      6   QtQml_debug                   	0x0000000105d4c252 QV4::IR::IRDecoder::visitExp(QV4::IR::Exp*) + 370 (qv4isel_p.cpp:264)
      7   QtQml_debug                   	0x0000000105de801d QV4::IR::IRDecoder::visit(QV4::IR::Stmt*) + 61 (qv4isel_p.h:128)
      8   QtQml_debug                   	0x0000000105e17940 QV4::JIT::RegAllocInfo::collect(QV4::IR::Function*, QSharedPointer<QV4::IR::LifeTimeIntervals> const&) + 336 (qv4regalloc.cpp:186)
      9   QtQml_debug                   	0x0000000105e171d8 QV4::JIT::RegisterAllocator::run(QV4::IR::Function*, QV4::IR::Optimizer const&) + 488 (qv4regalloc.cpp:1337)
      10  QtQml_debug                   	0x0000000105e303e1 QV4::JIT::InstructionSelection<QV4::JIT::Assembler<QV4::JIT::AssemblerTargetConfiguration<JSC::MacroAssemblerX86_64, (QV4::JIT::TargetOperatingSystemSpecialization)0> > >::run(int) + 305 (qv4isel_masm.cpp:97)
      11  QtQml_debug                   	0x0000000105e312ef non-virtual thunk to QV4::JIT::InstructionSelection<QV4::JIT::Assembler<QV4::JIT::AssemblerTargetConfiguration<JSC::MacroAssemblerX86_64, (QV4::JIT::TargetOperatingSystemSpecialization)0> > >::run(int) + 31
      12  QtQml_debug                   	0x0000000105d4a9b5 QV4::EvalInstructionSelection::compile(bool) + 101 (qv4isel_p.cpp:81)
      13  QtQml_debug                   	0x0000000105f28440 QV4::Script::parse() + 1424 (qv4script.cpp:138)
      14  QtQml_debug                   	0x0000000105df5efd QJSEngine::evaluate(QString const&, QString const&, int) + 253 (qjsengine.cpp:457)
      15  libisle.1.dylib               	0x000000010294f49f ScriptEngine::evaluateFile(QString const&, int) + 959 (ScriptEngine.cpp:64)
      16  libisle.1.dylib               	0x00000001029897ad ScriptHelper::evaluate() + 93 (ScriptHelper.cpp:26)
      17  libisle.1.dylib               	0x00000001028dcdbb GameController::callAddedToLevelScript(ComponentEntity*) + 219 (GameController.cpp:1184)
      18  libisle.1.dylib               	0x00000001028dcca8 GameController::onEntityAdded(QSharedPointer<ComponentEntity>, Level*, QPoint const*) + 104 (GameController.cpp:1006)
      19  libisle.1.dylib               	0x000000010299a33d GameController::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 1309 (moc_GameController.cpp:411)
      20  QtCore_debug                  	0x0000000104925661 QMetaObject::activate(QObject*, int, int, void**) + 2881 (qobject.cpp:3766)
      21  QtCore_debug                  	0x0000000104924b0d QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 61 (qobject.cpp:3629)
      22  libisle.1.dylib               	0x00000001029a1fe5 Level::entityAdded(QSharedPointer<ComponentEntity>, Level*, QPoint const*) + 101
      23  libisle.1.dylib               	0x000000010290be6d Level::emitEntityAdded(QSharedPointer<ComponentEntity>, QPoint const*) + 861 (Level.cpp:570)
      24  libisle.1.dylib               	0x000000010290b843 Level::setCurrentLevel(bool) + 227 (Level.cpp:197)
      25  libisle.1.dylib               	0x00000001028db53f GameController::enterLevel(QString const&) + 1295 (GameController.cpp:781)
      26  libisle.1.dylib               	0x00000001028c9e3d Game::completeEnterLevelRequest() + 253 (Game.cpp:933)
      27  libisle.1.dylib               	0x00000001028bf1da Game::beginEnterLevelRequest() + 58 (Game.cpp:925)
      28  libisle.1.dylib               	0x00000001028c9cca Game::prepareToEnterLevel(QString const&) + 1098 (Game.cpp:916)
      29  libisle.1.dylib               	0x0000000102825736 AbstractGame::requestEnterLevel(QString const&) + 86 (AbstractGame.cpp:80)
      30  libisle.1.dylib               	0x00000001028c2ba2 Game::completeLoadGameRequest() + 10802 (Game.cpp:563)
      31  libisle.1.dylib               	0x00000001028bf14c Game::beginToLoadGame() + 220 (Game.cpp:449)
      32  libisle.1.dylib               	0x00000001028bfa5a Game::prepareToLoadGame(QString const&) + 698 (Game.cpp:437)
      33  libisle.1.dylib               	0x00000001028bf769 Game::prepareNewGame() + 233 (Game.cpp:421)
      34  libisle.1.dylib               	0x000000010282542b AbstractGame::requestNewGame() + 75 (AbstractGame.cpp:32)
      35  libisle.1.dylib               	0x000000010295072e SessionManager::requestNewGame() + 206 (SessionManager.cpp:63)
      36  libisle.1.dylib               	0x00000001029a6e92 SessionManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 210 (moc_SessionManager.cpp:198)
      37  libisle.1.dylib               	0x00000001029a77b5 SessionManager::qt_metacall(QMetaObject::Call, int, void**) + 117 (moc_SessionManager.cpp:336)
      38  QtCore_debug                  	0x00000001048d835d QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) + 157 (qmetaobject.cpp:301)
      39  QtQml_debug                   	0x00000001060ce2e3 QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const + 163 (qqmlpropertycache.cpp:1733)
      40  QtQml_debug                   	0x0000000105ff1193 CallMethod(QQmlObjectOrGadget const&, int, int, int, int*, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call) + 771 (qv4qobjectwrapper.cpp:1177)
      41  QtQml_debug                   	0x0000000105fec939 CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine*, QV4::CallData*, QMetaObject::Call) + 953 (qv4qobjectwrapper.cpp:1424)
      42  QtQml_debug                   	0x0000000105fec307 QV4::QObjectMethod::callInternal(QV4::CallData*, QV4::Scope&) const + 1319 (qv4qobjectwrapper.cpp:1966)
      43  QtQml_debug                   	0x0000000105febdcd QV4::QObjectMethod::call(QV4::Managed const*, QV4::Scope&, QV4::CallData*) + 45 (qv4qobjectwrapper.cpp:1896)
      44  QtQml_debug                   	0x0000000105df9d51 QV4::Object::call(QV4::Scope&, QV4::CallData*) const + 65 (qv4object_p.h:445)
      45  QtQml_debug                   	0x0000000106013c98 QV4::Runtime::method_callProperty(QV4::ExecutionEngine*, int, QV4::CallData*) + 696 (qv4runtime.cpp:1105)
      46  ???                           	0x0000000111afd893 0 + 4591704211
      47  QtQml_debug                   	0x0000000105ec3f89 QV4::ExecutionContext::simpleCall(QV4::Scope&, QV4::CallData*, QV4::Function*) + 601 (qv4context.cpp:302)
      48  QtQml_debug                   	0x00000001060fd221 QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*, QV4::Scope&) + 785 (qqmljavascriptexpression.cpp:224)
      49  QtQml_debug                   	0x00000001060627e3 QQmlBoundSignalExpression::evaluate(void**) + 1459 (qqmlboundsignal.cpp:225)
      50  QtQml_debug                   	0x0000000106062f6e QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) + 382 (qqmlboundsignal.cpp:356)
      51  QtQml_debug                   	0x00000001060d506d QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) + 557 (qqmlnotifier.cpp:108)
      52  QtQml_debug                   	0x00000001060346b3 QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) + 1139
      53  QtCore_debug                  	0x0000000104924bce QMetaObject::activate(QObject*, int, int, void**) + 174 (qobject.cpp:3647)
      54  QtCore_debug                  	0x0000000104924b0d QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 61 (qobject.cpp:3629)
      55  QtQml_debug                   	0x0000000106199562 QQmlComponentAttached::completed() + 34 (moc_qqmlcomponentattached_p.cpp:139)
      56  QtQml_debug                   	0x0000000106122538 QQmlObjectCreator::finalize(QQmlInstantiationInterrupt&) + 1576
      57  QtQml_debug                   	0x000000010605a46e QQmlIncubatorPrivate::incubate(QQmlInstantiationInterrupt&) + 1246 (qqmlincubator.cpp:344)
      58  QtQml_debug                   	0x0000000106059ba0 QQmlEnginePrivate::incubate(QQmlIncubator&, QQmlContextData*) + 480
      59  QtQml_debug                   	0x0000000106055a88 QQmlComponent::create(QQmlIncubator&, QQmlContext*, QQmlContext*) + 728 (qqmlcomponent.cpp:1054)
      60  QtQuickTemplates2_debug       	0x000000010e2befcf QQuickStackElement::load(QQuickStackView*) + 319 (qquickstackelement.cpp:184)
      61  QtQuickTemplates2_debug       	0x000000010e2c838e QQuickStackViewPrivate::pushElements(QList<QQuickStackElement*> const&) + 238 (qquickstackview_p.cpp:183)
      62  QtQuickTemplates2_debug       	0x000000010e2c220f QQuickStackView::push(QQmlV4Function*) + 1039 (qquickstackview.cpp:520)
      63  QtQuickTemplates2_debug       	0x000000010e2ff910 QQuickStackView::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 592 (moc_qquickstackview_p.cpp:281)
      64  QtQuickTemplates2_debug       	0x000000010e300445 QQuickStackView::qt_metacall(QMetaObject::Call, int, void**) + 117 (moc_qquickstackview_p.cpp:449)
      65  QtCore_debug                  	0x00000001048d835d QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) + 157 (qmetaobject.cpp:301)
      66  QtQml_debug                   	0x00000001060ce2e3 QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const + 163 (qqmlpropertycache.cpp:1733)
      67  QtQml_debug                   	0x0000000105fec2d0 QV4::QObjectMethod::callInternal(QV4::CallData*, QV4::Scope&) const + 1264 (qv4qobjectwrapper.cpp:1962)
      68  QtQml_debug                   	0x0000000105febdcd QV4::QObjectMethod::call(QV4::Managed const*, QV4::Scope&, QV4::CallData*) + 45 (qv4qobjectwrapper.cpp:1896)
      69  QtQml_debug                   	0x0000000105df9d51 QV4::Object::call(QV4::Scope&, QV4::CallData*) const + 65 (qv4object_p.h:445)
      70  QtQml_debug                   	0x0000000106013c98 QV4::Runtime::method_callProperty(QV4::ExecutionEngine*, int, QV4::CallData*) + 696 (qv4runtime.cpp:1105)
      71  ???                           	0x000000010b706ddc 0 + 4486884828
      72  QtQml_debug                   	0x0000000105ec3f89 QV4::ExecutionContext::simpleCall(QV4::Scope&, QV4::CallData*, QV4::Function*) + 601 (qv4context.cpp:302)
      73  QtQml_debug                   	0x00000001060fd221 QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*, QV4::Scope&) + 785 (qqmljavascriptexpression.cpp:224)
      74  QtQml_debug                   	0x00000001060627e3 QQmlBoundSignalExpression::evaluate(void**) + 1459 (qqmlboundsignal.cpp:225)
      75  QtQml_debug                   	0x0000000106062f6e QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) + 382 (qqmlboundsignal.cpp:356)
      76  QtQml_debug                   	0x00000001060d506d QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) + 557 (qqmlnotifier.cpp:108)
      77  QtQml_debug                   	0x00000001060346b3 QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) + 1139
      78  QtCore_debug                  	0x0000000104924bce QMetaObject::activate(QObject*, int, int, void**) + 174 (qobject.cpp:3647)
      79  QtQml_debug                   	0x0000000106026556 QQmlVMEMetaObject::activate(QObject*, int, void**) + 86 (qqmlvmemetaobject.cpp:1244)
      80  QtQml_debug                   	0x0000000106029fd6 QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) + 4134 (qqmlvmemetaobject.cpp:841)
      81  QtCore_debug                  	0x00000001048d8327 QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) + 103 (qmetaobject.cpp:299)
      82  QtQml_debug                   	0x0000000106050c93 QQmlPropertyData::writeProperty(QObject*, void*, QFlags<QQmlPropertyData::WriteFlag>) const + 371 (qqmlpropertycache_p.h:324)
      83  QtQml_debug                   	0x000000010604f6fd QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlContextData*, QFlags<QQmlPropertyData::WriteFlag>) + 477 (qqmlproperty.cpp:1196)
      84  QtQml_debug                   	0x0000000105fe965c QV4::QObjectWrapper::setProperty(QV4::ExecutionEngine*, QObject*, QQmlPropertyData*, QV4::Value const&) + 5612 (qv4qobjectwrapper.cpp:550)
      85  QtQml_debug                   	0x0000000105fea363 QV4::QObjectWrapper::setProperty(QV4::ExecutionEngine*, QObject*, int, QV4::Value const&) + 291 (qv4qobjectwrapper.cpp:653)
      86  QtQml_debug                   	0x000000010601858e QV4::Runtime::method_setQmlScopeObjectProperty(QV4::ExecutionEngine*, QV4::Value const&, int, QV4::Value const&) + 94 (qv4runtime.cpp:1550)
      87  ???                           	0x000000010b706ba5 0 + 4486884261
      88  QtQml_debug                   	0x0000000105ec3f89 QV4::ExecutionContext::simpleCall(QV4::Scope&, QV4::CallData*, QV4::Function*) + 601 (qv4context.cpp:302)
      89  QtQml_debug                   	0x00000001060fd221 QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*, QV4::Scope&) + 785 (qqmljavascriptexpression.cpp:224)
      90  QtQml_debug                   	0x00000001060627e3 QQmlBoundSignalExpression::evaluate(void**) + 1459 (qqmlboundsignal.cpp:225)
      91  QtQml_debug                   	0x0000000106062f6e QQmlBoundSignal_callback(QQmlNotifierEndpoint*, void**) + 382 (qqmlboundsignal.cpp:356)
      92  QtQml_debug                   	0x00000001060d506d QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) + 557 (qqmlnotifier.cpp:108)
      93  QtQml_debug                   	0x000000010603a9e0 QQmlThreadNotifierProxyObject::qt_metacall(QMetaObject::Call, int, void**) + 240 (qqmlengine.cpp:790)
      94  QtCore_debug                  	0x00000001048d835d QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) + 157 (qmetaobject.cpp:301)
      95  QtCore_debug                  	0x000000010491a2e1 QMetaCallEvent::placeMetaCall(QObject*) + 193 (qobject.cpp:505)
      96  QtCore_debug                  	0x000000010491bf6a QObject::event(QEvent*) + 378 (qobject.cpp:1246)
      97  QtWidgets_debug               	0x0000000102ceca3f QApplicationPrivate::notify_helper(QObject*, QEvent*) + 431 (qapplication.cpp:3732)
      98  QtWidgets_debug               	0x0000000102ceeae7 QApplication::notify(QObject*, QEvent*) + 1495 (qapplication.cpp:3104)
      99  QtCore_debug                  	0x00000001048cda75 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 277 (qcoreapplication.cpp:1042)
      100 QtCore_debug                  	0x00000001048cf428 QCoreApplication::sendEvent(QObject*, QEvent*) + 56 (qcoreapplication.h:234)
      101 QtCore_debug                  	0x00000001048cf2b2 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 1378 (qcoreapplication.cpp:1717)
      102 QtCore_debug                  	0x00000001048ce50f QCoreApplication::sendPostedEvents(QObject*, int) + 47 (qcoreapplication.cpp:1572)
      103 libqcocoa_debug.dylib         	0x0000000109c9059e QCocoaEventDispatcherPrivate::processPostedEvents() + 302 (qcocoaeventdispatcher.mm:897)
      104 libqcocoa_debug.dylib         	0x0000000109c9141f QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void*) + 79 (qcocoaeventdispatcher.mm:920)
      105 com.apple.CoreFoundation      	0x00007fff539605a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
      106 com.apple.CoreFoundation      	0x00007fff53a1a35c __CFRunLoopDoSource0 + 108
      107 com.apple.CoreFoundation      	0x00007fff53943040 __CFRunLoopDoSources0 + 208
      108 com.apple.CoreFoundation      	0x00007fff539424bd __CFRunLoopRun + 1293
      109 com.apple.CoreFoundation      	0x00007fff53941d23 CFRunLoopRunSpecific + 483
      110 com.apple.HIToolbox           	0x00007fff52c59e26 RunCurrentEventLoopInMode + 286
      111 com.apple.HIToolbox           	0x00007fff52c59a9f ReceiveNextEventCommon + 366
      112 com.apple.HIToolbox           	0x00007fff52c59914 _BlockUntilNextEventMatchingListInModeWithFilter + 64
      113 com.apple.AppKit              	0x00007fff50f24f5f _DPSNextEvent + 2085
      114 com.apple.AppKit              	0x00007fff516bab4c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
      115 com.apple.AppKit              	0x00007fff50f19d6d -[NSApplication run] + 764
      116 libqcocoa_debug.dylib         	0x0000000109c8f245 QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1189 (qcocoaeventdispatcher.mm:430)
      117 QtCore_debug                  	0x00000001048c7c84 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 116 (qeventloop.cpp:134)
      118 QtCore_debug                  	0x00000001048c7e9c QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 508 (qeventloop.cpp:212)
      119 QtCore_debug                  	0x00000001048ce37c QCoreApplication::exec() + 380 (qcoreapplication.cpp:1330)
      120 QtGui_debug                   	0x000000010399ece6 QGuiApplication::exec() + 22 (qguiapplication.cpp:1687)
      121 com.yourcompany.tshnm         	0x0000000102616512 TshnmApplication::doRun(int&, char**) + 242 (TshnmApplication.cpp:197)
      122 libisle.1.dylib               	0x0000000102824a6f AbstractApplication::run(int&, char**) + 223 (AbstractApplication.cpp:43)
      123 com.yourcompany.tshnm         	0x00000001026228f7 main + 71 (main.cpp:17)
      124 libdyld.dylib                 	0x00007fff7b241115 start + 1
      
      main.cpp
      #include <QCoreApplication>
      #include <QQmlApplicationEngine>
      #include <QJSEngine>
      #include <QFile>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication app(argc, argv);
      
          QJSEngine jsEngine;
          QFile file(":/terry.js");
          if (!file.open(QIODevice::ReadOnly))
              return -1;
      
          jsEngine.evaluate(file.readAll());
          return 0;
      }
      
      terry.js
      function foo() {
          if (!!bar) {
              var options = [];
              options.push({ id: 1 });
              return;
          }
      
          options.push({ id: 4 });
      }
      

      Attachments

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

        Activity

          People

            erikv Erik Verbruggen
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes