Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C4C8B200C18 for ; Sat, 11 Feb 2017 18:13:38 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C34C3160B5B; Sat, 11 Feb 2017 17:13:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1680D160B4C for ; Sat, 11 Feb 2017 18:13:37 +0100 (CET) Received: (qmail 94296 invoked by uid 500); 11 Feb 2017 17:13:37 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 94274 invoked by uid 99); 11 Feb 2017 17:13:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Feb 2017 17:13:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A9CF51A0017; Sat, 11 Feb 2017 17:13:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id OFWQ5_F6hmjv; Sat, 11 Feb 2017 17:13:34 +0000 (UTC) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 648025F1B3; Sat, 11 Feb 2017 17:13:34 +0000 (UTC) X-Envelope-From: stsp@apache.org Received: from jim.stsp.name (jim.stsp.name [217.197.84.42]) (authenticated bits=0) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP id v1BHDMi2029184 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 11 Feb 2017 18:13:22 +0100 Received: from localhost (jim.stsp.name [local]) by jim.stsp.name (OpenSMTPD) with ESMTPA id 221a3d69; Sat, 11 Feb 2017 18:13:22 +0100 (CET) Date: Sat, 11 Feb 2017 17:18:29 +0100 From: Stefan Sperling To: dev@subversion.apache.org Cc: stefan2@apache.org Subject: why svn object pools? (Re: svn commit: r1782614 - /subversion/trunk/subversion/libsvn_repos/authz.c) Message-ID: <20170211161828.suwsjqdr7kk2q624@jim.stsp.name> Mail-Followup-To: dev@subversion.apache.org, stefan2@apache.org References: <20170211160707.A7E733A0069@svn01-us-west.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170211160707.A7E733A0069@svn01-us-west.apache.org> User-Agent: NeoMutt/20170128 (1.7.2) archived-at: Sat, 11 Feb 2017 17:13:39 -0000 On Sat, Feb 11, 2017 at 04:07:07PM -0000, stsp@apache.org wrote: > Author: stsp > Date: Sat Feb 11 16:07:06 2017 > New Revision: 1782614 > > URL: http://svn.apache.org/viewvc?rev=1782614&view=rev > Log: > Fix a crash during init in libsvn_repos with pool debugging enabled. > > * subversion/libsvn_repos/authz.c > (synchronized_authz_initialize): With APR_POOL_DEBUG, the function > apr_pool_allocator_get() will return NULL (there is no global allocator). > So dereferencing that pointer to find the allocator's mutex will segfault. > It is unclear to me if using apr_allocator_mutex_get() is a sane way to find > out if we're running in multithreaded mode, and I can't find a better way > right now. For now, just assume that we're multithreaded if APR has threads. > This should be safe and allows me to run the tests over DAV again. > > Modified: > subversion/trunk/subversion/libsvn_repos/authz.c > > Modified: subversion/trunk/subversion/libsvn_repos/authz.c > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/authz.c?rev=1782614&r1=1782613&r2=1782614&view=diff > ============================================================================== > --- subversion/trunk/subversion/libsvn_repos/authz.c (original) > +++ subversion/trunk/subversion/libsvn_repos/authz.c Sat Feb 11 16:07:06 2017 > @@ -135,8 +135,7 @@ static svn_error_t * > synchronized_authz_initialize(void *baton, apr_pool_t *pool) > { > #if APR_HAS_THREADS > - svn_boolean_t multi_threaded > - = apr_allocator_mutex_get(apr_pool_allocator_get(pool)) != NULL; > + svn_boolean_t multi_threaded = TRUE; > #else > svn_boolean_t multi_threaded = FALSE; > #endif > The reason the above code wants to know if we're using threads is that there is a new private svn_object_pool API which requires this information. Is this new API critical to the new authz implementation? It seems like yet another layer which adds complexity and maintenance burden. Could the new authz implementation work without this? What would the impact be? Why aren't plain old APR pools good enough?