Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - detection of scoid leaks: (6 Items)
   
detection of scoid leaks  
In one of our server processes there was a scoid leak.

Now I would like to be sure, that the system is "free" of this kind of troubles.

Is there any way, any "inhouse" utility, pidin option to get this information?

Thanks, PKY
Re: detection of scoid leaks  
Anyone?

> In one of our server processes there was a scoid leak.
> 
> Now I would like to be sure, that the system is "free" of this kind of 
> troubles.
> 
> Is there any way, any "inhouse" utility, pidin option to get this information?
> 
> 
> Thanks, PKY


Re: detection of scoid leaks  
Hi Pavol,

Were you aware that you need to manual "free" the scoid in many situations?

If you have the NTO_CHF_DISCONNECT flag set when you create the channel, or you create the channel using name_attach(), 
or it's a resource manager, then you will be responsible for free'ing scoid's.  

Please see the section "Server Cleanup" in the attached pdf.

If I am incorrect in my assumption, please explain your situation in more detail. 

-Chris Foran

Attachment: PDF 06_nto_ipc_r08.pdf 402.26 KB
Re: detection of scoid leaks  
Yes, I am aware of it. 

But by mistake, in one of our server processes (with name_attach, ported from QNX4) it was left out. 
There was nothing like this in my code:
-------------------
case _PULSE_CODE_DISCONNECT:
…//code to clean up per-client info
ConnectDetach(msg.pulse.scoid); /* free scoid */
break;
-------------------
Now it's there! 

And it took me "ages" to find the root cause of the problem - as there is no easy way to check for this situation.

I was kind of "close" to the symptoms of "not freeing scoids" in this topic. 

http://community.qnx.com/sf/discussion/do/listPosts/projects.core_os/discussion.newcode.topc9788

But it took me some more time to find, that it's not freeing scoids that is causing me trouble. 

Regards, Pavel

> Hi Pavol,
> 
> Were you aware that you need to manual "free" the scoid in many situations?
> 
> If you have the NTO_CHF_DISCONNECT flag set when you create the channel, or 
> you create the channel using name_attach(), or it's a resource manager, then 
> you will be responsible for free'ing scoid's.  
> 
> Please see the section "Server Cleanup" in the attached pdf.
> 
> If I am incorrect in my assumption, please explain your situation in more 
> detail. 
> 
> -Chris Foran
> 


Re: detection of scoid leaks  
Pavol,

Although we offer several ways of tracking associated resources such as coid's, fd and channels, there is no tool to 
examine scoid's.

It is my personal belief that if you start will a good template for your server, and if you understand the design issues
 fairly well, your desire for such a tool will diminish.

Also, note that it most cases,  the recommended way of implementing a server is to use the resource manager framework, 
and in the case the notion of scoid is hidden inside the framework and you don't need to handle it, or even be aware of 
it.

-Chris
Re: detection of scoid leaks  
Yes, I agree, that by good coding standard you can avoid this type of trouble.

But mistake can happen anytime, and it would be nice to have a tool to diagnose the system with "check list approach". E
.g. check for memory leaks (pidin mem), check for fd leaks (pidin fd), ... And hopefully sometimes scoid leaks (pidin 
scoid). ;-)

Pavel

> Pavol,
> 
> Although we offer several ways of tracking associated resources such as coid's
> , fd and channels, there is no tool to examine scoid's.
> 
> It is my personal belief that if you start will a good template for your 
> server, and if you understand the design issues fairly well, your desire for 
> such a tool will diminish.
> 
> Also, note that it most cases,  the recommended way of implementing a server 
> is to use the resource manager framework, and in the case the notion of scoid 
> is hidden inside the framework and you don't need to handle it, or even be 
> aware of it.
> 
> -Chris