PDA

View Full Version : qml PathView XmlListModel



waiter
10th January 2013, 08:28
hello,I use PathView with XmlListModel,but when I call model.reload,it Aborted

0 raise /lib64/libc.so.6 0 0x7ffff3cb0d95
1 abort /lib64/libc.so.6 0 0x7ffff3cb22ab
2 __libc_message /lib64/libc.so.6 0 0x7ffff3ceaece
3 malloc_printerr /lib64/libc.so.6 0 0x7ffff3cf0c06
4 _IO_new_file_seekoff /lib64/libc.so.6 0 0x7ffff3cec0e4
5 ftello64 /lib64/libc.so.6 0 0x7ffff3cea526
6 QFile::open(_IO_FILE*, QFlags<QIODevice::OpenModeFlag>, QFlags<QFile::FileHandleFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4ab9138
7 QFile::open(_IO_FILE*, QFlags<QIODevice::OpenModeFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4ab91ee
8 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff6279863
9 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff6278905
10 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff6252506
11 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff6269391
12 QXmlQuery::setQuery(QIODevice*, QUrl const&) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff626710d
13 QXmlQuery::setQuery(QString const&, QUrl const&) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff62671eb
14 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751810f
15 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff7519fb7
16 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751b1c9
17 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751bb31
18 QApplicationPrivate::notify_helper(QObject*, QEvent*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff509456c
19 QApplication::notify(QObject*, QEvent*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff5099a1d
20 QCoreApplication::notifyInternal(QObject*, QEvent*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b3530c

wysota
10th January 2013, 08:56
What's further in the backtrace?

waiter
12th January 2013, 02:49
0 raise /lib64/libc.so.6 0 0x7ffff3cb0d95
1 abort /lib64/libc.so.6 0 0x7ffff3cb22ab
2 __libc_message /lib64/libc.so.6 0 0x7ffff3ceaece
3 malloc_printerr /lib64/libc.so.6 0 0x7ffff3cf0c06
4 _IO_new_file_seekoff /lib64/libc.so.6 0 0x7ffff3cec0e4
5 ftello64 /lib64/libc.so.6 0 0x7ffff3cea526
6 QFile::open(_IO_FILE*, QFlags<QIODevice::OpenModeFlag>, QFlags<QFile::FileHandleFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4ab9138
7 QFile::open(_IO_FILE*, QFlags<QIODevice::OpenModeFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4ab91ee
8 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff64fd863
9 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff64fc905
10 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff64d6506
11 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff64ed391
12 QXmlQuery::setQuery(QIODevice*, QUrl const&) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff64eb10d
13 QXmlQuery::setQuery(QString const&, QUrl const&) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtXmlPatterns.so.4 0 0x7ffff64eb1eb
14 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751810f
15 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff7519fb7
16 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751b1c9
17 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751bb31
18 QApplicationPrivate::notify_helper(QObject*, QEvent*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff509456c
19 QApplication::notify(QObject*, QEvent*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff5099a1d
20 QCoreApplication::notifyInternal(QObject*, QEvent*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b3530c
21 QCoreApplicationPrivate::sendPostedEvents(QObject* , int, QThreadData*) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b39bf3
22 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b66cf3
23 g_main_context_dispatch /usr/lib64/libglib-2.0.so.0 0 0x7ffff35ae58d
24 ?? /usr/lib64/libglib-2.0.so.0 0 0x7ffff35aed88
25 g_main_context_iteration /usr/lib64/libglib-2.0.so.0 0 0x7ffff35aef59
26 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b66833
27 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b33ec2
28 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4b34334
29 QThread::exec() /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4a2974f
30 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtDeclarative.so.4 0 0x7ffff751bb96
31 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtCore.so.4 0 0x7ffff4a2ce7b
32 start_thread /lib64/libpthread.so.0 0 0x7ffff4789f05
33 clone /lib64/libc.so.6 0 0x7ffff3d5553d

wysota
12th January 2013, 09:38
Is your app a pure QML app or do you have any C++ code of your own too?

waiter
12th January 2013, 13:01
c++ and QML both, QML to query xml,and C++ modify the xml, it is ok to run,but when I try to load any other plugin (invoke dlopen() in linux),qDebug() could not output anything ,and then it crash,

wysota
12th January 2013, 13:07
Do you have threads in your application? If so, how are you using them?

waiter
12th January 2013, 14:12
Yes,a lot of threads created but no by QThread , and the other thread wont operate ui,they just operate network (onvif,cgi), sorry my poor English

wysota
12th January 2013, 16:26
It doesn't matter if they are QThread or not. What matters is if you're using them correctly. It might be one of them crashing and the backtrace you get is simply misleading. It looks like you are trying to run QtQuick in a thread. This is likely to fail.

waiter
13th January 2013, 04:24
I know run gui in an other thread will fail,but this time I just show the QDeclaretiveView(load in the gui main thread,if the gui thread try to load the other plugin ,it fails, but if I dont load the plugin ,the QDeclaretiveView shows ok. so I think the network plugin may change some environment that lead to the crash

Added after 5 minutes:

the QDeclarativeView above is a plugin, but it runs well alone.but just the other plugin loaded and then QDeclarativeView crash. and I dont think the backtrace is wrong,because every time is the same backtrace,

wysota
13th January 2013, 11:34
You can be getting the same backtrace because it can be crashing in the same place all the time. How many threads do you have? What do they do? Did you check the backtrace for each of them?

waiter
13th January 2013, 14:12
Yes,a lot of threads,I have checked each of the thread.
if I dont load the QDeclarativeView plugin, it also runs well. and if I only load QDeclarativeView plugin without the other, it runs well too.
but when I load both of them, it crash.so I guss maybe the other plugin change the environment that lead to the crash

Added after 7 minutes:

it crash on ftello64 ,so I think the running environment has changed,the qDebug couldnt output anything when I load the other plugin without loading the QDeclarativeView one. because the other plugin use wchar to stdout,and use a lot of xml to deal with onvif .
so it lead to the QDeclarativeView plugin crash

wysota
13th January 2013, 15:30
What is this other plugin? How are your threads related to plugins?

waiter
14th January 2013, 03:07
in Gui thread, I run

(1)
zz_ = new ZhengZhou();
if(zz_ == NULL)
{
return false;
}
zz_->Load();

(2)
QUiLoader loader;
if(loader.availableWidgets().contains("MapEditor"))
{
QWidget* mapEditor = loader.createWidget("MapEditor",wd);
mapEditor->show();
}

(3)
zz_ = new ZhengZhou();
if(zz_ == NULL)
{
return false;
}
zz_->Load();

QUiLoader loader;
if(loader.availableWidgets().contains("MapEditor"))
{
QWidget* mapEditor = loader.createWidget("MapEditor",wd);
mapEditor->show();
}

(1) and (2) runs well,but (3) crash when call mapEditor->show(); as you see the backtrace above

Added after 10 minutes:

int main(int argc, char *argv[])
{

wprintf(L"first");
QApplication a(argc, argv);
// ZhengZhou*zz_ = new ZhengZhou();
// if(zz_ == NULL)
// {
// return false;
// }
// zz_->Load();

// QUiLoader loader;
// if(loader.availableWidgets().contains("MapEditor") )
// {
// QWidget* mapEditor = loader.createWidget("MapEditor");
// mapEditor->show();
// }
return a.exec();

}

wysota
14th January 2013, 11:15
And what does ZhengZhou do? And where is QML in all this?

waiter
15th January 2013, 01:18
I found the ZhengZhou plugin Memory overflow,so I know the result, thanks a lot for you help!!!