From dev-return-28256-archive-asf-public=cust-asf.ponee.io@apr.apache.org Thu Jul 18 07:56:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id F287218063F for ; Thu, 18 Jul 2019 09:56:04 +0200 (CEST) Received: (qmail 27832 invoked by uid 500); 18 Jul 2019 07:56:04 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 27822 invoked by uid 99); 18 Jul 2019 07:56:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2019 07:56:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 67D67180620 for ; Thu, 18 Jul 2019 07:55:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.301 X-Spam-Level: X-Spam-Status: No, score=0.301 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=googlemail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5_PgHTTKkVll for ; Thu, 18 Jul 2019 07:55:56 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::42c; helo=mail-wr1-x42c.google.com; envelope-from=steve.m.hay@googlemail.com; receiver= Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 67B687DC5E for ; Thu, 18 Jul 2019 07:55:56 +0000 (UTC) Received: by mail-wr1-x42c.google.com with SMTP id p17so27516354wrf.11 for ; Thu, 18 Jul 2019 00:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0fgwZzHLlcR4Fa5yoBU7b0k7dTI7SPTTqpeI9XLuV+s=; b=c14NjeIn4kVd3qXik/mWfsO27AgA3BH8nc4i6tsvUdPCN93BczC7ruCiUtF5Labt1F 46jWickHKs3DQIkUGfV6LzUCw1rQ4mJV9N/cmGduqTvl4B8yhYog0xuYpBKnvjQgF8sp B6bSnWjRgidQEBFhJ/ni0nIFetRO/HjgVISC5+/QP4NP4iAVFYH55Hi3/i8Wypq8dvuR MBDhxBLlC0rFYGaIkQN6XCzGBvFKsFxIAtsY87aHMElp8izySqDA9+e3x7MjZ+Bt46c7 4PN692sqipAv3fQXnKk9su6meFty+ZOiKoh/VO7KDWzz2SgKI5qMPacAW9S1o32wtH7V C8Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0fgwZzHLlcR4Fa5yoBU7b0k7dTI7SPTTqpeI9XLuV+s=; b=cm4HlL73WtXR4zWxN2cDqQw7e99jxsNtvevYsdzsW8ED1DZisxN+i88ZasxjLdX1sB 37kxoCh9fCwQGkyKVZGzP87BzAsUfL+DXOM8lzDRbcvXmzSUmTxWdgsSPaZ31i0oGwa6 k1H3ITX5pEaF0a7etINLA9ZBjd3uOCwMUg7yjRIFKsxLXN6/5hplJcG0TRdCcw6MZx0S CFJVi3iQVJ074i1X1XAlFk+kn/VE4pA69EAigKHgUYs27pTuYwuqU0WKd98ZxrhdOwD0 WofAdAPmxg8xA9cPh6ga0M3xB3tBuyalGlZoD7kwYpflIOTwURKGOkJeDHFzDtXYFdoU H3FA== X-Gm-Message-State: APjAAAUhZUctw5Trn2voiSdNHp4MNO0d4S9Mkpf8ZIgr/ngj3PAzZQ9C Q+Rp0MIn8R/RwBrf4Bs9oizHF4URguH0jxE6Sqs= X-Google-Smtp-Source: APXvYqx373faSwVry0v8/GdgEv61GRqyKI4ufSB/n8CvBA3RCClmLdSh38z5yT8IIrQd1TRJvYwoM1rMO/73TL23hS8= X-Received: by 2002:adf:dd8e:: with SMTP id x14mr47256023wrl.344.1563436550624; Thu, 18 Jul 2019 00:55:50 -0700 (PDT) MIME-Version: 1.0 References: <7da9f7fa-9837-51f2-62b7-dd679887fb07@apache.org> In-Reply-To: From: Steve Hay Date: Thu, 18 Jul 2019 08:55:39 +0100 Message-ID: Subject: Re: apr_stat() sometimes returning APR_INCOMPLETE (70008) on Windows 10 To: =?UTF-8?Q?Branko_=C4=8Cibej?= Cc: APR Developer List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 17 Jul 2019 at 22:12, Steve Hay wrote: > > On Wed, 17 Jul 2019 at 15:04, Branko =C4=8Cibej wrote: > > > > On 17.07.2019 10:18, Steve Hay wrote: > > > On Tue, 16 Jul 2019 at 18:31, Steve Hay = wrote: > > >> On Tue, 16 Jul 2019 at 14:53, William A Rowe Jr wrote: > > >>> On Tue, Jul 16, 2019 at 8:10 AM Steve Hay wrote: > > >>>> I'm in the process of preparing a new mod_perl release and have ru= n > > >>>> into a few test failures on Windows 10 which are caused by apr_sta= t() > > >>>> sometimes returning APR_INCOMPLETE (70008). > > >>>> > > >>>> I'm only getting this on Windows 10. If I run the same build of > > >>>> everything on Windows 7 then everything is fine. I've built everyt= hing > > >>>> from scratch with VS2019. I get the same behaviour with VS2015. > > >>>> > > >>>> I'm using apr-1.7.0 / apr-util-1.6.1. Is it worth trying the lates= t > > >>>> dev versions? > > >>> > > >>> Would you retest with apr-1.6.5? Minor changes to the handling of s= ymbolic > > >>> links (junction/reparse points) on Win32 in 1.7.0 may be to blame. > > >>> > > >>> (Yes, I understand that you are not looking at a symlink in this ca= se.) > > >>> > > >>> > > >> I've built everything in a fresh directory tree in exactly the same > > >> way as before but using 1.6.5 instead of 1.7.0 and it behaves the > > >> same. > > > > I suggest you turn off your virus scanner and try again. > > > > Windows virus scanners are notorious for blocking access to newly > > created files for an unreasonable amount of time, causing downstream > > operations to fail. In Subversion, we had to code an exponential-backof= f > > retry loop into our IO operation wrappers, but only on Windows. > > > > Unfortunately, I'm on a PC controlled by domain admins and I'm unable > to disable the virus scanner. > > > More importantly here (to remove Perl from the equation) the attached > test.c program also works every time, but the APR-equivalent testapr.c > fails every time. > > Can anyone else reproduce this? > > There either seems to be something actually wrong in apr_stat() or > else it's just trying to be too clever and do too much and maybe needs > some backoff & retry logic in it in order to succeed in that, since it > currently seems useless compared to C's stat() and Perl's stat() under > my set of conditions, which are not at all unusual (simply: Windows 10 > with AV turned on). Stepping through that testapr.c program I see the first thing that goes wrong is here: > libapr-1.dll!resolve_prot(apr_finfo_t * finfo, int wanted, _ACL * dacl) L= ine 124 C libapr-1.dll!more_finfo(apr_finfo_t * finfo, const void * ufile, int wanted, int whatfile) Line 356 C libapr-1.dll!apr_file_info_get(apr_finfo_t * finfo, int wanted, apr_file_t * thefile) Line 561 C libapr-1.dll!resolve_ident(apr_finfo_t * finfo, const char * fname, int wanted, apr_pool_t * pool) Line 161 C libapr-1.dll!apr_stat(apr_finfo_t * finfo, const char * fname, int wanted, apr_pool_t * pool) Line 618 C testapr.exe!main() Line 21 C The previous GetEffectiveRightsFromAclW() call to get the APR_FINFO_UPROT worked, but this second call to get APR_FINFO_GPROT has failed. The third call to get APR_FINFO_WPROT also fails. The error from GetEffectiveRightsFromAclW() both times is 8519 (ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER): A global group cannot have a cross-domain member. That's why not everything requested (APR_FINFO_NORM) has been marked as valid, so the final "return ((wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS);" gives us APR_INCOMPLETE. I'm also confused why apr_stat() is doing this twice (once from line 617: resolve_ident() -> apr_file_info_get() -> more_finfo() -> resolve_prot(), and once again on line 791: more_finfo() -> resolve_prot()) given that on line 290 it is commented that "this request is incredibly expensive".