-
Notifications
You must be signed in to change notification settings - Fork 353
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
Shim wishlist #2057
Comments
|
implement strerror_r This isn't perfect; we end up using [this match](https://github.com/rust-lang/rust/blob/72a25d05bf1a4b155d74139ef700ff93af6d8e22/library/std/src/io/error.rs#L380) rather than the platform-specific messages, but at least we show something -- this is mostly informational anyway. Cc #2057
Wish granted. ;) #2067 Just N-1 to go... |
This the first CPython api call that Rust programs embedding the python interpreter will do. I would really like to test I know Python's C api is too big to shim, but I would love to see some solution for this. |
I have a similar wishlist for testing a PHP extension library. Currently it fails at |
mmap() is the one i'm currently missing. for my purposes it could just use a boxed slice. would be a little painful on memory, but enough to get miri running. |
Read-only mmap where you don't write to the backing file shouldn't be too hard to implement. If writes through either the mapping or through the backing file are allowed, it becomes a lot harder to implement unix compatible semantics. |
Ah, I see what you mean. Fortunately, I'm only using anonymous mappings. |
Thanks for the list! I picked the easiest one I could see near the top (realpath): Is there any way we can get a couple of example crates for each missing shim in the list so implementers can check the before and after with real code? |
I've manually grabbed a list for you for I have a very simple website which is just Cloudfront + S3 at https://miri.saethlin.dev (most people care about https://miri.saethlin.dev/ub). I'm not opposed to making simple additions, like a way to download all the raw logs in a |
Since @eduardosm has been doing some amazing work on implementing LLVM x86 intrinsics, here's my list of those that are encountered currently in test suites:
|
Implement `llvm.ctpop.v*` intrinsics Tested through x86 avx512vpopcntdq and avx512bitalg functions. I picked them from #2057 (comment), which looked easy.
Implement `llvm.ctpop.v*` intrinsics Tested through x86 avx512vpopcntdq and avx512bitalg functions. I picked them from rust-lang/miri#2057 (comment), which looked easy.
Here's an update:
I do not know what happened to the |
Thanks for posting this. We use miri in Materialize and seem to be having a different set of unsupported operations, basically our wishlist:
|
Miri does not support some operations that it currently does. We don't do IO inside in-memory tests, so that should be fine. Miri progress on supporting these is tracked [here](rust-lang/miri#2057)
Add localtime_r shim - Implement ``localtime_r`` shim as mentioned in #2057 Note: - ``tm_zone``, ``tm_gmtoff`` might not be consistent with ``libc::localtime_r`` as custom implementation is provided through ``chrono``. Due to the lack of daylight saving information in ``chrono``, ``is_dst`` value will always be ``-1``.
My list of desired shims: |
Add `pread` and `pwrite` shims Requested in #2057.
@saethlin it might be time to update the list for FFI shims as well -- the two first items in the list at the top of this issue are now implemented in Miri. :D
|
I've updated the issue description with all the crates I've run this month, which is the ~32,000 crates with the most downloads in the last 90 days. I'm quite surprised that we don't see a bunch of |
I run Miri on the most-downloaded crates, with the flags
-Zmiri-panic-on-unsupported
and--no-fail-fast
which basically asks Miri to try to run as many tests as it can. Searching all my build logs, I find these are the most-encounteredcan't call foreign function:
errors:There are some pretty obvious biases in this data. For example, crates with a lot of tests get their favorite symbols counted more than crates with fewer tests.
There are also a lot of things in here which I don't think we will ever support via shims. We're not going to have shims for openssl. We're also not going to shim CUDA or JavaScript, and also all those errors are from 3 crates using CUDA and 1 crate doing some JavaScript thing.
But in any case, this is a starting point for prioritizing what shims should be added. Just in case there isn't anyone out there who already has a pet function they want added.
@drmeepster asked me to run some crates with a Windows target. Here's what the first ~2k crates run into:
I don't know what
GetFullPathNameW
is coming from, but when crates hit it, they usually have tends to hundreds of tests that attempt to use it. Possibly it's fromproptest
?prost
is one of the crates that hits it a bunch of times.The text was updated successfully, but these errors were encountered: