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

Q_ASSERT(engine->jsStackTop >= mark) sometimes fails

    XMLWordPrintable

Details

    • Linux/X11
    • dc60c305a20d518012d4f034c4fa2a7395ebf31f

    Description

      I have an app that was running perfectly fine with a debug build of Qt 6.8.0
      Since I've updated to Qt 6.8.1 it randomly crashes during application start.

      The crash always occurs because Q_ASSERT(engine->jsStackTop >= mark) in QV4::Scope::~Scope() fails, but not always at the exact same time as I can get different stack traces.

      Using git bisect I was able to track the cause back to this change: https://codereview.qt-project.org/c/qt/qtdeclarative/+/592656

      Here are a few examples of stacktraces:

      qAbort()
      qt_message_fatal<>()
      qt_message()
      QMessageLogger::fatal()
      qt_assert()
      QV4::Scope::~Scope()
      QQmlScriptData::handleOwnScriptValueOrExecutableCU<>()
      QQmlScriptData::ownScriptValue()
      QQmlScriptBlob::hasScriptValue()
      QQmlTypeLoader::injectedScript()
      QQmlTypeLoader::Blob::addScriptImport()
      QQmlTypeLoader::Blob::addImport()
      QQmlTypeLoader::Blob::addImport()
      QQmlTypeData::loadFromDiskCache()
      QQmlTypeData::tryLoadFromDiskCache()
      QQmlTypeData::dataReceived()
      QQmlTypeLoader::setData()
      QQmlTypeLoader::setData()
      QQmlTypeLoader::loadThread()
      PlainLoader::loadThread()
      QQmlTypeLoader::doLoad<>()
      QQmlTypeLoader::load()
      QQmlTypeLoader::getType()
      QQmlTypeData::resolveTypes()
      QQmlTypeData::allDependenciesDone()
      QQmlTypeLoader::setData()
      QQmlTypeLoader::setData()
      QQmlTypeLoader::loadThread()
      QQmlTypeLoaderThread::loadThread()
      std::__invoke_impl<>()
      std::__invoke<>()
      std::__apply_impl<>()
      std::apply<>()
      QQmlThread::createMessageFromMethod<>()::I::call()
      QQmlThreadPrivate::threadEvent()
      QQmlThreadPrivate::event()
      QApplicationPrivate::notify_helper()
      QApplication::notify()
      QCoreApplication::notifyInternal2()
      QCoreApplication::sendEvent()
      QCoreApplicationPrivate::sendPostedEvents()
      QCoreApplication::sendPostedEvents()
      postEventSourceDispatch()
      (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8000.0+0x5d5b4)
      (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8000.0+0xbc716)
      g_main_context_iteration
      QEventDispatcherGlib::processEvents()
      QEventLoop::processEvents()
      QEventLoop::exec()
      QThread::exec()
      QThread::run()
      QThreadPrivate::start()::$_1::operator()()
      (anonymous namespace)::terminate_on_exception<>()
      QThreadPrivate::start()
      (/usr/lib/x86_64-linux-gnu/libc.so.6+0x9ca93)
      (/usr/lib/x86_64-linux-gnu/libc.so.6+0x129c3b) 
      qt_assert()
      QV4::Scope::~Scope()
      QV4::QQmlContextWrapper::virtualPut()
      QV4::Object::put()
      QV4::ExecutionContext::setProperty()
      QV4::Runtime::StoreNameSloppy::call()
      <unknown> 
      qAbort()
      qt_message_fatal<>()
      qt_message()
      QMessageLogger::fatal()
      qt_assert()
      QV4::Scope::~Scope()
      toVariant()
      QV4::ExecutionEngine::toVariant()
      QQmlVMEMetaObject::readPropertyAsVariant()
      QQmlVMEMetaObject::metaCall()
      QMetaObject::metacall()
      QMetaProperty::read()
      getValueFromProperty()
      QQuickShaderEffectPrivate::updateShaderVars()
      QQuickShaderEffectPrivate::updateShader()
      QQuickShaderEffectPrivate::maybeUpdateShaders()
      QQuickShaderEffect::componentComplete()
      QQmlObjectCreator::finalize()
      QQmlIncubatorPrivate::incubate()
      QQmlEnginePrivate::incubate()
      QQmlComponent::create()
      QQuickLoaderPrivate::_q_sourceLoaded()
      QQuickLoaderPrivate::load()
      QQuickLoader::componentComplete()
      QQmlObjectCreator::finalize()
      QQmlIncubatorPrivate::incubate()
      QQmlEnginePrivate::incubate()
      QQmlComponentPrivate::incubateObject()
      QQmlDelegateModelPrivate::object()
      QQmlDelegateModel::object()
      QQuickRepeater::modelUpdated()
      QQuickRepeater::qt_static_metacall()
      QQuickRepeater::qt_metacall()
      QMetaObject::metacall()
      doActivate<>()
      QMetaObject::activate()
      QQmlInstanceModel::modelUpdated()
      QQmlDelegateModelPrivate::emitModelUpdated()
      QQmlDelegateModelGroupPrivate::emitModelUpdated()
      QQmlDelegateModelPrivate::emitChanges()
      QQmlDelegateModel::_q_itemsInserted()
      QQmlDelegateModel::_q_rowsInserted()
      QtPrivate::FunctorCall<>::call()::{lambda()#1}::operator()()
      QtPrivate::FunctorCallBase::call_internal<>()
      QtPrivate::FunctorCall<>::call()
      QtPrivate::FunctionPointer<>::call<>()
      QtPrivate::QCallableObject<>::impl()
      QtPrivate::QSlotObjectBase::call()
      doActivate<>()
      QMetaObject::activate()
      QAbstractItemModel::rowsInserted()
      QAbstractItemModel::endInsertRows() 

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            bterrier Benjamin Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes