Re: [Development] Shall we turn on /utf-8 compiler option when build qt for Windows?

2017-01-30 Thread Liang Jian
https://codereview.qt-project.org/#/c/183817/

On Mon, Jan 30, 2017 at 4:42 PM, Marc Mutz  wrote:

> On Monday 30 January 2017 02:21:57 Thiago Macieira wrote:
> > qCDebug(lcTuioSet) << "Processing SET for token " << classId << id
> << "
> > @  " << x << y << "∡" << angle <<
> >
> > That's easy to fix by using "\342\210\241" instead.
>
> Which is totally and utterly opaque. So much so that one feels forced to
> add a
> comment
>
>   // ∡
>
> but then MSVC complains, too.
>
> Lose-lose.
>
> The question really is: why does this come up only now? Is it because of
> MSVC2015, and does it thus mean that only compilers that provide the /utf-8
> option warn? In that case, the correct thing is to enable the option and
> leave
> UTF-8 chars in the source alone.
>
> Thanks,
> Marc
>
> --
> Marc Mutz  | Senior Software Engineer
> KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
> Tel: +49-30-521325470
> KDAB - The Qt, C++ and OpenGL Experts
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Shall we turn on /utf-8 compiler option when build qt for Windows?

2017-01-28 Thread Liang Jian
Start from qt-5.8 I can't build qt anymore under Windows(simplified
chinese locale). Since there is a file
src/plugins/generic/tuiotouch/qtuiohandler.cpp which contain non-latin-1
character, msvc2015 assume the source code's character set should be CP936
which make the complilation fail.
I can only build qt by comment the line which contain the specical
character in src/plugins/generic/tuiotouch/qtuiohandler.cpp.
But if I turn on -developer-build in configuration step, thing will get
worse than before, since -developer-build means treat warning as error, and
again I can't build qt anymore since there are other files contain
non-latin1 character (such as qstring.cpp), the build will fail due to the
character set warning.
I am working on a Windows 10 x64 simplifed chinese machine, msvc2015
update3
For more detail please refer to
https://bugreports.qt.io/browse/QTBUG-58161

As a workaround, I have to modify the file
qtbase/mkspecs/common/msvc-desktop.conf
QMAKE_CFLAGS= -nologo -Zc:wchar_t /utf-8
After I add /utf-8 compiler option the build goes well.
Shall we turn on this compiler option by default?
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-16 Thread Liang Jian
I would not to say "still reachable" simply means the allocation is not
leaked.
Think about the following senario: A programer allocate a big chunk of
memory from heap and hold it in a global variable, supposed that by design
this memory chunk will not used any more at some point and is aimed to be
released to save memory, but the programmer forget to free it, this memory
will be considered "still reachable" on exit but the fact is that this
behaviour do harm to the program since it will waste more memory when
running the program. This allocation should be considered as leak.
Maybe the "still reachable" memory allocations caused by not
destructing global variables of qt plugin will not do any harm to qt app,
but others may do harm, how can we easily distinguish the bad ones from the
good ones? I think the best approach is to make sure we release all memory
allocated from heap on exit.
BTW, not every memory leak detector can tell you which memory is "still
reachable", I used bulitin memory leak detector of debug version of msvcrt,
inspector from Intel and C++ memory leak detector from softwareverify.com,
they don't have the concept of "still reachable".
Anyway, I still consider that we should introduce a method to disable
the not unloading qt plugin feature at runtime, maybe we can only disable
this feature in a developer build of qt and that will not cause any crash
in a release build.


On Sat, Oct 15, 2016 at 11:48 PM, Thiago Macieira <thiago.macie...@intel.com
> wrote:

> Em sábado, 15 de outubro de 2016, às 15:33:53 PDT, Liang Jian escreveu:
> > But I am still curious about that If we don't unload the plugin, will
> > the destructor of the gobal object in it be called? If it is not called,
> > what if the gobal object of the plugin hold some memory allocated from
> heap?
>
> It's easy to test.
>
> In any case, I don't consider leaks those that happen because the memory
> wasn't freed at program exit while holding a pointer to it. In fact,
> neither
> does valgrind: those are "still reachable" allocations.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-15 Thread Liang Jian
Yes, you are right. After applying the patch from
https://codereview.qt-project.org/#/c/140750/ I didn't notice any leak
report under Windows.
Sorry for the noise.

