You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ruediger Pluem <rp...@apache.org> on 2006/03/06 23:37:08 UTC

apr_reslist_release does not notice "double releases". Bug or feature?

PR 38793 (http://issues.apache.org/bugzilla/show_bug.cgi?id=38793#c3)
revealed that apr_reslist_release does not notice "double releases" of the same resource.
After looking at the code of apr_reslist.c I am currently undecided if this is
a bug or a feature. If it is a bug it should be fixed of course :-).
If it is a feature I need to take care myself to prevent such "double releases",
which means that have to do some work on mod_proxy regarding this.

Regards

RĂ¼diger

Re: apr_reslist_release does not notice "double releases". Bug or feature?

Posted by Ruediger Pluem <rp...@apache.org>.

On 03/07/2006 12:34 AM, Nick Kew wrote:
> On Monday 06 March 2006 22:37, Ruediger Pluem wrote:
> 

> 
> How does a resource get released more than once?  Are we talking about
> logic equivalent to a double-free, or something more subtle?

Yes, it is a simple "double-free" problem. Just do

apr_reslist_release(reslist, (void *)conn);

for conn aquired via apr_reslist_aquire twice and you have conn twice in
the reslist. So two following calls to apr_reslist_aquire can return conn.
Of course the conn pointer is stored in different containers inside the reslist.

Regards

RĂ¼diger


Re: apr_reslist_release does not notice "double releases". Bug or feature?

Posted by Nick Kew <ni...@webthing.com>.
On Monday 06 March 2006 22:37, Ruediger Pluem wrote:
> PR 38793 (http://issues.apache.org/bugzilla/show_bug.cgi?id=38793#c3)
> revealed that apr_reslist_release does not notice "double releases" of the
> same resource. After looking at the code of apr_reslist.c I am currently
> undecided if this is a bug or a feature. If it is a bug it should be fixed
> of course :-). If it is a feature I need to take care myself to prevent
> such "double releases", which means that have to do some work on mod_proxy
> regarding this.

How does a resource get released more than once?  Are we talking about
logic equivalent to a double-free, or something more subtle?

-- 
Nick Kew