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  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 
> 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] How does mktime() handle DST transitions ?

2015-11-16 Thread Mandeep Sandhu
Hey Eddy,

Here's the response from my OSX 10.10.4 (Time Zone: Pacific Standard
Time (PST) -0800 UTC UTC/GMT).

$ ./mktime
Studying DST transitions in system default time-zone

Testing spring forward
Initial: Sun Mar  8 02:30:00 2015

Accepted: 1425810600
Ignorant of DST (-> 1): Sun Mar  8 03:30:00 2015
Accepted: 1425810600
Claiming no DST (-> 1): Sun Mar  8 03:30:00 2015

Accepted: 1425807000
Claiming DST (-> 0): Sun Mar  8 01:30:00 2015


Testing fall backward
Initial: Sun Nov  1 01:30:00 2015

Accepted: 1446366600
Ignorant of DST (-> 1): Sun Nov  1 01:30:00 2015
Accepted: 1446367200
Ignorant of DST (-> 1): Sun Nov  1 01:40:00 2015
Accepted: 1446370860
Ignorant of DST (-> 0): Sun Nov  1 01:41:00 2015
Accepted: 1446370200
Claiming no DST (-> 0): Sun Nov  1 01:30:00 2015

Accepted: 1446366600
Claiming DST (-> 1): Sun Nov  1 01:30:00 2015

$

HTH,
-mandeep




On Fri, Nov 6, 2015 at 4:34 AM, Welbourne Edward
 wrote:
>> If you're willing to compile and run the attached simple C program,
>> please let me know its output and your platform's details - ideally
>> off-list - I'll give a summary in a few days' time.
>
> Thanks to those who responded, I now know:
>  * that all the platforms below do the same thing if tm_isdst is 0 or 1 (Yay 
> !)
>  * with .tm_isdst = -1, there is diversity of handling.
>
> When tm_isdst is 0 or 1, in the fall back it gets preserved;
> in the spring forward, it gets flipped and tm_hour is changed
> in the way it usually would for such a flip.
>
> OSX 10.10, Xcode 6.02
>  * varies within the hour (see below)
>  * at half past: handled as if you'd claimed tm_isdst = 0 (see above)
>
> MacBook, Darwin 15.0.0
> Ubuntu 12.04, glibc 2.15
> Debian/stretch, glibc 2.19
>  * clear tm_isdst and move an hour earlier in spring
>  * set tm_isdst and preserve hour in autumn
>
> MinGW
> MSVC 2015
>  * set tm_isdst and move an hour later in spring
>  * clear tm_isdst and preserve hour in autumn.
>
> My initial test was, it turns out, naive.  Apparently some platforms
> vary handling of -1 across the hour.  I also bit the bullet and worked
> out how to auto-detect DST transitions.  One response indicates
> asctime_r() isn't portable.  So I attach a new version of mktime.c, that
> needs no manual configuration and is, I hope, a little more portable.  I
> note that setting the TZ environment variable (on platforms that honour
> it, at least) can be used to discover what your O/S thinks happens in
> other time-zones than your local one.
>
> As before, if anyone feels inclined to give this a whirl, I'd again
> appreciate any responses, along with descriptions of the system they
> come from (e.g. uname -a output).
>
> Eddy
> ___
> 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] Requesting New Repository - QtZeroConf

2015-11-16 Thread drwho
> Hi,
>
> Given that mdns uses an unprivileged port, it seems like to me it should
> be possible
> for just about any process to send and receive mdns queries. Which means
> that any
> app could participate in the mdns groups by itself if it wanted. The
> primary advantage
> that I can see with re-using a running daemon is that the daemon can
> detect if your
> process crashes and clear out the distributed DNS records. If the app
> takes care of
> that by itself, then it would have to deliberately use short TTLs I think.
>
> Interestingly enough, the protocol doesn't seem to be that complicated. A
> cross-platform
> implementation written in Go is under 1000 LOC (server and client, count
> includes comments):
>
> https://github.com/hashicorp/mdns
>
>
> So an alternate approach would be to try to implement the protocol by
> itself.
>
>
> Another option that I think would be viable is to go up in the level of
> abstraction
> and try to come up with an API that allows discovery and publishing of
> network
> services on mdns as well as UPNP at the same time. Then the windows
> version could
> just re-use UPNP APIs in Windows and on the other OSes we use zeroconf.

ssdp discovers devices, zeroconf discovers services (on devices).  ssdp
has different classes of devices (eg. rootdevice).  zeroconf has optional
txt records.  I don't see a way to combine these into a higher level of
abstraction.

