Home » Community » Newbie corner » CTRL + C = 659 Heap leaks
Re: CTRL + C = 659 Heap leaks [message #52054 is a reply to message #52046] |
Fri, 12 July 2019 00:15 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Thu, 11 July 2019 16:42mirek wrote on Thu, 11 July 2019 04:22
So, this is console application in POSIX and you are pressing Ctrl+C to terminate it. AFAIK, Ctrl+C just calls exit, which is what is causing the leaks, as 'mybot' never gets destroyed.
Ctrl+C sends SIGINT, which causes "soft" termination of an app (unlike SIGKILL). It does all cleanup job for the process including stack unwinding (at least in x64 Linux).
Proof:
Memory leak report is a result of a call to UPP::MemoryDumpLeaks(), and it is called by
MemDiagCls::~MemDiagCls()
{
if(--sMemDiagInitCount == 0)
UPP::MemoryDumpLeaks();
}
So, stack gets unwinded, but in case of Xemuth memory doesn't get deallocated.
This is a bug with Xemuth's code.
I believe you are wrong. I believe Ctrl+C is equivalent of calling exit(). In that case, global variables get destructed, but local variables do not. This is also quite clear for the implementation of signals - they are asynchronouse and thus do not have to use the same stack so no stack unwinding is possible.
BTW, destructing global variables is the mechanism used to activate the leak checker
Mirek
|
|
|
|
|
CTRL + C = 659 Heap leaks
By: Xemuth on Wed, 10 July 2019 21:05
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Thu, 11 July 2019 06:06
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Xemuth on Thu, 11 July 2019 09:36
|
|
|
Re: CTRL + C = 659 Heap leaks
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Thu, 11 July 2019 17:10
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Xemuth on Thu, 11 July 2019 10:10
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Thu, 11 July 2019 10:22
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Thu, 11 July 2019 16:42
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Fri, 12 July 2019 00:15
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Fri, 12 July 2019 00:18
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Fri, 12 July 2019 00:46
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Fri, 12 July 2019 09:44
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Fri, 12 July 2019 09:55
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Mon, 15 July 2019 06:15
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Mon, 15 July 2019 08:17
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Mon, 15 July 2019 17:16
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Mon, 15 July 2019 19:35
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Mon, 15 July 2019 20:18
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Tue, 16 July 2019 00:11
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Tue, 16 July 2019 02:11
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Tue, 16 July 2019 09:38
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Wed, 17 July 2019 18:44
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Wed, 17 July 2019 20:25
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Wed, 17 July 2019 23:04
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Wed, 17 July 2019 23:46
|
|
|
Re: CTRL + C = 659 Heap leaks
By: mirek on Tue, 23 July 2019 09:36
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Xemuth on Thu, 11 July 2019 10:28
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Xemuth on Thu, 11 July 2019 10:30
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Xemuth on Thu, 11 July 2019 22:13
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Thu, 11 July 2019 22:24
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Novo on Thu, 11 July 2019 22:31
|
|
|
Re: CTRL + C = 659 Heap leaks
By: Xemuth on Fri, 12 July 2019 09:28
|
Goto Forum:
Current Time: Thu Mar 28 16:27:29 CET 2024
Total time taken to generate the page: 0.01179 seconds
|