Ripgrep: invalid issue

Created on 17 Oct 2016  路  13Comments  路  Source: BurntSushi/ripgrep

I decided today to test the new arm-unknown-linux-musleabihf target on an ARM device with ripgrep.
The application works but it does not do recursive directory search.
My first guess would be that musl has a bug on ARM(walkdir), but I am not sure, so I open the issue here.

If I search in the folder where the file with the contents is, then it find it.
If I search in the parent folder, than it doesn't find it.

rg --debug doesn't give much info(note that the terminfo error did not appear on another device, but the bug I report was still present):

DEBUG:grep::search: regex ast:
Literal {
    chars: [
        'S',
        'p',
        'e',
        'e',
        'c',
        'h'
    ],
    casei: false
}
DEBUG:grep::literals: literal prefixes detected: Literals { lits: [Complete(Speech)], limit_size: 250, limit_class: 10 }
DEBUG:rg::out: error loading terminfo for coloring: could not find a terminfo entry for this terminal
question

All 13 comments

@lilianmoraru I'm not able to test this, so unfortunately you're on your own. ARM isn't something I'm capable of supporting given the resources I have, but I'm willing to help in any way I can. In this case, I'd suggest trying to reproduce the bug against the walkdir crate if there is indeed a problem with something as simple as directory traversal.

The walkdir example works alright on the ARM device.

I don't think I read this issue closely enough before.

Could you please come up with a concrete and reproducible example? That way, we can test it on multiple platforms and rule out platform specific bugs. Maybe this is some other bug.

This is not reproducible on PC/x86_64.
I had on the ARM device a systemd service that was starting a binary that contained in the name "Speech".
If I would go directly in /lib/systemd/system/ where the file is, and run rg "Speech" it would find it.
If I would then go into /lib/systemd or /lib and run rg "Speech" it would instantly finish without returning anything.

Could you please try to come up with an example that uses mkdir, echo and cat in a fresh directory? As it stands right now, I have no idea how to reproduce your problem.

I'll do better. I'll record an asciinema.
But this will be on Monday, when I get back to work...

Thanks, but I don't think a recording is necessary. What I'd like is a precise sequence of commands that I (or anyone else) can run to reproduce your problem. This means either creating the corpus yourself manually (which is ideal, since it will be small and easy to analyze) or using an existing corpus that we can both access easily (for example, a repository on Github). Your system's systemd directory wouldn't fall into that category, because it's setup by your system's package manager and isn't something I can easily reproduce.

mkdir -p test/1/2/ && echo "text" > test/1/2/file.txt && rg "text" - should do it, but I have to test at work to confirm this.

@lilianmoraru Thanks. Please also include the output of running strace rg "text". Thanks. :-)

Ok, now it is clear why it was not working.
I was searching in /lib/systemd - on PC this folder has other folders and files but on that ARM device, it has only 1 symbolic link(which I was not aware at the time - didn't check).
I tried rg -L(also didn't know that you need to pass that flag but after identifying the issue and playing on PC with symbolic links, I realized that it had nothing to do with ARM specifically) and it worked alright.

Yay!

@lilianmoraru Thank you so much for following up on this by the way. :-)

@BurntSushi Yes, sorry it took so long.
I moved to a new project and was very busy for a while...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kenorb picture kenorb  路  3Comments

kenorb picture kenorb  路  3Comments

chopfitzroy picture chopfitzroy  路  3Comments

crumblingstatue picture crumblingstatue  路  3Comments

hauleth picture hauleth  路  3Comments