Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5359D10B6A for ; Thu, 12 Feb 2015 12:43:42 +0000 (UTC) Received: (qmail 24770 invoked by uid 500); 12 Feb 2015 12:43:37 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 24716 invoked by uid 500); 12 Feb 2015 12:43: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 24705 invoked by uid 99); 12 Feb 2015 12:43:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 12:43:36 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of brane@wandisco.com designates 209.85.212.173 as permitted sender) Received: from [209.85.212.173] (HELO mail-wi0-f173.google.com) (209.85.212.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 12:43:10 +0000 Received: by mail-wi0-f173.google.com with SMTP id bs8so3972991wib.0 for ; Thu, 12 Feb 2015 04:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=kd2DKAK+vgTZM5lxTrDei8LnskGOnmR29Sl6DoxmpSk=; b=ns+dLynEw69AtN/mN/2XlA9LjPr4xbxaAwwBAupV72tOoPHcAqOUu7fLRO9dM9H5x2 5bfF93wXXkO1sS7VgG94nKGNcv0rO/hANIyOm79vuf9XuHeZHkVREgInL9FigJbY7uef DwYwk/nTdchBF6/SLUoHPSbHZy5XHSMHzM4Z8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=kd2DKAK+vgTZM5lxTrDei8LnskGOnmR29Sl6DoxmpSk=; b=XIZSQBs2XIkxYPJqCQv2GumA3F+IO85sQe4b2wFyPheLyYRehQv5VgdbZXhHWkFVhv RFFrTP5qQv74tnjcbzgLX98J5YBN+94MR6U6xWpZ5UAuDeuHVhZgJd+Ag94vCWB0YaYG q1Nl3CdUCDFpZnb88u3TzdnJ4eZUFtGoaznZUI+Z0ZFZ9V4jhgUpYjT27jyPkOe2K50e ia4x+ED6b0N4k6P4KtHyUEd5NlCzgnMaN9imp3PkbSHQ8wAKebQJ82aa0ASdautdm9Ny hsyQbxv4HwrGsYwH7qla4X4Dn+9eBOISmXTmydBx8Ak9dcY14xw4dUibrIGeQ9r5pNSJ 6mqg== X-Gm-Message-State: ALoCoQnXMjLt0+CNE+6OXzwhOD9/pRe8FhyZz975+JSEpmmlVTv9ae9AVSFXRHqSfTvwm8p4Cxcf X-Received: by 10.194.173.138 with SMTP id bk10mr7192270wjc.112.1423744943592; Thu, 12 Feb 2015 04:42:23 -0800 (PST) Received: from zulu.23.e-reka.si (cpe-90-157-247-56.dynamic.amis.net. [90.157.247.56]) by mx.google.com with ESMTPSA id pr9sm5568411wjc.4.2015.02.12.04.42.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Feb 2015 04:42:22 -0800 (PST) Received: from zulu.23.e-reka.si (localhost [127.0.0.1]) by zulu.23.e-reka.si (Postfix) with ESMTP id 5FE62DC8DDDC for ; Thu, 12 Feb 2015 13:42:20 +0100 (CET) Message-ID: <54DC9FAC.6050104@wandisco.com> Date: Thu, 12 Feb 2015 13:42:20 +0100 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: WANdisco User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: dev@subversion.apache.org Subject: Re: svn commit: r1659013 - /subversion/trunk/subversion/libsvn_subr/dso.c References: <20150211174807.615BDAC006C@hades.apache.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 12.02.2015 13:26, Evgeny Kotkov wrote: > Philip Martin writes: > >> Wrap svn_dso_initialize2 call with svn_atomic__init_once, this >> fixes a crash in the DSO hash code when running the C tests in >> parallel. >> >> * subversion/libsvn_subr/dso.c >> (atomic_init_func): New. >> (svn_dso_load): Use svn_atomic__init_once. > I think we should also address this problem in our test suite. As I see, this > change avoids segfaults with --enable-runtime-module-search, but there is more > to it. Documentation for svn_dso_initialize2() states the following (by the > way, the "will not be entirely thread safe" part is now outdated, right?): > > * @note This should be called prior to the creation of any pool that > * is passed to a function that comes from a DSO, otherwise you > * risk having the DSO unloaded before all pool cleanup callbacks > * that live in the DSO have been executed. If it is not called > * prior to @c svn_dso_load being used for the first time there > * will be a best effort attempt made to initialize the subsystem, > * but it will not be entirely thread safe and it risks running > * into the previously mentioned problems with DSO unloading and > * pool cleanup callbacks. > > I am not sure that taking some risks within the test suite is a good idea, > and I think that we should call functions like svn_dso_initialize2() and > svn_fs_initialize(). If we don't, everything might still work fine, but it > also might not, and we could spend a lot of time debugging random failures > if a test runs into one of these pitfalls happening due to the absense of > explicit initialization. We do call these initializers in mod_dav_svn, svn, > svnserve — so why not also do the same in the test programs? > > I don't see a reason to use a custom way of bootstrapping things within > svn_test_main(), as opposed to main() functions in svn, svnadmin and other > command-line tools, and I attached a patch that brings this common approach > to svn_test_main(). Quick inspection shows a couple of other programs that > should probably do the same, e.g., atomic-ra-revprop-change. However, I > think this is less important, and that we could do it separately. > > What do you think? We should make our implementation work without having to run the initializer functions. This is a lot easier for API users. There's almost nothing we can't do within an svn_atomic__init_once block. The only problematic feature is creating pools in an unknown thread context, because we won't know the pool destruction order. Even this problem has been mostly solved in the BDB DB_REGISTER support code. -- Brane