But I am still curious about that If we don't unload the plugin, will
the destructor of the gobal object in it be called? If it is not called,
what if the gobal object of the plugin hold some memory allocated from heap?

On Sat, Oct 15, 2016 at 2:07 AM, Thiago Macieira <thiago.macie...@intel.com>
wrote:

> Em sexta-feira, 14 de outubro de 2016, às 16:08:27 PDT, Liang Jian
> escreveu:
> > I don't care custom plugin, What I care is the plugins loaded by qt
> > itself, such as qpa plugin, images format plugins ..., These plugins are
> > needed for all qt programs, we can't avoid the leaks caused by not
> > unloading these plugins if my understanding to this issue is right (Maybe
> > you don't think that are leaks but they will confuse memory leak
> detector),
> > that is why I hope to introduce a method to disable this feature at
> runtime.
>
> What do you prefer?
>
> 1) leak
> 2) crash and leak
>
> Either way, the dlclose() call will not happen.
>
> Note that this has nothing to do with freeing memory. Only the dlclose().
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-14 Thread Liang Jian
I don't care custom plugin, What I care is the plugins loaded by qt
itself, such as qpa plugin, images format plugins ..., These plugins are
needed for all qt programs, we can't avoid the leaks caused by not
unloading these plugins if my understanding to this issue is right (Maybe
you don't think that are leaks but they will confuse memory leak detector),
that is why I hope to introduce a method to disable this feature at runtime.

On Fri, Oct 14, 2016 at 1:10 PM, Thiago Macieira <thiago.macie...@intel.com>
wrote:

> Em sexta-feira, 14 de outubro de 2016, às 09:11:48 CEST, Liang Jian
> escreveu:
> > It is a pity that qt develpers have made the dicision of not
> unloading
> > plugins and I have to accept the reality.
> > But I think we should at least  introduce a method to disable this
> > feature at runtime (such as through a enviroment variable) ?
>
> Use QLibrary for your own plugins.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-13 Thread Liang Jian
It is a pity that qt develpers have made the dicision of not unloading
plugins and I have to accept the reality.
But I think we should at least  introduce a method to disable this
feature at runtime (such as through a enviroment variable) ?

On Thu, Oct 13, 2016 at 11:16 PM, Thiago Macieira <thiago.macie...@intel.com
> wrote:

> Em quinta-feira, 13 de outubro de 2016, às 22:00:35 CEST, Liang Jian
> escreveu:
> > Not unloading plugin is really a bad idea.
> > That will make any memory leak detector report tons of leaks even
> run a
> > simplest qt widgets program. Find and fix 'real' memory leak will be much
> > harder than before.
>
> The decision is already taken: Qt has stopped unloading plugins in Qt 5.7.
>
> The question here is what we should do in 5.6.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Backporting the "stop unloading plugins" change to 5.6

2016-10-13 Thread Liang Jian
Not unloading plugin is really a bad idea.
That will make any memory leak detector report tons of leaks even run a
simplest qt widgets program. Find and fix 'real' memory leak will be much
harder than before.

On Thursday, October 13, 2016, Thiago Macieira 
wrote:

> Em quarta-feira, 12 de outubro de 2016, às 22:28:33 CEST, André Pönitz
> escreveu:
> > On Wed, Oct 12, 2016 at 09:59:06PM +0200, Thiago Macieira wrote:
> > > Hello
> > >
> > > We've got a number of issues that got fixed in 5.7 by the change that
> made
> > > QFactoryLoader stop unloading plugins (notably,
> >
> > Not unloading plugins is not a fix.
>
> No, it's a workaround. But I'm at a loss to fix the current issue.
>
> The issue at hand is that the plugin was unloaded between a slot being
> invoked
> in a queued connection and the object that would receive the event getting
> deleted. When deleting the object, the events queued to it are deleted.
> When
> metacall events are deleted, the parameters stored in it are destroyed. In
> order for QMetaType to destroy such a type, it needs to call the destroying
> functions registered with it.
>
> Since we do allow breaking of ODR because of hidden visibility / DLLs, the
> functions in question may have belonged to the plugin that was unloaded,
> even
> if the type wasn't exclusive to that plugin.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> ___
> Development mailing list
> Development@qt-project.org 
> http://lists.qt-project.org/mailman/listinfo/development
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] [Qt-5.6] leak of QtSharedPointer::ExternalRefCountData objects

2015-11-18 Thread Liang Jian
I have submited a patch to fix this issue:
https://codereview.qt-project.org/#/c/141311/

On Mon, Nov 16, 2015 at 11:01 PM, Liang Jian <jianlian...@gmail.com> wrote:

> The allocated QV4::QObjectWrapper object hold a QPointer which track
> 'instance', it seems that it should be destroyed with 
> QObjectWrapper::destroyObject()
> to properly destruct the QPointer in it in QV4::MemoryManager::sweep().
> But when sweep() is being called it couldn't find the QObjectWrapper
> object created before which will make the QPointer in it not destructed
> properly.
>
> On Sun, Nov 15, 2015 at 11:58 PM, Liang Jian <jianlian...@gmail.com>
> wrote:
>
>> After some further investigation I can now confirm that one of the
>> leak is caused by the following code in QQmlObjectCreator::createInstance(),
>> qqmlobjectcreator.cpp:
>>
>> *sharedState->allJavaScriptObjects = QV4::QObjectWrapper::wrap(v4,
>> instance);
>>
>>   ++sharedState->allJavaScriptObjects;
>>
>>
>> But the reason is still unknown
>>
>>
>>
>> On Sun, Nov 15, 2015 at 10:19 PM, Liang Jian <jianlian...@gmail.com>
>> wrote:
>>
>>>   Hello everyone, I checkout qt 5.6 branch yesterday in my windows
>>> 10 x64 machine, I build it and run my program and see many leaks. Then I
>>> use C++ Memory Validator to find the source of the leaks, I can now
>>> confirm the leaked objects are QtSharedPointer::ExternalRefCountData which
>>> are created in QQmlObjectCreator::createInstance(), qqmlobjectcreator.cpp
>>> Line 1049, below is the call stack printed by C++ Memory Validator:
>>>
>>>Qt5Cored.dll  QtSharedPointer::ExternalRefCountData::getAndRef :
>>> [d:\qt5\qtbase\src\corelib\tools\qsharedpointer.cpp Line 1337]
>>>
>>>Qt5Qmld.dll  QWeakPointer::QWeakPointer :
>>> [d:\qt5\qtbase\src\corelib\tools\qsharedpointer_impl.h Line 706]
>>>
>>>Qt5Qmld.dll  QPointer::QPointer :
>>> [d:\qt5\qtbase\src\corelib\kernel\qpointer.h Line 65]
>>>
>>>Qt5Qmld.dll  QQmlObjectCreator::createInstance :
>>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 1049]
>>> 1044 : QQmlData *ddata = QQmlData::get(instance,
>>> /*create*/true);
>>> 1045 : ddata->rootObjectInCreation = true;
>>> 1046 :
>>> sharedState->rootContext->isRootObjectInCreation = false;
>>> 1047 : }
>>> 1048 :
>>> 1049 : sharedState->allCreatedObjects.push(instance);
>>> 1050 : } else {
>>> 1051 : Q_ASSERT(typeRef->component);
>>> 1052 : Q_QML_OC_PROFILE(sharedState->profiler,
>>> profiler.update(typeRef->component->fileName(),
>>> 1053 : context->url(), obj->location.line,
>>> obj->location.column));
>>> 1054 : if
>>> (typeRef->component->compilationUnit->data->isSingleton())
>>>Qt5Qmld.dll  QQmlObjectCreator::create :
>>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 197]
>>>
>>>Qt5Qmld.dll  QQmlComponentPrivate::beginCreate :
>>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 863]
>>>
>>>Qt5Qmld.dll  QQmlComponent::beginCreate :
>>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 812]
>>>
>>>Qt5Qmld.dll  QQmlComponent::create :
>>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 772]
>>>
>>>Qt5Quickd.dll  QQuickView::continueExecute :
>>> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 486]
>>>
>>>Qt5Quickd.dll  QQuickViewPrivate::execute :
>>> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 127]
>>>
>>>Qt5Quickd.dll  QQuickView::setSource :
>>> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 256]
>>>
>>>
>>> All the leaked QtSharedPointer::ExternalRefCountData objects are
>>> allocated in the line
>>> sharedState->allCreatedObjects.push(instance);
>>> then some other code path will also use QPointer (contained in some
>>> structures allocated by v4mm) to track the same object 'instance' and I
>>> guess the QPointer wasn't properly destructed which will cause the 
>>> QtSharedPointer::ExternalRefCountData
>>> not deleted.
>>> I have investigated this issue for nearly one day, but I can't find
>>> which code cause the leak, this is a non-trivial leak, I hope somebody can
>>> help to find the source of the leak. thanks!
>>>
>>>
>>
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] [Qt-5.6] leak of QtSharedPointer::ExternalRefCountData objects

2015-11-16 Thread Liang Jian
The allocated QV4::QObjectWrapper object hold a QPointer which track
'instance', it seems that it should be destroyed with
QObjectWrapper::destroyObject()
to properly destruct the QPointer in it in QV4::MemoryManager::sweep(). But
when sweep() is being called it couldn't find the QObjectWrapper object
created before which will make the QPointer in it not destructed properly.

On Sun, Nov 15, 2015 at 11:58 PM, Liang Jian <jianlian...@gmail.com> wrote:

> After some further investigation I can now confirm that one of the
> leak is caused by the following code in QQmlObjectCreator::createInstance(),
> qqmlobjectcreator.cpp:
>
> *sharedState->allJavaScriptObjects = QV4::QObjectWrapper::wrap(v4,
> instance);
>
>   ++sharedState->allJavaScriptObjects;
>
>
> But the reason is still unknown
>
>
>
> On Sun, Nov 15, 2015 at 10:19 PM, Liang Jian <jianlian...@gmail.com>
> wrote:
>
>>   Hello everyone, I checkout qt 5.6 branch yesterday in my windows 10
>> x64 machine, I build it and run my program and see many leaks. Then I use C++
>> Memory Validator to find the source of the leaks, I can now confirm the
>> leaked objects are QtSharedPointer::ExternalRefCountData which are created
>> in QQmlObjectCreator::createInstance(), qqmlobjectcreator.cpp Line 1049,
>> below is the call stack printed by C++ Memory Validator:
>>
>>Qt5Cored.dll  QtSharedPointer::ExternalRefCountData::getAndRef :
>> [d:\qt5\qtbase\src\corelib\tools\qsharedpointer.cpp Line 1337]
>>
>>Qt5Qmld.dll  QWeakPointer::QWeakPointer :
>> [d:\qt5\qtbase\src\corelib\tools\qsharedpointer_impl.h Line 706]
>>
>>Qt5Qmld.dll  QPointer::QPointer :
>> [d:\qt5\qtbase\src\corelib\kernel\qpointer.h Line 65]
>>
>>Qt5Qmld.dll  QQmlObjectCreator::createInstance :
>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 1049]
>> 1044 : QQmlData *ddata = QQmlData::get(instance,
>> /*create*/true);
>> 1045 : ddata->rootObjectInCreation = true;
>> 1046 :
>> sharedState->rootContext->isRootObjectInCreation = false;
>> 1047 : }
>> 1048 :
>> 1049 : sharedState->allCreatedObjects.push(instance);
>> 1050 : } else {
>> 1051 : Q_ASSERT(typeRef->component);
>> 1052 : Q_QML_OC_PROFILE(sharedState->profiler,
>> profiler.update(typeRef->component->fileName(),
>> 1053 : context->url(), obj->location.line,
>> obj->location.column));
>> 1054 : if
>> (typeRef->component->compilationUnit->data->isSingleton())
>>Qt5Qmld.dll  QQmlObjectCreator::create :
>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 197]
>>
>>Qt5Qmld.dll  QQmlComponentPrivate::beginCreate :
>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 863]
>>
>>Qt5Qmld.dll  QQmlComponent::beginCreate :
>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 812]
>>
>>Qt5Qmld.dll  QQmlComponent::create :
>> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 772]
>>
>>Qt5Quickd.dll  QQuickView::continueExecute :
>> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 486]
>>
>>Qt5Quickd.dll  QQuickViewPrivate::execute :
>> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 127]
>>
>>Qt5Quickd.dll  QQuickView::setSource :
>> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 256]
>>
>>
>> All the leaked QtSharedPointer::ExternalRefCountData objects are
>> allocated in the line
>> sharedState->allCreatedObjects.push(instance);
>> then some other code path will also use QPointer (contained in some
>> structures allocated by v4mm) to track the same object 'instance' and I
>> guess the QPointer wasn't properly destructed which will cause the 
>> QtSharedPointer::ExternalRefCountData
>> not deleted.
>> I have investigated this issue for nearly one day, but I can't find
>> which code cause the leak, this is a non-trivial leak, I hope somebody can
>> help to find the source of the leak. thanks!
>>
>>
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] [Qt-5.6] leak of QtSharedPointer::ExternalRefCountData objects

