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 B50B010AC0 for ; Thu, 12 Feb 2015 12:28:29 +0000 (UTC) Received: (qmail 66325 invoked by uid 500); 12 Feb 2015 12:28:29 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 66266 invoked by uid 500); 12 Feb 2015 12:28:29 -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 66256 invoked by uid 99); 12 Feb 2015 12:28:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 12:28:29 +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 (athena.apache.org: domain of evgeny.kotkov@visualsvn.com designates 209.85.217.182 as permitted sender) Received: from [209.85.217.182] (HELO mail-lb0-f182.google.com) (209.85.217.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 12:28:25 +0000 Received: by mail-lb0-f182.google.com with SMTP id f15so8315966lbj.13 for ; Thu, 12 Feb 2015 04:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=visualsvn.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=6aygsxhp8stZwEGQWf4to5hlKHnDXOxfrf8ohf1clTA=; b=QvoSprBXB9Z96N3hUwXsir+GJ9JT9Flzu1FzMIy2qIY+n2d9wY5Sf8amJUgiQOqs+u Xn1vsjw6pY9rHjXXVan+36BEfAs3SysHryOZ+OP6m8W80QORJi3LYoCSB/wgQgNTK7On uILiwv7fwcnq8ChJgyyVil/dKx5S2uH6UhQ1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=6aygsxhp8stZwEGQWf4to5hlKHnDXOxfrf8ohf1clTA=; b=GO7TQiH/LPT55uN7iVGccQZSI42pQy/HjopKZVkvVv1vlQcgEpNq1fwecqvL1AQlzQ /hQvYjoK81zO3yAEM3bSXca0TM97UxUJlkeUn6tA8QG43TwUSi3X7/gyc0gXXKxs7O1K qzuQbkqJZhZkBbOIfcRAzilnI+NmCheECgM1t3i2+BLuEBfqrxktiHWSiBppmFl+xB99 A/Um4ZJQ5Lf68cJYMs/bn4L9GRkn+MMSyt7IX2WC4MgOtQT7/xlouOCqkwGNX7e+MxYP j+qqZe7CSZshv2ZWzBmaVAphwQ/Fq5j/+DYHCaKmJnxkNCjsekIuZI1AYniTqTFhSID4 0J1g== X-Gm-Message-State: ALoCoQlArmg7f+IhcWMfrFGeQ8OAApRZalLRNqsaNsLI16ul2eC7G1ZJ/VbgSFn1/ST+VeHzjP74 X-Received: by 10.152.9.41 with SMTP id w9mr2976015laa.17.1423744038891; Thu, 12 Feb 2015 04:27:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.122.232 with HTTP; Thu, 12 Feb 2015 04:26:57 -0800 (PST) In-Reply-To: <20150211174807.615BDAC006C@hades.apache.org> References: <20150211174807.615BDAC006C@hades.apache.org> From: Evgeny Kotkov Date: Thu, 12 Feb 2015 15:26:57 +0300 Message-ID: Subject: Re: svn commit: r1659013 - /subversion/trunk/subversion/libsvn_subr/dso.c To: philip@apache.org Cc: Subversion Development Content-Type: multipart/mixed; boundary=089e0158b6f8b1132c050ee33d97 X-Virus-Checked: Checked by ClamAV on apache.org --089e0158b6f8b1132c050ee33d97 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, t= his change avoids segfaults with --enable-runtime-module-search, but there is m= ore to it. Documentation for svn_dso_initialize2() states the following (by th= e 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 =E2=80=94 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? Regards, Evgeny Kotkov --089e0158b6f8b1132c050ee33d97 Content-Type: text/plain; charset=US-ASCII; name="svn-tests-initialize-everything-v1.patch.txt" Content-Disposition: attachment; filename="svn-tests-initialize-everything-v1.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i624ehh10 SW5kZXg6IHN1YnZlcnNpb24vdGVzdHMvc3ZuX3Rlc3RfbWFpbi5jDQo9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0g c3VidmVyc2lvbi90ZXN0cy9zdm5fdGVzdF9tYWluLmMJKHJldmlzaW9uIDE2NTkyMTcpDQor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