-- ssdp --
registerResourceSimple(const char *target, const char *usn, const char
*location)
registerResourceSimple("upnp:rootdevice",
"uuid:1234abcd-12ab-12ab-12ab-1234567abc12::upnp:rootdevice",
"http://192.168.1.100/;);

-- ZeroConf --
registerService(const char *name, const char *type, const char *domain,
quint16 port);
registerService("Vaction-Tracker-server", "_vactracker._tcp", "local",
12345);

I have completed testing of my zeroconf project on Linux, Android, Windows
and Mac.  I would like to contribute the code to the playground area with
the project name zeroconf with the hope of it someday becoming a sub
module.

Jon

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


Re: [Development] New qt5.6 beta snapshot available

2015-11-16 Thread Tim Blechmann
>>> These aren't yet final beta packages but please test these & report all
>>> new blocker immediately
>>
>> no new blockers, but i still need to apply these two patches to be able
>> to compile 5.6-beta on osx:
>>
>> https://codereview.qt-project.org/#/c/139577/
>> https://codereview.qt-project.org/#/c/139981/
>>
>> both issues are compile failures for statically linked qt, though for
>> some reasons gerrit cannot integrate them.
> 
> Neither is a showstopper for the release and the first doesn't cause a build 
> error for regular people (no -developer-build).

well, both should be trivially fixable, once CI won't fail with an FTP
timeout ;)

>> btw, would it be possible to configure gerrit to build statically linked
>> qt and possibly also namespaced qt before integrating a patch? in the
>> past it happened quite often that those two configuration options did
>> not compile ... though this is all something which could easily be
>> verified automatically ...
> 
> Namespace builds are tested. I don't think static builds are.

since when are namespace builds tested? it must be something rather new,
as about a month ago i had to apply this fix [1] to compile qt-5.6-base
... and i remember similar fixes which i had to do for 5.4/5.5.

cheers,
tim

[1] https://codereview.qt-project.org/#/c/127867/


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


Re: [Development] New qt5.6 beta snapshot available

2015-11-16 Thread Hausmann Simon
Hi,

Namespaced builds are only tested on Linux IIRC, not os x. Similarly static 
builds happen for ios, where the plugin loading code is probably not used.

Simon

  Original Message
From: Tim Blechmann
Sent: Tuesday, November 17, 2015 05:24
To: development@qt-project.org
Subject: Re: [Development] New qt5.6 beta snapshot available


>>> These aren't yet final beta packages but please test these & report all
>>> new blocker immediately
>>
>> no new blockers, but i still need to apply these two patches to be able
>> to compile 5.6-beta on osx:
>>
>> https://codereview.qt-project.org/#/c/139577/
>> https://codereview.qt-project.org/#/c/139981/
>>
>> both issues are compile failures for statically linked qt, though for
>> some reasons gerrit cannot integrate them.
>
> Neither is a showstopper for the release and the first doesn't cause a build
> error for regular people (no -developer-build).

well, both should be trivially fixable, once CI won't fail with an FTP
timeout ;)

>> btw, would it be possible to configure gerrit to build statically linked
>> qt and possibly also namespaced qt before integrating a patch? in the
>> past it happened quite often that those two configuration options did
>> not compile ... though this is all something which could easily be
>> verified automatically ...
>
> Namespace builds are tested. I don't think static builds are.

since when are namespace builds tested? it must be something rather new,
as about a month ago i had to apply this fix [1] to compile qt-5.6-base
... and i remember similar fixes which i had to do for 5.4/5.5.

cheers,
tim

[1] https://codereview.qt-project.org/#/c/127867/


___
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 qt5.6 beta snapshot available

2015-11-16 Thread Tim Blechmann
> These aren't yet final beta packages but please test these & report all
> new blocker immediately

no new blockers, but i still need to apply these two patches to be able
to compile 5.6-beta on osx:

https://codereview.qt-project.org/#/c/139577/
https://codereview.qt-project.org/#/c/139981/

both issues are compile failures for statically linked qt, though for
some reasons gerrit cannot integrate them.

--

btw, would it be possible to configure gerrit to build statically linked
qt and possibly also namespaced qt before integrating a patch? in the
past it happened quite often that those two configuration options did
not compile ... though this is all something which could easily be
verified automatically ...

cheers,
tim

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


Re: [Development] New qt5.6 beta snapshot available

