You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2012/12/29 22:36:08 UTC

[Bug 54360] New: apr_pool_create crashes, when the parent argument is NULL

https://issues.apache.org/bugzilla/show_bug.cgi?id=54360

            Bug ID: 54360
           Summary: apr_pool_create crashes, when the parent argument is
                    NULL
           Product: APR
           Version: 1.4.6
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: mi+apache@aldan.algebra.com
    Classification: Unclassified

Created attachment 29798
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29798&action=edit
Simple test-case showing apr_pool_create failure

I'm developing a stand-alone utility and trying to use APR/APU for portability.

The manual for apr_pool_create is clear:

The parent pool. If this is NULL, the new pool is a root pool. If it is
non-NULL, the new pool will inherit all of its parent pool's attributes, except
the apr_pool_t will be a sub-pool. 

http://apr.apache.org/docs/apr/1.4/group__apr__pools.html#ga918adf3026c894efeae254a0446aed3b

However, invoking apr_pool_create(&mypool, NULL) crashes on the line
memory/unix/apr_pools.c:889, where it is trying to dereference the
parent-pointer:

        allocator = parent->allocator;

The comment inside the function states, allocator "is guaranteed" to be
non-null, when parent is, but that's not the case here:

 (gdb) p parent
 $6 = (apr_pool_t *) 0x0
 (gdb) p allocator
 $7 = (apr_allocator_t *) 0x0

I just started working on this utility, so it is not doing much yet other than
trying to create a pool. I'm attaching the code to help reproduce the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 54360] apr_pool_create crashes, when the parent argument is NULL

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54360

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Eric Covener <co...@gmail.com> ---
no apr_app_initialize() called prior to creating the pool.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org