Commit 55364ad
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.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1927948 13f79535-47bb-0310-9956-ffa450edef681 parent 471de34 commit 55364ad
1 file changed
+26
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
604 | 603 | | |
605 | 604 | | |
606 | 605 | | |
| |||
1619 | 1618 | | |
1620 | 1619 | | |
1621 | 1620 | | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1622 | 1627 | | |
1623 | | - | |
1624 | | - | |
| 1628 | + | |
1625 | 1629 | | |
1626 | 1630 | | |
1627 | 1631 | | |
| |||
2065 | 2069 | | |
2066 | 2070 | | |
2067 | 2071 | | |
2068 | | - | |
2069 | | - | |
2070 | | - | |
2071 | | - | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | | - | |
2084 | 2072 | | |
2085 | 2073 | | |
2086 | 2074 | | |
| |||
2104 | 2092 | | |
2105 | 2093 | | |
2106 | 2094 | | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2107 | 2111 | | |
2108 | 2112 | | |
2109 | 2113 | | |
| |||
2132 | 2136 | | |
2133 | 2137 | | |
2134 | 2138 | | |
2135 | | - | |
2136 | 2139 | | |
2137 | 2140 | | |
2138 | 2141 | | |
| |||
2169 | 2172 | | |
2170 | 2173 | | |
2171 | 2174 | | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2172 | 2178 | | |
2173 | 2179 | | |
2174 | 2180 | | |
| |||
0 commit comments