From 9cbd5e4ce9382f8f2fd1c23e679113af03376220 Mon Sep 17 00:00:00 2001 From: glasser Date: Fri, 8 Feb 2008 00:13:39 +0000 Subject: [PATCH] Fix a segfault on global pool cleanup after merge which has been occurring on some platforms since r28442. It appears that, due to the ne_decompress destruction in the request cleanup handler, svn_ra_neon__parsed_request must always be called with a pool whose lifetime is no longer than the RA session pool's. (This will be documented in a future revision. (Update: actually, r29231 fixes this in a different way.)) * subversion/libsvn_ra_neon/get_location_segments.c (svn_ra_neon__get_location_segments): Run everything (including svn_ra_neon__parsed_request) in a subpool. git-svn-id: http://svn.collab.net/repos/svn/trunk@29230 612f8ebc-c883-4be0-9ee0-a4e9ef946e3a --- subversion/libsvn_ra_neon/get_location_segments.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/subversion/libsvn_ra_neon/get_location_segments.c b/subversion/libsvn_ra_neon/get_location_segments.c index 534474823..b46609fc3 100644 --- a/subversion/libsvn_ra_neon/get_location_segments.c +++ b/subversion/libsvn_ra_neon/get_location_segments.c @@ -142,9 +142,10 @@ svn_ra_neon__get_location_segments(svn_ra_session_t *session, svn_string_t bc_url, bc_relative; const char *bc; int status_code = 0; + apr_pool_t *subpool = svn_pool_create(pool); /* Build the request body. */ - request_body = svn_stringbuf_create("", pool); + request_body = svn_stringbuf_create("", subpool); svn_stringbuf_appendcstr(request_body, "" DEBUG_CR ""); - svn_stringbuf_appendcstr(request_body, apr_xml_quote_string(pool, path, 0)); + svn_stringbuf_appendcstr(request_body, apr_xml_quote_string(subpool, path, 0)); svn_stringbuf_appendcstr(request_body, "" DEBUG_CR); /* ...and maybe a peg revision... */ if (SVN_IS_VALID_REVNUM(peg_revision)) svn_stringbuf_appendcstr - (request_body, apr_psprintf(pool, + (request_body, apr_psprintf(subpool, "%ld" DEBUG_CR, peg_revision)); /* ...and maybe a start revision... */ if (SVN_IS_VALID_REVNUM(start_rev)) svn_stringbuf_appendcstr - (request_body, apr_psprintf(pool, + (request_body, apr_psprintf(subpool, "%ld" DEBUG_CR, start_rev)); /* ...and maybe an end revision. */ if (SVN_IS_VALID_REVNUM(end_rev)) svn_stringbuf_appendcstr - (request_body, apr_psprintf(pool, + (request_body, apr_psprintf(subpool, "%ld" DEBUG_CR, end_rev)); @@ -180,7 +181,7 @@ svn_ra_neon__get_location_segments(svn_ra_session_t *session, request_baton.receiver = receiver; request_baton.receiver_baton = receiver_baton; - request_baton.subpool = svn_pool_create(pool); + request_baton.subpool = svn_pool_create(subpool); /* ras's URL may not exist in HEAD, and thus it's not safe to send it as the main argument to the REPORT request; it might cause @@ -188,15 +189,16 @@ svn_ra_neon__get_location_segments(svn_ra_session_t *session, baseline-collection URL, which we get from the PEG_REVISION. */ SVN_ERR(svn_ra_neon__get_baseline_info(NULL, &bc_url, &bc_relative, NULL, ras, ras->url->data, - peg_revision, pool)); - bc = svn_path_url_add_component(bc_url.data, bc_relative.data, pool); + peg_revision, subpool)); + bc = svn_path_url_add_component(bc_url.data, bc_relative.data, subpool); err = svn_ra_neon__parsed_request(ras, "REPORT", bc, request_body->data, NULL, NULL, gls_start_element, NULL, NULL, &request_baton, NULL, &status_code, - FALSE, pool); + FALSE, subpool); svn_pool_destroy(request_baton.subpool); + svn_pool_destroy(subpool); /* Map status 501: Method Not Implemented to our not implemented error. 1.0.x servers and older don't support this report. */ -- 2.11.4.GIT