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
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


Mime
View raw message