调试消息"传递给C运行时函数的无效参数"使用QtQuick

时间:2015-02-21 19:59:25

标签: c++ qt qt5 qt-quick qt5.4

我正在学习QtQuick,并遇到了一些我无法解释的问题。只是为了提供一些背景,我使用以下内容:

  • QtCreator 3.1.2 OpenSource
  • Qt 5.4使用带有posix线程和SEH的MinGW-64从源构建的调试库

我的QML如下所示:

import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.3

Window {
    visible: true
    width: 500
    height: 200

    GridLayout {
        id: mainGrid
        rows: 3
        columns: 2
        columnSpacing: 2
        rowSpacing: 2

        Label {
            text: "First Name:"
        }

        TextField {

        }
    }
}

示例似乎运行正常,但我在QtCreator'应用程序输出'中收到调试消息。控制台,包含以下文字:

"传递给C运行时函数的参数无效。"

我通过一次向窗口添加一个组件进行了一些测试,发现Label组件似乎导致出现此消息。

有没有人知道为什么会发生这种情况和/或知道如何让它消失?我应该关注这个消息吗?我担心这会导致我的申请中出现致命异常。

其他信息:

在找到Dennis Yurichev关于如何使用gdb(找到here)调试此错误的好文后,我能够生成以下堆栈跟踪。我还没有通过堆栈跟踪得出任何结论,但我想发布它,万一有人有兴趣帮我解决这个问题:

Breakpoint 1, 0x000007fefdbba9cc in OutputDebugStringA () from C:\Windows\system32\KernelBase.dll
(gdb) bt
#0  0x000007fefdbba9cc in OutputDebugStringA () from C:\Windows\system32\KernelBase.dll
#1  0x000007feff5b2478 in msvcrt!_assert () from C:\Windows\system32\msvcrt.dll
#2  0x000007feff5b249b in msvcrt!_invalid_parameter () from C:\Windows\system32\msvcrt.dll
#3  0x000007feff590ef2 in pow () from C:\Windows\system32\msvcrt.dll
#4  0x000007feff575b78 in msvcrt!_localtime64 () from C:\Windows\system32\msvcrt.dll
#5  0x000000000d78a617 in DaylightSavingTA (t=-62198737200000) at jsruntime\qv4dateobject.cpp:291
#6  0x000000000d78a6b8 in LocalTime (t=-62198737200000) at jsruntime\qv4dateobject.cpp:306
#7  0x000000000d78f2b5 in QV4::DatePrototype::method_getFullYear (ctx=0x22cc30) at jsruntime\qv4dateobject.cpp:864
#8  0x000000000d797823 in QV4::BuiltinFunction::call (that=0x383300, callData=0x18760290) at jsruntime\qv4functionobject.cpp:565
#9  0x000000000d941107 in QV4::Object::call (this=0x383300, d=0x18760290)
    at ../../include/QtQml/5.4.0/QtQml/private/../../../../../src/qml/jsruntime/qv4object_p.h:278
#10 0x000000000d7d1c37 in QV4::Runtime::callProperty (context=0x156e0120, name=0x2e1dd0, callData=0x18760290) at jsruntime\qv4runtime.cpp:930
#11 0x000000000d7c92b0 in QV4::Moth::VME::run (this=0x22d987, context=0x156e0120, code=0x1942d6f8 "", storeJumpTable=0x0) at jsruntime\qv4vme_moth.cpp:365
#12 0x000000000d7cd248 in QV4::Moth::VME::exec (ctxt=0x156e0120, code=0x1942d468 "\017\217|\r") at jsruntime\qv4vme_moth.cpp:734
#13 0x000000000d7b88df in QV4::QmlBindingWrapper::call (that=0x389680) at jsruntime\qv4script.cpp:108
#14 0x000000000d941107 in QV4::Object::call (this=0x389680, d=0x18760230)
    at ../../include/QtQml/5.4.0/QtQml/private/../../../../../src/qml/jsruntime/qv4object_p.h:278
#15 0x000000000d7b9ad7 in QV4::Script::run (this=0x194567a0) at jsruntime\qv4script.cpp:300
#16 0x000000000d8133d3 in QQmlScriptData::scriptValueForContext (this=0x19416530, parentCtxt=0x2b71ac70) at qml\qqmltypeloader.cpp:2643
#17 0x000000000d85247d in QQmlObjectCreator::create (this=0x22de20, subComponentIndex=-1, parent=0x0, interrupt=0x0) at qml\qqmlobjectcreator.cpp:216
#18 0x000000000d857fa1 in QQmlObjectCreator::createInstance (this=0x194f2190, index=2, parent=0x19481210, isContextObject=false)
    at qml\qqmlobjectcreator.cpp:1091