2015-11-15 Thread Liang Jian
  Hello everyone, I checkout qt 5.6 branch yesterday in my windows 10
x64 machine, I build it and run my program and see many leaks. Then I use C++
Memory Validator to find the source of the leaks, I can now confirm the
leaked objects are QtSharedPointer::ExternalRefCountData which are created
in QQmlObjectCreator::createInstance(), qqmlobjectcreator.cpp Line 1049,
below is the call stack printed by C++ Memory Validator:

   Qt5Cored.dll  QtSharedPointer::ExternalRefCountData::getAndRef :
[d:\qt5\qtbase\src\corelib\tools\qsharedpointer.cpp Line 1337]

   Qt5Qmld.dll  QWeakPointer::QWeakPointer :
[d:\qt5\qtbase\src\corelib\tools\qsharedpointer_impl.h Line 706]

   Qt5Qmld.dll  QPointer::QPointer :
[d:\qt5\qtbase\src\corelib\kernel\qpointer.h Line 65]

   Qt5Qmld.dll  QQmlObjectCreator::createInstance :
[d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 1049]
1044 : QQmlData *ddata = QQmlData::get(instance,
/*create*/true);
1045 : ddata->rootObjectInCreation = true;
1046 : sharedState->rootContext->isRootObjectInCreation
= false;
1047 : }
1048 :
1049 : sharedState->allCreatedObjects.push(instance);
1050 : } else {
1051 : Q_ASSERT(typeRef->component);
1052 : Q_QML_OC_PROFILE(sharedState->profiler,
profiler.update(typeRef->component->fileName(),
1053 : context->url(), obj->location.line,
obj->location.column));
1054 : if
(typeRef->component->compilationUnit->data->isSingleton())
   Qt5Qmld.dll  QQmlObjectCreator::create :
[d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 197]

   Qt5Qmld.dll  QQmlComponentPrivate::beginCreate :
[d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 863]

   Qt5Qmld.dll  QQmlComponent::beginCreate :
[d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 812]

   Qt5Qmld.dll  QQmlComponent::create :
[d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 772]

   Qt5Quickd.dll  QQuickView::continueExecute :
[d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 486]

   Qt5Quickd.dll  QQuickViewPrivate::execute :
[d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 127]

   Qt5Quickd.dll  QQuickView::setSource :
[d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 256]


All the leaked QtSharedPointer::ExternalRefCountData objects are
allocated in the line
sharedState->allCreatedObjects.push(instance);
then some other code path will also use QPointer (contained in some
structures allocated by v4mm) to track the same object 'instance' and I
guess the QPointer wasn't properly destructed which will cause the
QtSharedPointer::ExternalRefCountData
not deleted.
I have investigated this issue for nearly one day, but I can't find
which code cause the leak, this is a non-trivial leak, I hope somebody can
help to find the source of the leak. thanks!
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] [Qt-5.6] leak of QtSharedPointer::ExternalRefCountData objects

