Skip navigation.
Home
The QNX Community Portal

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

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

For the old QNX2 and QNX4 RTOS

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

Postby abhayarya2000 » Thu Sep 01, 2016 7:26 pm

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
abhayarya2000
New Member
 
Posts: 4
Joined: Fri Jul 01, 2016 11:52 pm

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

Postby maschoen » Sat Sep 03, 2016 1:17 am

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.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

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

Postby abhayarya2000 » Tue Sep 06, 2016 1:52 pm

Thanks maschoen
abhayarya2000
New Member
 
Posts: 4
Joined: Fri Jul 01, 2016 11:52 pm


Return to QNX2 and QNX4

Who is online

Users browsing this forum: Google [Bot] and 0 guests