Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ripgrep misses a match but succeeds with -S and -i #781

Closed
OliverUv opened this issue Feb 8, 2018 · 2 comments
Closed

ripgrep misses a match but succeeds with -S and -i #781

OliverUv opened this issue Feb 8, 2018 · 2 comments
Labels
bug A bug.

Comments

@OliverUv
Copy link

OliverUv commented Feb 8, 2018

What version of ripgrep are you using?

ripgrep 0.7.1
-AVX -SIMD

What operating system are you using ripgrep on?

Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:        17.10
Codename:       artful
> uname -srvpoi
Linux 4.13.0-31-generic #34-Ubuntu SMP Fri Jan 19 16:34:46 UTC 2018 x86_64 x86_64 GNU/Linux

If this is a bug, what are the steps to reproduce the behavior?

Download rgbug.tar.gz, unpack, enter the contained directory, then search for clone_created.

If this is a bug, what is the actual behavior?

https://gist.github.com/e1af638724793b341eee4f4f9e902afd

If this is a bug, what is the expected behavior?

Following the reproduction instructions will show a result from file one.ts, it should also show a result from two.ts. If used with the -i or -S flags, both results are shown as expected.

@lilydjwg
Copy link
Contributor

lilydjwg commented Feb 8, 2018

I get a similar issue and git bisect reports that 7dd1194 is the first bad commit.

@BurntSushi
Copy link
Owner

BurntSushi commented Feb 8, 2018

@lilydjwg Thanks for the bisect! That is indeed the cause of the issue. That commit updated the regex library, which had a new Boyer-Moore optimization. Apparently, the implementation of Boyer-Moore is buggy.

This should be fixed in the next release.

(The reason why -i/--ignore-case "fixes" this is because it causes a different optimization to be used instead of Boyer-Moore.)

Thanks @OliverUv for the great bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug.
Projects
None yet
Development

No branches or pull requests

3 participants