#19 0x000000000d855c62 in QQmlObjectCreator::setPropertyBinding (this=0x194f2190, property=0x194144e8, binding=0x194f1bbc) at qml\qqmlobjectcreator.cpp:774
#20 0x000000000d855751 in QQmlObjectCreator::setupBindings (this=0x194f2190, bindingsToSkip=...) at qml\qqmlobjectcreator.cpp:733
#21 0x000000000d8594e1 in QQmlObjectCreator::populateInstance (this=0x194f2190, index=1, instance=0x194f2790, bindingTarget=0x194f2790,
    valueTypeProperty=0x0, bindingsToSkip=...) at qml\qqmlobjectcreator.cpp:1348
#22 0x000000000d85883b in QQmlObjectCreator::createInstance (this=0x194f2190, index=1, parent=0x194f2790, isContextObject=false)
    at qml\qqmlobjectcreator.cpp:1184
#23 0x000000000d855c62 in QQmlObjectCreator::setPropertyBinding (this=0x194f2190, property=0x19482d18, binding=0x194f1ac8) at qml\qqmlobjectcreator.cpp:774
#24 0x000000000d855751 in QQmlObjectCreator::setupBindings (this=0x194f2190, bindingsToSkip=...) at qml\qqmlobjectcreator.cpp:733
#25 0x000000000d8594e1 in QQmlObjectCreator::populateInstance (this=0x194f2190, index=0, instance=0x0, bindingTarget=0xbaadf00dbaadf00d,
    valueTypeProperty=0x0, bindingsToSkip=...) at qml\qqmlobjectcreator.cpp:1348
#26 0x000000000d85883b in QQmlObjectCreator::createInstance (this=0x194f2190, index=0, parent=0x0, isContextObject=true) at qml\qqmlobjectcreator.cpp:1184
#27 0x000000000d852564 in QQmlObjectCreator::create (this=0x194f2190, subComponentIndex=-1, parent=0x0, interrupt=0x0) at qml\qqmlobjectcreator.cpp:222
#28 0x000000000d7f7076 in QQmlComponentPrivate::beginCreate (this=0x193af700, context=0x193ae530) at qml\qqmlcomponent.cpp:880
#29 0x000000000d7f6cc2 in QQmlComponent::beginCreate (this=0x193af6c0, publicContext=0x193a17c0) at qml\qqmlcomponent.cpp:829
#30 0x000000000d7f6c23 in QQmlComponent::create (this=0x193af6c0, context=0x193a17c0) at qml\qqmlcomponent.cpp:789
#31 0x000000000d84b38f in QQmlApplicationEnginePrivate::_q_finishLoad (this=0x155b4ab0, o=0x193af6c0) at qml\qqmlapplicationengine.cpp:130
#32 0x000000000d84b13a in QQmlApplicationEnginePrivate::startLoad (this=0x155b4ab0, url=..., data=..., dataFlag=false) at qml\qqmlapplicationengine.cpp:109
#33 0x000000000d84b68e in QQmlApplicationEngine::load (this=0x22fd90, url=...) at qml\qqmlapplicationengine.cpp:250
#34 0x0000000000401589 in qMain (argc=1, argv=0x15726a00) at ..\learnqtquick\main.cpp:9
#35 0x0000000000402e7d in WinMain () at qtmain_win.cpp:112
#36 0x00000000004013b5 in __tmainCRTStartup ()
#37 0x00000000004014c8 in WinMainCRTStartup () 

其他调试信息:

(gdb) run
Starting program: C:\Users\Chris\programming\build-learnqtquick-MinGW64-Debug\debug\learnqtquick.exe
[New Thread 5044.0x1284]
warning: QML debugging is enabled. Only use this in a safe environment.

[New Thread 5044.0x11dc]
[New Thread 5044.0x6ac]
[New Thread 5044.0x13e8]

Breakpoint 1, QV4::DateObject::Data::Data (this=0x3c48c0, engine=0x183560a0, date=...) at jsruntime/qv4dateobject_p.h:51
51                  value = date;
(gdb) print date->val
$1 = 4410089336627904512
(gdb) print date->doubleValue()
$2 = -62198737200000

怀疑来自qv4value_p.h

的错误代码
double doubleValue() const {
    Q_ASSERT(isDouble());
    union {
        quint64 i;
        double d;
    } v;
    v.i = val ^ NaNEncodeMask;
    return v.d;
}

...具体来说,在赋值v.i = val ^ NaNEncodeMask之后,以下是gdb调试器中的结果:

(gdb) print v.d
$7 = -62198737200000
(gdb) print v.i
$8 = 14036674277620695040

我不明白这个联盟如何能够从quint64到double的正确转换?任何人都可以解释他们这个代码的原作者试图实现的目标吗?

2015年2月28日发现的其他信息 - 显然,上面的信息仅适用于调试版本。我构建了此版本Qt5.4的发行版,无法复制该问题。然后切换回调试版本我再次重新创建了该问题。因此,我不会为此问题提交错误报告。相反,我正在寻找与MinGW64编译器套件中的调试相关的解释。

0 个答案:

没有答案