public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: David Dyck <david.dyck@gmail.com>
Cc: cygwin@cygwin.com
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
Date: Sun, 6 Sep 2020 19:19:25 -0400	[thread overview]
Message-ID: <eb3eeba5-72ff-a3b4-6b94-106943c3a1bd@cs.umass.edu> (raw)
In-Reply-To: <CAJtSMgsu3u+DpqBmot8=o3z8zxBjU-yAY9fm8-ztz1xpMkFCEQ@mail.gmail.com>

On 9/6/2020 6:15 PM, David Dyck wrote:
> 
> 
> On Sun, Sep 6, 2020 at 12:07 PM Eliot Moss <moss@cs.umass.edu <mailto:moss@cs.umass.edu>> 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.

Yes, mmap would fail on a device file like this, but the failure is when trying to open a
.ignore file under the device file (which won't exist), as I recall.  As others indicated,
there is a problem in cygwin.  It might have to do with flavors of symlink, but maybe not.
Anyway, seems folks are onto it.

Best wishes - EM

  reply	other threads:[~2020-09-06 23:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 18:43 David Dyck
2020-09-06 19:07 ` Eliot Moss
2020-09-06 22:15   ` David Dyck
2020-09-06 23:19     ` Eliot Moss [this message]
2020-09-06 19:47 ` Ken Brown
2020-09-06 20:28   ` Ken Brown
2020-09-07 20:35     ` Ken Brown
2020-09-08 19:26       ` Ken Brown
2020-09-08 19:32         ` Ken Brown
2020-09-09  3:48           ` David Dyck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb3eeba5-72ff-a3b4-6b94-106943c3a1bd@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    --cc=david.dyck@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).