Skip navigation.
Home
The QNX Community Portal

View topic - Stale pointer relase from free() call of libc.so.3

Page 1 of 1

Stale pointer relase from free() call of libc.so.3

PostPosted: Thu Sep 01, 2016 7:26 pm
by abhayarya2000
Hi,

>>>Am releasing same heap twice.
For e.g.
char *pData=new char[20];

delete[] pData;
delete[] pData;


>>>>When above code is run, gives below stack
[Call stack]
#0 0x01026384 in _list_release () from C:\QNX650SP1_Pltf\target\qnx6\armle-v7\lib\libc.so.3
#1 0x01027fd4 in __free () from C:\QNX650SP1_Pltf\target\qnx6\armle-v7\lib\libc.so.3

+++++++++++++++++++++++++++++++++++++++++++++++++++
however if i keep few secs gap between two delete, following stack is generated.
See the following stack address, they are different.
Does this mean, in the few secs gap, this release HEAP is assigned to some other process and now when we are releasing the stale pointer, it comes up with the below stack address.
#0 0x010278a8 in __flist_dequeue_bin () from libc.so.3
#1 0x010264b8 in _list_release () from libc.so.3
#2 0x01027fd4 in __free () from libc.so.3

Re: Stale pointer relase from free() call of libc.so.3

PostPosted: Sat Sep 03, 2016 1:17 am
by maschoen
I'm not quite sure why you are interested in or concerned about the failure of bad code.

That said the answer to your question is no. Processes in QNX do not run in the same address space.

Re: Stale pointer relase from free() call of libc.so.3

PostPosted: Tue Sep 06, 2016 1:52 pm
by abhayarya2000
Thanks maschoen