Crash in apr_pollcb_create_ex()

View: New views
4 Messages — Rating Filter:   Alert me  

Crash in apr_pollcb_create_ex()

by Neil Conway-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If apr_pollcb_create_ex() is called with a non-default pollset method,
it tries to use the user-specified method, and fails back to the
platform default if the user-specified method is not available on the
current platform. The fall-back code path is buggy, however: the
*pollcb pointer is reset to NULL (unix/pollcb.c:106 in trunk) before
the default pollset provider's create method is called on line 120.

Attached is a patch against trunk; the same issue exists in the 1.4 branch.

Neil


pollcb_nondefault_crash-1.patch (1K) Download Attachment

Re: Crash in apr_pollcb_create_ex()

by Neil Conway-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Has anyone had a chance to look at this patch? It's pretty trivial.

Also, this patch is outstanding:

http://mail-archives.apache.org/mod_mbox/apr-dev/200910.mbox/<b4e5ce320910242317q199897b6p9cf57b99c07e2edb@...>

Neil

On Sat, Oct 24, 2009 at 5:29 PM, Neil Conway <nrc@...> wrote:

> If apr_pollcb_create_ex() is called with a non-default pollset method,
> it tries to use the user-specified method, and fails back to the
> platform default if the user-specified method is not available on the
> current platform. The fall-back code path is buggy, however: the
> *pollcb pointer is reset to NULL (unix/pollcb.c:106 in trunk) before
> the default pollset provider's create method is called on line 120.
>
> Attached is a patch against trunk; the same issue exists in the 1.4 branch.
>
> Neil
>

Re: Crash in apr_pollcb_create_ex()

by Jeff Trawick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 5, 2009 at 4:29 PM, Neil Conway <nrc@...> wrote:
> Has anyone had a chance to look at this patch? It's pretty trivial.

different patch committed to trunk to resolve the issue

> Also, this patch is outstanding:
>
> http://mail-archives.apache.org/mod_mbox/apr-dev/200910.mbox/<b4e5ce320910242317q199897b6p9cf57b99c07e2edb@...>

almost all committed to trunk, separated into a whitespace commit and
a functional commit

a change from apr_pollset_create() to apr_pollset_create_ex(,
APR_POLLSET_DEFAULT) was omitted

Re: Crash in apr_pollcb_create_ex()

by Jeff Trawick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 11:26 AM, Jeff Trawick <trawick@...> wrote:

> On Thu, Nov 5, 2009 at 4:29 PM, Neil Conway <nrc@...> wrote:
>> Has anyone had a chance to look at this patch? It's pretty trivial.
>
> different patch committed to trunk to resolve the issue
>
>> Also, this patch is outstanding:
>>
>> http://mail-archives.apache.org/mod_mbox/apr-dev/200910.mbox/<b4e5ce320910242317q199897b6p9cf57b99c07e2edb@...>
>
> almost all committed to trunk, separated into a whitespace commit and
> a functional commit
>
> a change from apr_pollset_create() to apr_pollset_create_ex(,
> APR_POLLSET_DEFAULT) was omitted

I forgot to add that I will backport to 1.4.x soon.