2015-11-16 Thread Thiago Macieira
On Tuesday 17 November 2015 10:38:53 Tim Blechmann wrote:
> > These aren't yet final beta packages but please test these & report all
> > new blocker immediately
> 
> no new blockers, but i still need to apply these two patches to be able
> to compile 5.6-beta on osx:
> 
> https://codereview.qt-project.org/#/c/139577/
> https://codereview.qt-project.org/#/c/139981/
> 
> both issues are compile failures for statically linked qt, though for
> some reasons gerrit cannot integrate them.

Neither is a showstopper for the release and the first doesn't cause a build 
error for regular people (no -developer-build).

> btw, would it be possible to configure gerrit to build statically linked
> qt and possibly also namespaced qt before integrating a patch? in the
> past it happened quite often that those two configuration options did
> not compile ... though this is all something which could easily be
> verified automatically ...

Namespace builds are tested. I don't think static builds are.

-- 
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] New qt5.6 beta snapshot available

2015-11-16 Thread Heikkinen Jani


Hi all,


We have again new 5.6 beta snapshot available in 
http://download.qt.io/snapshots/qt/5.6/5.6.0-beta/


Mac: http://download.qt.io/snapshots/qt/5.6/5.6.0-beta/203/

Linux: http://download.qt.io/snapshots/qt/5.6/5.6.0-beta/275/

Windows: http://download.qt.io/snapshots/qt/5.6/5.6.0-beta/253/

src: http://download.qt.io/snapshots/qt/5.6/5.6.0-beta/latest_src/ 



These aren't yet final beta packages but please test these & report all new 
blocker immediately


known issues:

* Still missing:

** Win MSVC 2015 x86 (binaries available, packaging needs to be fixed, 
ongoing)

** WinPhone x86 binaries still missing from WinRT MSVC 2013 (No binaries 
from coin yet)


Some beta blockers should be fixed but there is still some blocker issues open 
in https://bugreports.qt.io/browse/QTBUG-47958



* QTBUG-49349 WinRT: No app 
starting on Windows 10 Mobile 10581

** Fix availabe & waiting for qt5.git integration

* QTBUG-49197 WinRT: MSVC2015 
installer does not contain arm build

** Binaries available, installer confs needs to be fixed

* QTBUG-49226 Unsatisfied 
dependencies to system libraries

** Should be fixed, needs to be verified

* QTBUG-49367 
QtAndroidBluetooth-bundled.jar missing from 5.6 beta Mac installer

** Fixing ongoing

* QTBUG-48914 Qt5.6 offline: 
plugins/mediaservice/ libs missing

** Fix available but approved yet

* QTBUG-49368 Windows Phone 
Emulator (x86) Qt version missing from installer

** Fix availabe & waiting for qt5.git integration

* QTBUG-49211 [REG 5.5->5.6] 
Cannot find documentation specification file .../qtenginiooverview.qdocconf 
when building s

** Should be fixed, needs to be verified

* QTBUG-49369 Several Qt tools 
fail to find QtCore

** Fix available but not in yet.

* QTBUG-48915 Qt5.6 offline: 
Enginio missing from android targets

** Still valid issue

* QTBUG-49362 winrt: windows 
phone kit does not have valid device set

 ** Should be fixed, needs to be verified

* QTBUG-49366 [Reg 5.5->5.6]: 
Cannot compile apps with sql for iOS

** Study ongoing

* QTBUG-49422 Qt5.6 offline: 
Qt53DCollision lib missing

** Study request sent

* QTCREATORBUG-15330 
winrt: combined c++ and qml debugging fails

** Fix under review

* QTBUG-45662 Add 
qtbase/bin/fixqt4headers.pl to packages

** Fix availabe & waiting for qt5.git integration


br,

Jani








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


Re: [Development] New qt5.6 beta snapshot available

2015-11-16 Thread Thiago Macieira
On Tuesday 17 November 2015 11:23:40 Tim Blechmann wrote:
> >> btw, would it be possible to configure gerrit to build statically linked
> >> qt and possibly also namespaced qt before integrating a patch? in the
> >> past it happened quite often that those two configuration options did
> >> not compile ... though this is all something which could easily be
> >> verified automatically ...
> > 
> > Namespace builds are tested. I don't think static builds are.
> 
> since when are namespace builds tested? it must be something rather new,
> as about a month ago i had to apply this fix [1] to compile qt-5.6-base
> ... and i remember similar fixes which i had to do for 5.4/5.5.

I think since the Qt Project started, so before 5.0.

But like Simon said, only for Linux.

-- 
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