2015-11-15 Thread Liang Jian
After some further investigation I can now confirm that one of the leak
is caused by the following code in QQmlObjectCreator::createInstance(),
qqmlobjectcreator.cpp:

*sharedState->allJavaScriptObjects = QV4::QObjectWrapper::wrap(v4,
instance);

  ++sharedState->allJavaScriptObjects;


But the reason is still unknown



On Sun, Nov 15, 2015 at 10:19 PM, Liang Jian <jianlian...@gmail.com> wrote:

>   Hello everyone, I checkout qt 5.6 branch yesterday in my windows 10
> x64 machine, I build it and run my program and see many leaks. Then I use C++
> Memory Validator to find the source of the leaks, I can now confirm the
> leaked objects are QtSharedPointer::ExternalRefCountData which are created
> in QQmlObjectCreator::createInstance(), qqmlobjectcreator.cpp Line 1049,
> below is the call stack printed by C++ Memory Validator:
>
>Qt5Cored.dll  QtSharedPointer::ExternalRefCountData::getAndRef :
> [d:\qt5\qtbase\src\corelib\tools\qsharedpointer.cpp Line 1337]
>
>Qt5Qmld.dll  QWeakPointer::QWeakPointer :
> [d:\qt5\qtbase\src\corelib\tools\qsharedpointer_impl.h Line 706]
>
>Qt5Qmld.dll  QPointer::QPointer :
> [d:\qt5\qtbase\src\corelib\kernel\qpointer.h Line 65]
>
>Qt5Qmld.dll  QQmlObjectCreator::createInstance :
> [d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 1049]
> 1044 : QQmlData *ddata = QQmlData::get(instance,
> /*create*/true);
> 1045 : ddata->rootObjectInCreation = true;
> 1046 :
> sharedState->rootContext->isRootObjectInCreation = false;
> 1047 : }
> 1048 :
> 1049 : sharedState->allCreatedObjects.push(instance);
> 1050 : } else {
> 1051 : Q_ASSERT(typeRef->component);
> 1052 : Q_QML_OC_PROFILE(sharedState->profiler,
> profiler.update(typeRef->component->fileName(),
> 1053 : context->url(), obj->location.line,
> obj->location.column));
> 1054 : if
> (typeRef->component->compilationUnit->data->isSingleton())
>Qt5Qmld.dll  QQmlObjectCreator::create :
> [d:\qt5\qtdeclarative\src\qml\qml\qqmlobjectcreator.cpp Line 197]
>
>Qt5Qmld.dll  QQmlComponentPrivate::beginCreate :
> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 863]
>
>Qt5Qmld.dll  QQmlComponent::beginCreate :
> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 812]
>
>Qt5Qmld.dll  QQmlComponent::create :
> [d:\qt5\qtdeclarative\src\qml\qml\qqmlcomponent.cpp Line 772]
>
>Qt5Quickd.dll  QQuickView::continueExecute :
> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 486]
>
>Qt5Quickd.dll  QQuickViewPrivate::execute :
> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 127]
>
>Qt5Quickd.dll  QQuickView::setSource :
> [d:\qt5\qtdeclarative\src\quick\items\qquickview.cpp Line 256]
>
>
> All the leaked QtSharedPointer::ExternalRefCountData objects are
> allocated in the line
> sharedState->allCreatedObjects.push(instance);
> then some other code path will also use QPointer (contained in some
> structures allocated by v4mm) to track the same object 'instance' and I
> guess the QPointer wasn't properly destructed which will cause the 
> QtSharedPointer::ExternalRefCountData
> not deleted.
> I have investigated this issue for nearly one day, but I can't find
> which code cause the leak, this is a non-trivial leak, I hope somebody can
> help to find the source of the leak. thanks!
>
>
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] -Winconsistent-missing-override warning with latest Xcode and Qt 5.5

2015-07-02 Thread Liang Jian
Thanks for the reply.
I think I have to modify the Qt header file to solve this issue.

On Thu, Jul 2, 2015 at 3:09 PM, Bo Thorsen b...@vikingsoft.eu wrote:

 Den 01-07-2015 kl. 18:36 skrev Edward Sutton:
  Is there a work-around I could use in my Qt project file?
 
  Upgrade to 5.5.1. It's already fixed.
 
  The problem was not deemed important enough to affect the 5.5.0
 release.
 
 
  My Chicago based sales rep told me that ( somewhere buried in my license
  fine print ) I could not release software using unreleased versions of
  Qt Enterprise.

 Your boss should tell you not to release software based on a 2 day old
 x.y.0 release.

 Bo Thorsen,
 Director, Viking Software.

 --
 Viking Software
 Qt and C++ developers for hire
 http://www.vikingsoft.eu
 ___
 Development mailing list
 Development@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/development

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] New Qt 5.4.1 snapshot available

2015-02-18 Thread Liang Jian
Can you merge https://codereview.qt-project.org/#/c/105855/ into 5.4.1
before 5.4.1 releaded. It fix a showstopper issue to run apps in Android
5.0+

On Wed, Feb 18, 2015 at 1:52 PM, Heikkinen Jani 
jani.heikki...@theqtcompany.com wrote:

  Hi all,


  We have new Qt 5.4.1 snapshot available:


  Windows: http://download.qt.io/snapshots/qt/5.4/5.4.1/2015-02-17_112/

 Linux: http://download.qt.io/snapshots/qt/5.4/5.4.1/2015-02-17_116/

 Mac: http://download.qt.io/snapshots/qt/5.4/5.4.1/2015-02-17_102/


  Please sanitycheck these packages  inform me immediately if there is
 something broken which prevents us releasing these packages as Qt 5.4.1
 release later this week


  br,

 Jani

 ___
 Development mailing list
 Development@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/development


