Re: [Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-31 Thread Thiago Macieira
On quinta-feira, 31 de outubro de 2013 12:21:46, Luka Vilar wrote:
> i agree and for the ICU part. Calling u_cleanup will free resources owned
> by ICU libraries. Converters used by Qt are already properly released so
> this is not an Qt issue.

Let me ask you this:

what happens if Qt was loaded by a plugin to the main application, this plugin 
gets unloaded (thus, the Q_GLOBAL_STATIC destructors get run), but ICU is in 
use by the application?

How will ICU react to u_cleanup being run and then more functions get called?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-31 Thread Julien Blanc
Le 31/10/2013 12:29, Koehne Kai a écrit :
> I'm not completely opposed to calling u_cleanup(), but we've to keep in mind 
> that ICU API might get called very late (e.g. even in destructors of static 
> objects, when someone decides to add say a qDebug() there). What happens if I 
> call ICU API after u_cleanup() is called? Will it just miss data, or crash? 
> This would need to be thoroughly tested ...

Seems a good candidate for a phoenix singleton[1], then.

Wouldn’t it make sense to call u_cleanup only in debug mode ? Since it 
is just a matter of false positive in memory leaks analyzers…[2]

Regards,

Julien

[1] as per Alexandrescu’s definition in modern c++

[2] the issue may not be as neglictible as it seems. Having no memory 
leaks reported is a sane check in a continuous integration system.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-31 Thread Koehne Kai

> -Original Message-
> From: development-bounces+kai.koehne=digia@qt-project.org
> [mailto:development-bounces+kai.koehne=digia@qt-project.org] On
> Behalf Of Luka Vilar
> Sent: Thursday, October 31, 2013 12:22 PM
> To: Kleint Friedemann
> Cc: development@qt-project.org
> Subject: [Development] Qt 5.2 Beta, possible memory leak(s)
> 
> Hi,
> 
> i agree and for the ICU part. Calling u_cleanup will free resources owned by
> ICU libraries. Converters used by Qt are already properly released so this is
> not an Qt issue.
> 
> From ICU Api help: The use of u_cleanup() just before an application
> terminates is optional, but it should be called only once for performance
> reasons. The primary benefit is to eliminate reports of memory or resource
> leaks originating in ICU code from the results generated by heap analysis
> tools.

I'm not completely opposed to calling u_cleanup(), but we've to keep in mind 
that ICU API might get called very late (e.g. even in destructors of static 
objects, when someone decides to add say a qDebug() there). What happens if I 
call ICU API after u_cleanup() is called? Will it just miss data, or crash? 
This would need to be thoroughly tested ...

Regards

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


[Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-31 Thread Luka Vilar
Hi,

i agree and for the ICU part. Calling u_cleanup will free resources owned
by ICU libraries. Converters used by Qt are already properly released so
this is not an Qt issue.

>From ICU Api help: The use of u_cleanup() just before an application
terminates is optional, but it should be called only once for performance
reasons. The primary benefit is to eliminate reports of memory or resource
leaks originating in ICU code from the results generated by heap analysis
tools.

Regards,
Luka
Dne 31. okt. 2013 09:36 je oseba "Friedemann Kleint" <
friedemann.kle...@digia.com> napisala:

> Hi,
>
>  >I dislike those because we're incurring overhead at shutdown to do
> something
>  >that doesn't need doing, except to keep tools happy.
>
> For the platform printer support, it makes sense since it can
> potentially have handles open or similar. Not sure about the ICU leak,
> though?
>
> Regards,
> Friedemann
>
> --
> Friedemann Kleint
> Digia, Qt
>
> ___
> 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.2 Beta, possible memory leak(s)

2013-10-31 Thread Friedemann Kleint
Hi,

 >I dislike those because we're incurring overhead at shutdown to do 
something
 >that doesn't need doing, except to keep tools happy.

For the platform printer support, it makes sense since it can 
potentially have handles open or similar. Not sure about the ICU leak, 
though?

Regards,
Friedemann

-- 
Friedemann Kleint
Digia, Qt

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


Re: [Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-30 Thread Luka Vilar
Hi,

and thanks for the info.

Regards,
Luka

On 30 October 2013 15:21, Friedemann Kleint wrote:

> Hi,
>
> here is a fix for printing: https://codereview.qt-project.org/69686
>
> Regards,
> Friedemann
>
> --
> Friedemann Kleint
> Digia, Qt
>
> ___
> 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.2 Beta, possible memory leak(s)

2013-10-30 Thread Thiago Macieira
On quarta-feira, 30 de outubro de 2013 11:36:12, Luka Vilar wrote:
> Hi all,
> 
> using Qt 5.2 beta on Windows 7 x64, compiled with Visual Studio 2012 update
> 3 i am getting two annoying reports of memory leaks. First is from using
> ICU and not calling u_cleanup() API on module unload and the second is
> from QPrinterInfo::defaultPrinter() not cleaning up QPlatformPrinterSupport
> singleton.
> 
> I know this is not high priority issue but still i would be nice to get rid
> of this annoyances, so when using leak detection tools developers would
> only get their own leaks.

I dislike those because we're incurring overhead at shutdown to do something 
that doesn't need doing, except to keep tools happy.

Checking an environment variable's presence is almost as expensive, though.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-30 Thread Friedemann Kleint
Hi,

here is a fix for printing: https://codereview.qt-project.org/69686

Regards,
Friedemann

-- 
Friedemann Kleint
Digia, Qt

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


Re: [Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-30 Thread Christoph Feck
On Wednesday 30 October 2013 11:36:12 Luka Vilar wrote:
> Hi all,
> 
> using Qt 5.2 beta on Windows 7 x64, compiled with Visual Studio
> 2012 update 3 i am getting two annoying reports of memory leaks.
> First is from using ICU and not calling u_cleanup() API on module
> unload and the second is from QPrinterInfo::defaultPrinter() not
> cleaning up QPlatformPrinterSupport singleton.
> 
> I know this is not high priority issue but still i would be nice to
> get rid of this annoyances, so when using leak detection tools
> developers would only get their own leaks.
> 
> Best regards,
> Luka

Please use https://bugreports.qt-project.org/ to report issues.

-- 
Christoph Feck
http://kdepepo.wordpress.com/
KDE Quality Team
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Qt 5.2 Beta, possible memory leak(s)

2013-10-30 Thread Luka Vilar
Hi all,

using Qt 5.2 beta on Windows 7 x64, compiled with Visual Studio 2012 update
3 i am getting two annoying reports of memory leaks. First is from using
ICU and not calling u_cleanup() API on module unload and the second is
from QPrinterInfo::defaultPrinter() not cleaning up QPlatformPrinterSupport
singleton.

I know this is not high priority issue but still i would be nice to get rid
of this annoyances, so when using leak detection tools developers would
only get their own leaks.

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