-
Notifications
You must be signed in to change notification settings - Fork 99
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
Miri test fails because of neon intrinsic in aho_corasick #138
Comments
This seems like a bug report (or feature request) for Miri, not this crate. |
Well we could have non-optimized functions that would work on aarch64 miri, and also other architectures, but I can try over at Miri instead |
Those already exist. The tests that are failing are specifically testing the optimized paths. Miri tests don't succeed on x86 either. Fixing this on my end probably means going through and adding a bunch of miri conditional compilation things to skip certain tests. I do that on some crates (like memchr and regex-automata), but it's pretty annoying to do. It also somewhat defeats the purpose, because the optimized paths are exactly where you want miri the most. |
Are you sure about that? Miri has decent x86_64 shims as of rather recently; with default flags the searcher fails to build (I didn't look into why yet, probably a runtime CPU feature detection fails) but this seems to work:
|
That's what I tried. I didn't dig into it. |
I'll reopen this for now since it looks like some further investigation might be warranted. With that said, the original error message for aarch64 is pretty clear. In that case, miri likely needs support for neon. |
I agree with that completely. Miri doesn't have much if any neon support and would need a lot for this use case. |
Ah; the reason tests don't work on Miri + x86 by default is that aho-corasick tries to do runtime CPU feature detection (in Up to you if you think there's something more reasonable to do in this case I guess? I don't know if there's something more reasonable that Miri could do here; using anything other than the target baseline by default seems dubious for a cross-interpreter. |
Would it be possible to spell this out in more detail? I totally trust what you're saying here, I just don't completely grok it. I think my underlying question is, why can't Miri let runtime CPU feature detection actually inspect the CPU features of the host? Like, what is the blocker? (I say this with curiosity and ignorance, not with combativeness.) It is great that Miri can run with |
I think one of the issues I ran into here is that I didn't want to just silently skip the tests if building the searcher failed. I wanted that to be loud. Otherwise, it's too easy for a test that should fail to just silently pass. I don't think I dug in too much at this point and kind of just ran out of steam. And I don't think I knew the tidbit about Miri not doing runtime CPU feature detection, so was perhaps confused. But now that I know that, I think I can rejigger the tests a bit to make this work more nicely. |
Miri tries rather hard to be a portable cross-interpreter. I can run Miri on an M1 and ask it for With isolation disabled is a slightly more interesting question; it might make sense to default to "whatever the host has", but then it's not entirely clear what to do when cross-interpreting because the CPU feature detection in stdarch depends on architecture and OS. We couldn't just have Miri directly run the standard library code for But then we have a UI problem where we need to figure out what people should do to give Miri access to the filesystem but not to runtime feature detection, so that we can have reproducible errors in programs that need to read a file but also need to do some SIMD. A lot of people globally disable isolation because so few real programs work with it, so it's really not clear what direction an "isolation includes CPU feature detection" flag should go. I don't think there are any hard blockers, but passing through to the host is a sticky mess for a cross-interpreter. |
Gotya, thank you for explaining that. That makes sense! I see the problem now. |
We are using the
Regex
crate inLibAFL
and when running amiri
test on Mac M1, the tests fail due to a neon intrinsic. They work fine on Linux/x86.See AFLplusplus/LibAFL#1762
The text was updated successfully, but these errors were encountered: