Commit 067df4a
committed
apr_pools: Follow up to r1927658.
In apr_pool_create_ex_debug(), attaching the pool to its parent before creating
the mutex races with other threads running apr_pool_walk_tree() on any ancestor
and finding the pool and crashing on pool_lock() with ->mutex == NULL.
Fix this by moving back the attachment after the mutex is created.
To prevent apr_pool_check_lifetime() failing when the ->mutex is created in
apr_pool_create_ex_debug() with no ->parent (per r1927658), let's make it
ignore pools with ->parent == NULL. This covers both the global pool, all the
unmanaged pools and finally the internal case in apr_pool_create_ex_debug().
There is no way for any other pool to have ->parent == NULL since it's forced
to the global_pool when no parent is given.
* memory/unix/apr_pools.c
(struct apr_pool_t): Remove the "unmanaged" flag since it's no longer used,
unmanaged pools have their ->parent == NULL.
(apr_pool_check_lifetime): Ignore pools with ->parent == NULL, which covers
all the cases.
(apr_pool_create_ex_debug): Move back setting the ->parent after the ->mutex
is created.
(apr_pool_create_unmanaged_ex_debug): Free the owned allocator if the ->mutex
creation failed.
apr_pools: abort() if creating the pool mutex failed (APR_POOL_DEBUG mode).
* memory/unix/apr_pools.c
(apr_pool_create_ex_debug): Call abort_fn if any.
(apr_pool_create_unmanaged_ex_debug): Call abort_fn if any.
Merges r1927948, r1927949 from trunk
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1927950 13f79535-47bb-0310-9956-ffa450edef681 parent 939a165 commit 067df4a
1 file changed
+30
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
593 | | - | |
594 | 593 | | |
595 | 594 | | |
596 | 595 | | |
| |||
1605 | 1604 | | |
1606 | 1605 | | |
1607 | 1606 | | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
1608 | 1613 | | |
1609 | | - | |
1610 | | - | |
| 1614 | + | |
1611 | 1615 | | |
1612 | 1616 | | |
1613 | 1617 | | |
| |||
2037 | 2041 | | |
2038 | 2042 | | |
2039 | 2043 | | |
2040 | | - | |
2041 | | - | |
2042 | | - | |
2043 | | - | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
2048 | | - | |
2049 | | - | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
2053 | | - | |
2054 | | - | |
2055 | | - | |
2056 | 2044 | | |
2057 | 2045 | | |
2058 | 2046 | | |
| |||
2067 | 2055 | | |
2068 | 2056 | | |
2069 | 2057 | | |
| 2058 | + | |
| 2059 | + | |
2070 | 2060 | | |
2071 | 2061 | | |
2072 | 2062 | | |
| |||
2076 | 2066 | | |
2077 | 2067 | | |
2078 | 2068 | | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
2079 | 2085 | | |
2080 | 2086 | | |
2081 | 2087 | | |
| |||
2113 | 2119 | | |
2114 | 2120 | | |
2115 | 2121 | | |
2116 | | - | |
2117 | 2122 | | |
2118 | 2123 | | |
2119 | 2124 | | |
| |||
2150 | 2155 | | |
2151 | 2156 | | |
2152 | 2157 | | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
2153 | 2163 | | |
2154 | 2164 | | |
2155 | 2165 | | |
| |||
0 commit comments