Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - coid leakage: (3 Items)
   
coid leakage  
There's probably a better forum for talking about the dispatch library code, but since I found the problem while trying 
to build an unloadable LSM, I'll report it here.

The dispatch_destroy() code does not free the select->ctrl->coid.  Thus, after some number of cycles of  select_attach()
/select_detach()/dispatch_destroy(), select_attach() fails with EMFILE.

I added a ConnectDetach in dispatch_destroy(), and that solved my immediate problem.  I guess you could argue both ways 
about select_detach() noticing that the coid was no longer needed and and dealing with it at that point, but it seems 
like it should be dealt with at least in dispatch_destroy.

Murf
Re: coid leakage  
Thanks John.  I'll raise a PR to look into this.  BTW this would have been better serviced in the core-os forums, but 
that's ok.

Colin

John Murphy wrote:
> There's probably a better forum for talking about the dispatch library code, but since I found the problem while 
trying to build an unloadable LSM, I'll report it here.
> 
> The dispatch_destroy() code does not free the select->ctrl->coid.  Thus, after some number of cycles of  
select_attach()/select_detach()/dispatch_destroy(), select_attach() fails with EMFILE.
> 
> I added a ConnectDetach in dispatch_destroy(), and that solved my immediate problem.  I guess you could argue both 
ways about select_detach() noticing that the coid was no longer needed and and dealing with it at that point, but it 
seems like it should be dealt with at least in dispatch_destroy.
> 
> Murf
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post17134
> 

-- 
cburgess@qnx.com
Re: coid leakage  
FYI it's PR63218, if you ever need to query the status of this one.

John Murphy wrote:
> There's probably a better forum for talking about the dispatch library code, but since I found the problem while 
trying to build an unloadable LSM, I'll report it here.
> 
> The dispatch_destroy() code does not free the select->ctrl->coid.  Thus, after some number of cycles of  
select_attach()/select_detach()/dispatch_destroy(), select_attach() fails with EMFILE.
> 
> I added a ConnectDetach in dispatch_destroy(), and that solved my immediate problem.  I guess you could argue both 
ways about select_detach() noticing that the coid was no longer needed and and dealing with it at that point, but it 
seems like it should be dealt with at least in dispatch_destroy.
> 
> Murf
> 
> _______________________________________________
> io-net migration
> http://community.qnx.com/sf/go/post17134
> 

-- 
cburgess@qnx.com