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

2016-10-25 Thread Thiago Macieira
On segunda-feira, 17 de outubro de 2016 14:46:29 PDT Lars Knoll wrote: > I have to agree with Thiago. For QFactoryLoader, it doesn't make a lot of > sense to try to unload the plugins, as we only do that on program exit. > > It would be great to make plugins safe to unload, but we all know that

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

2016-10-17 Thread Lars Knoll
On 17 Oct 2016, at 15:27, Thiago Macieira > wrote: Em segunda-feira, 17 de outubro de 2016, às 15:50:04 PDT, Konstantin Tokarev escreveu: 17.10.2016, 15:48, "Thiago Macieira"

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

2016-10-17 Thread Thiago Macieira
Em segunda-feira, 17 de outubro de 2016, às 15:50:04 PDT, Konstantin Tokarev escreveu: > 17.10.2016, 15:48, "Thiago Macieira" : > > Em segunda-feira, 17 de outubro de 2016, às 13:32:04 PDT, Giuseppe > > D'Angelo > > > > escreveu: > >> Il 14/10/2016 19:44, Thiago

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

2016-10-17 Thread Konstantin Tokarev
17.10.2016, 15:48, "Thiago Macieira" : > Em segunda-feira, 17 de outubro de 2016, às 13:32:04 PDT, Giuseppe D'Angelo > escreveu: >>  Il 14/10/2016 19:44, Thiago Macieira ha scritto: >>  >> > We are talking in this change about QFactoryLoader, which is a Qt API >>  >> >

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

2016-10-17 Thread Thiago Macieira
Em segunda-feira, 17 de outubro de 2016, às 13:32:04 PDT, Giuseppe D'Angelo escreveu: > Il 14/10/2016 19:44, Thiago Macieira ha scritto: > >> > We are talking in this change about QFactoryLoader, which is a Qt API > >> > and > >> > which is ALWAYS used until program exit. > > > > I meant

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

2016-10-17 Thread Thiago Macieira
Em segunda-feira, 17 de outubro de 2016, às 11:23:29 PDT, Marc Mutz escreveu: > Please don't equate 'resource' with 'memory'. Memory is just one of many > resources a program may have acquired, and the _only_ resource which does > not need to be released at program exit. Well, no. It does not

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

2016-10-17 Thread Giuseppe D'Angelo
Il 14/10/2016 19:44, Thiago Macieira ha scritto: >> > We are talking in this change about QFactoryLoader, which is a Qt API and >> > which is ALWAYS used until program exit. > > I meant internal Qt API. ... doesn't this sound like a declaration that we're not able to have internal Qt APIs for

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

2016-10-17 Thread Edward Welbourne
Marc Mutz > Please don't equate 'resource' with 'memory'. Memory is just one of many > resources a program may have acquired, and the _only_ resource which does not > need to be released at program exit. Open file descriptors ? There may be others, but that's the one I tend to think of. ... and I

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

2016-10-17 Thread Marc Mutz
On Monday 17 October 2016 11:12:23 Edward Welbourne wrote: > Liang Jian said: > >I would not to say "still reachable" simply means the allocation is > > > > not leaked. > > Whether you call it a leak or not is just a matter of labelling; what > matters is resource use. Does it increase

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

2016-10-17 Thread Edward Welbourne
Liang Jian said: >I would not to say "still reachable" simply means the allocation is > not leaked. Whether you call it a leak or not is just a matter of labelling; what matters is resource use. Does it increase without limit ? If it doesn't, I'm not too fussed whether you call it a leak:

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

2016-10-16 Thread Thiago Macieira
Em domingo, 16 de outubro de 2016, às 17:51:45 PDT, Liang Jian escreveu: > I would not to say "still reachable" simply means the allocation is not > leaked. Doesn't matter. I won't fix a leak something that happened *only* because the application exited. For me, a legitimate leak requires

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

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

2016-10-15 Thread Thiago Macieira
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

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?

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

2016-10-14 Thread Thiago Macieira
Em sexta-feira, 14 de outubro de 2016, às 11:07:34 PDT, Thiago Macieira escreveu: > 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(). Actually, there's no

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