___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Please take a look at QTBUG-41197 before releasing Qt5.3.2

2014-09-08 Thread Liang Jian
https://bugreports.qt-project.org/browse/QTBUG-41197
This is a severe issue we recently found under androind. Thanks!
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] How can I perfrom some image processing before record camera image to a video file?

2013-12-20 Thread Liang Jian
First I know I should have post this question in qt-interest, but each
time I sent a mail to qt-inter...@qt-projct.org
qt-inter...@qt-project.orgI will got a mail delivery failed message,
so I have to post my question in
this mailing list to seek for help:
Recenty I am learning QtMultiMedia module, It's really easy to write a
prgram to capture camera image into a file using QCamera and QMediaRecorder
class. But I want to know that is it possible for me to do some image
processing to the data catpured by the camera beofore recording to a file?
Thanks!
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] How can I use a proxy to push change to codereview.qt-project.org?

2013-12-13 Thread Liang Jian
I used to be pushing changes to be code reviewed using the following
command:
git push 
ssh://jianlian...@codereview.qt-project.org:29418/qt/qtbaseHEAD:ref/for/stable
That works fine before, but today after I type the command there is not
any response for half an hour, I think this is due to network problem,
maybe due to the china's great firewall or something else. How can I use a
proxy to push change? Thanks
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] I can't build Qt5 of stable branch under linux

2013-03-23 Thread liang jian
I recently found that I can't build Qt5 of stable branch under
linux, but dev branch is ok.
I have a ubuntu 12.10 machine, I got the latest Qt5 code from git,
the build command is as follows:

./configure -developer-build -opensource -confirm-license
-no-gtkstyle -nomake examples -nomake tests
make -j 4

the build process failed in qtbase, the error message is listed below:

