Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.0 Beta
-
None
-
Mac 10.8, Qt Enterprise 5.3.1 (compiled from source locally), Qt Creator 3.1.2.
My colleagues have reproduced on Windows too, and I've reproduced with the binary Qt 5.3.1 that is bundled with Qt Enterprise.
-
8397f640e81f0eff1f6f32ae4a35d40f115ea339
Description
This is a regression I observed in QtCreator 3.1.2. It does not occur in 3.0.1.
ASSERT: "context->type == QV4::ExecutionContext::Type_GlobalContext" in file jsruntime\qv4debugging.cpp, line 522
The line of code is this:
Q_ASSERT(context->type == QV4::ExecutionContext::Type_GlobalContext);
When I first hit this problem, the value of context->type is actually “Type_CatchContext”. My breakpoint was not actually in a catch block but it was indeed in a try block, inside of a Component.onCompleted function.
Once I hit that assertion, QtCreator cannot continue debugging. I have to force-quit my app. Without any try/catch, the error never happens. The funny part is that the breakpoint doesn't need to be in the try/catch, but just in the same file.
Steps to create a project that reproduces:
1) File > New
2) Applications > Qt Quick Application, Choose...
3) Give it a simple name, Continue
4) Select Qt Quick 2.2
5) Select the built-in (e.g. "Desktop Qt 5.3 clang 64bit") bundled with Qt Creator
6) Add the following to the default main.qml:
Component.onCompleted: {
console.log("before try");
try
catch (e)
{ console.log("catch..."); } }
7) In project screen, uncheck C++ debugging, check QML debugging
8) Put a breakpoint anywhere in main.qml
9) Start debugging (Cmd-Y)
Observed: Crashes at maybeBreakAtInstruction
0 QV4::Debugging::Debugger::maybeBreakAtInstruction() QV4::Debugging::Debugger::maybeBreakAtInstruction() 0x1066a158e
1 QV4::Moth::VME::run(QV4::ExecutionContext*, unsigned char const*, void**) QV4::Moth::VME::run(QV4::ExecutionContext, unsigned char const*, void***) 0x10670be63
2 QV4::Moth::VME::exec(QV4::ExecutionContext*, unsigned char const*) QV4::Moth::VME::exec(QV4::ExecutionContext*, unsigned char const*) 0x10670bfe2
3 QV4::ScriptFunction::call(QV4::Managed*, QV4::CallData*) QV4::ScriptFunction::call(QV4::Managed*, QV4::CallData*) 0x1066c44e7
4 QQmlJavaScriptExpression::evaluate(QQmlContextData*, QV4::ValueRef, QV4::CallData*, bool*) QQmlJavaScriptExpression::evaluate(QQmlContextData*, QV4::ValueRef, QV4::CallData*,
bool*) 0x10679f341
5 QQmlBoundSignalExpression::evaluate(void*) QQmlBoundSignalExpression::evaluate(void*) 0x106748d1f
6 QQmlBoundSignal_callback(QQmlNoti!erEndpoint*, void*) QQmlBoundSignal_callback(QQmlNoti!erEndpoint, void**) 0x106749746
7 QQmlNoti!er::emitNotify(QQmlNoti!erEndpoint*, void*) QQmlNoti!er::emitNotify(QQmlNoti!erEndpoint, void**) 0x10678337c
8 QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void*) QQmlData::signalEmitted(QAbstractDeclarativeData, QObject*, int, void**) 0x106726443
9 QMetaObject::activate(QObject*, int, int, void*) QMetaObject::activate(QObject, int, int, void**) 0x105e0b017
10 QQmlObjectCreator::!nalize(QQmlInstantiationInterrupt&) QQmlObjectCreator::!nalize(QQmlInstantiationInterrupt&) 0x1067b4dd2
11 QQmlComponentPrivate::complete(QQmlEnginePrivate*, QQmlComponentPrivate::ConstructionState*) QQmlComponentPrivate::complete(QQmlEnginePrivate*,
QQmlComponentPrivate::ConstructionState*) 0x10673f31e
12 QQmlComponentPrivate::completeCreate() QQmlComponentPrivate::completeCreate() 0x10673d569
13 QQmlComponent::create(QQmlContext*) QQmlComponent::create(QQmlContext*) 0x10673eca2
14 QQuickView::continueExecute() QQuickView::continueExecute() 0x10630d5ae
15 QQuickViewPrivate::execute() QQuickViewPrivate::execute() 0x10630d4a6
16 main main.cpp 245 0x1000c0fe5
17 start start 0x10000e534