2016-10-14 Thread Thiago Macieira
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 >

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

2016-10-14 Thread Thiago Macieira
Em sexta-feira, 14 de outubro de 2016, às 07:10:00 PDT, Thiago Macieira escreveu: > We are talking in this change about QFactoryLoader, which is a Qt API and > which is ALWAYS used until program exit. I meant internal Qt API. -- Thiago Macieira - thiago.macieira (AT) intel.com Software

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

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

2016-10-13 Thread Thiago Macieira
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

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

2016-10-13 Thread Thiago Macieira
Em quinta-feira, 13 de outubro de 2016, às 20:46:46 CEST, André Pönitz escreveu: > It's not about most that don't, but those that do, or that would like to. > > At a certain level of complexity one doesn't only want to load plugins > on demand, but also unload them when not needed use anymore,

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

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

2016-10-13 Thread André Pönitz
On Thu, Oct 13, 2016 at 08:16:50PM +0200, Thiago Macieira wrote: > Em quinta-feira, 13 de outubro de 2016, às 19:47:57 CEST, André Pönitz > escreveu: > > I am not concerned about toy applications that gets started and closed > > by the minute. > > Right. Most applications don't unload their

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

2016-10-13 Thread Thiago Macieira
Em quinta-feira, 13 de outubro de 2016, às 19:47:57 CEST, André Pönitz escreveu: > I am not concerned about toy applications that gets started and closed > by the minute. Right. Most applications don't unload their plugins, except at program exit. -- Thiago Macieira - thiago.macieira (AT)

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

2016-10-13 Thread Konstantin Tokarev
13.10.2016, 20:39, "André Pönitz" : > On Thu, Oct 13, 2016 at 08:01:57PM +0300, Konstantin Tokarev wrote: >>  > I still consider the approach of not unloading plugins fundamentally >>  > wrong. It only deepens the trench between Qt and valid approaches at >>  > software

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

2016-10-13 Thread André Pönitz
On Thu, Oct 13, 2016 at 08:01:57PM +0300, Konstantin Tokarev wrote: > > I still consider the approach of not unloading plugins fundamentally > > wrong. It only deepens the trench between Qt and valid approaches at > > software architectures. > > I think not unloading plugins is fundamentally

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

2016-10-13 Thread Konstantin Tokarev
13.10.2016, 19:39, "André Pönitz" : > On Thu, Oct 13, 2016 at 03:30:22PM +0100, Sergio Martins wrote: >>  On 2016-10-12 20:59, Thiago Macieira wrote: >>  >Hello >>  > >>  >We've got a number of issues that got fixed in 5.7 by the change that made >>  >QFactoryLoader stop

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

2016-10-13 Thread André Pönitz
On Thu, Oct 13, 2016 at 03:30:22PM +0100, Sergio Martins wrote: > On 2016-10-12 20:59, 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, the Network Manager bearer > >plugin). Given

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

2016-10-13 Thread Thiago Macieira
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

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

2016-10-13 Thread Giuseppe D'Angelo
On 12/10/16 20:59, Thiago Macieira wrote: We've got a number of issues that got fixed in 5.7 by the change that made QFactoryLoader stop unloading plugins It's actually 5.8, isn't it? 494376f980e96339b6f1eff7c41336ca4d853065 is in 5.8 (and has a documentation bug as it states 5.7!). Which

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

2016-10-13 Thread Sergio Martins
On 2016-10-12 20:59, 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, the Network Manager bearer plugin). Given that QtDBus in 5.6 is now heavily threaded, a number of new issues have

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

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

2016-10-12 Thread Thiago Macieira
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, >

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

2016-10-12 Thread André Pönitz
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. Andre' ___

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

2016-10-12 Thread Thiago Macieira
Hello We've got a number of issues that got fixed in 5.7 by the change that made QFactoryLoader stop unloading plugins (notably, the Network Manager bearer plugin). Given that QtDBus in 5.6 is now heavily threaded, a number of new issues have cropped up. I've managed to fix some, but reports