cd src/  ( test -e Makefile ||
/mnt/sda7/liang/qt/qt5/qtbase/bin/qmake
/mnt/sda7/liang/qt/qt5/qtbase/src/src.pro -o Makefile )  make -f
Makefile
make[1]: 正在进入目录 `/mnt/sda7/liang/qt/qt5/qtbase/src'
cd tools/bootstrap/  ( test -e Makefile ||
/mnt/sda7/liang/qt/qt5/qtbase/bin/qmake
/mnt/sda7/liang/qt/qt5/qtbase/src/tools/bootstrap/bootstrap.pro -o
Makefile )  make -f Makefile
make[2]: 正在进入目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/tools/bootstrap'
make[2]: 没有什么可以做的为 `first'。
make[2]:正在离开目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/tools/bootstrap'
cd tools/moc/  ( test -e Makefile ||
/mnt/sda7/liang/qt/qt5/qtbase/bin/qmake
/mnt/sda7/liang/qt/qt5/qtbase/src/tools/moc/moc.pro -o Makefile ) 
make -f Makefile
make[2]: 正在进入目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/tools/moc'
make[2]: 没有什么可以做的为 `first'。
make[2]:正在离开目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/tools/moc'
cd tools/rcc/  ( test -e Makefile ||
/mnt/sda7/liang/qt/qt5/qtbase/bin/qmake
/mnt/sda7/liang/qt/qt5/qtbase/src/tools/rcc/rcc.pro -o Makefile ) 
make -f Makefile
make[2]: 正在进入目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/tools/rcc'
make[2]: 没有什么可以做的为 `first'。
make[2]:正在离开目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/tools/rcc'
cd corelib/  ( test -e Makefile ||
/mnt/sda7/liang/qt/qt5/qtbase/bin/qmake
/mnt/sda7/liang/qt/qt5/qtbase/src/corelib/corelib.pro -o Makefile ) 
make -f Makefile
make[2]: 正在进入目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/corelib'
/mnt/sda7/liang/qt/qt5/qtbase/bin/moc -DQT_NO_LIBUDEV
-DQT_NO_XKBCOMMON -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB
-DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS
-DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS
-DQT_DISABLE_DEPRECATED_BEFORE=0x05 -DELF_INTERPRETER=\\
-DPCRE_HAVE_CONFIG_H -DQT_CORE_LIB -D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++-64 -I. -I../../include
-I../../include/QtCore -I../../include/QtCore/5.1.0
-I../../include/QtCore/5.1.0/QtCore -Iglobal -I../3rdparty/pcre
-I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4
-I../3rdparty/sha3 -I.moc/debug-shared
-IIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../:/lib/:/usr/lib/
-IOLLECT_GCC_OPTIONS='-m64' '-pipe' '-E' '-v' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
-IOMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/
-I/usr/include -I/usr/include/c++/4.7 -I/usr/include/c++/4.7/backward
-I/usr/include/c++/4.7/x86_64-linux-gnu
-I/usr/include/x86_64-linux-gnu
-I/usr/lib/gcc/x86_64-linux-gnu/4.7/include
-I/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed -I/usr/local/include
-I��索列表结束。 animation/qabstractanimation.h -o
.moc/debug-shared/moc_qabstractanimation.cpp
Qt Meta Object Compiler version 67 (Qt 5.1.0)
make[2]: *** [.moc/debug-shared/moc_qabstractanimation.cpp] 错误 1
make[2]:正在离开目录 `/mnt/sda7/liang/qt/qt5/qtbase/src/corelib'
make[1]: *** [sub-corelib-make_first] 错误 2
make[1]:正在离开目录 `/mnt/sda7/liang/qt/qt5/qtbase/src'
make: *** [sub-src-make_first] 错误 2

I think this error is something related to my chinese language
environment, since there is some invalid character in moc command line
option -I
Does any
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] What is fastest way to checkout stable branch for every submodule for qt5 repository?

2012-12-21 Thread liang jian
I have an old clone of qt5 which have only master branch, to
update this clone I use the following command:

git pull
git branch stable origin/stable
git submodule foreach --recursive 'git checkout stable'

The third command will fail since there is no stable branch in
qtqa, I have to checkout stable branch one by one for each
sub-repository.
Is there any faster way to do this ? I know this is a stupid
question, but I really don't know how to achieve that.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] [QT5] System fonts are not loaded in ubuntu 12.04

2012-05-05 Thread liang jian
I have built Qt 5 in ubuntu 12.04, The simplified chinese
character can't be displayed.
I found that in QBaseFontDatabase::popluateFontDatabase() the font
path returned by fontDir() is /mnt/sda8/liang/qt5/qtbase/lib/fonts/
which is the path I built my Qt5, there are several fonts file in this
directory but there are no chinese font files. As a result of this,
the system font installed on my ubuntu 12.04 was not loaded and the
simplified chinese character can't be displayed.
In Qt5 Windows platform, there is a classe named
QWindowsFontDatabase which is a subclass of QPlatformFontDatabase
which will search Windows Font using Windows API, I there any way to
search system fonts in XCB?
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Why there is no Change-Id when I commit in qt4.8?

2012-02-22 Thread liang jian
Hi, everyone,
Recently I pushed two changes to Qt project for Qt5, I want them
also be pushed to Qt4.8, so I change the code in my qt4 repository
(cloned from gitorious.org), and try to commit it, To my surprise, the
commit message doesn't contain the Change-Id (I have copy the
commit-msg to .git/hooks). Do I forget something about setup my
development environment?
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development