From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by sourceware.org (Postfix) with ESMTPS id 562E4385782F for ; Sun, 6 Sep 2020 22:15:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 562E4385782F Received: by mail-ed1-x542.google.com with SMTP id l63so10903413edl.9 for ; Sun, 06 Sep 2020 15:15:21 -0700 (PDT) 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; bh=sV4rvBfvzQveQUGxdG6lXvPirAAI0F3BKiAozw34Zbc=; b=XutaEUURbRr9jTcN4JhqvUZ36I233qZ7ji2Rf5XfLxD09/weZhZw1iUBsc0kRhTT6h pUirduVRJmntsfpcgvqR8kQHgZKN8ylHqIzyjd18UX1s+DD5FgdiVf4Bp9dkI6QZ2NOZ 26bO40zJkFF+vsi2zLDS+8NLij7v/9EJBkWFjVUe6Pq3OZ9HJoeKNEkIEInPC/YhQZui MfFP0QSumhn8c2s+CPBiaZA28tdTyTt6nRSqBkIXE7BW1bkCUMz1+k5ye9dU4P5pzhfX X+snIda6AwUo8iO+b0Q+YXGR4NGMsfZA73MwcCvkTrVt1Zi+SN5iJXMBOQQ8pPy3Bhqc EJtQ== X-Gm-Message-State: AOAM5324wv+Eupj+gHo1Cy9OmyQSUiEoA7svUHzte0ouItJXkJ5YBf3t RUTTXCsXLnB5A7jKzpZyOcFSoE7vkB/TBLyXfzo= X-Google-Smtp-Source: ABdhPJwUjVEUVHZmWER5/Ccd/+sIceCG0luY+4sydrbBDohNy7fac560QwcG/XBiUaz+qQRFCQ5tczVbG0Wms6iEvNU= X-Received: by 2002:a05:6402:1d93:: with SMTP id dk19mr18991685edb.198.1599430520420; Sun, 06 Sep 2020 15:15:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Dyck Date: Sun, 6 Sep 2020 15:15:13 -0700 Message-ID: Subject: Re: ag 2 <(echo 2) gets assertion "p >= path" failed: .. /cygwin-3.1.7 ... /cygwin/path.cc", line 3065, function: int symlink_info::check To: moss@cs.umass.edu Cc: cygwin@cygwin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2020 22:15:22 -0000 On Sun, Sep 6, 2020 at 12:07 PM Eliot Moss wrote: > > On 9/6/2020 2:43 PM, David Dyck via Cygwin wrote: > > This command triggers an assertion failure > > "ag" is from the_silver_searcher > > > > $ ag 2 <(echo 2) > > assertion "p >= path" failed: file > > "/home/corinna/src/cygwin/cygwin-3.1.7/cygwin-3.1.7-1.x86_64/src/newlib-cygwin/winsup/cygwin/path.cc", > > line 3065, function: int symlink_info::check(char*, const > > suffix_info*, fs_info&, path_conv_handle&) > > I just tried this: > > grep 2 <(echo 2) > > on cygwin 3.1.7 and it worked fine. I am not familiar with Silver Searcher, but it would > seem that the problem is more idiosyncratic to that program than to Cygwin more generally. > I am _not_ saying the problem is not in Cygwin - only that ag must be doing something > somewhat different from what grep does with <( ) command input. Perhaps ag is testing > what sort of "thing" (device, etc.) the input file is, while grep does not - something > like that might give different behavior. > > Now I have CYGWIN=winsymlinks:native, which may (almost certainly does) affect what > path.cc is doing (the error message is concerned about symlinks; presumably Cygwin > is trying to check whether /dev/fd/63 is a symlink. > > Well, those are the clues I can offer :-) ... EM Thanks, I tried export CYGWIN=winsymlinks:native and it still asserted I think the "ag" uses mmap and pthreads - at least that is what the manual page indicated - though even when I passed --nommap I still got the assertion, >From man ag: > How is it so fast? > * Searching for literals (no regex) uses Boyer-Moore-Horspool strstr. > * Files are mmap()ed instead of read into a buffer. > * If you're building with PCRE 8.21 or greater, regex searches use the JIT > compiler. > * Ag calls pcre_study() before executing the regex on a jillion files. > * Instead of calling fnmatch() on every pattern in your ignore files, > non-regex patterns are loaded into an array and binary searched. > * Ag uses Pthreads to take advantage of multiple CPU cores and search > files in parallel.