apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54360] New: apr_pool_create crashes, when the parent argument is NULL
Date Sat, 29 Dec 2012 21:36:08 GMT

            Bug ID: 54360
           Summary: apr_pool_create crashes, when the parent argument is
           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. 


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

        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

View raw message