You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
For platforms that implement runtime fallback logic, all paths should be tested #289
Consider the case of Linux. We hope to use the getrandom syscall and then if that fails, we fall back to doing file I/O. We should test at least the following scenerios:
Linux returns ENOSYS, which should trigger the fallback to file I/O.
Linux returns EPERM, which is presently expected to do the same fallback, though there's an issue on file to change this.
I agree that this testing will be challenging for Platforms that aren't Tier 1, but I think we should look into it for Linux and MacOS. Maybe using LD_PRELOAD shenanigans with an older libc could work?
For the syscall vs file fallback, it would be interesting if we could get a ptrace-based test to work.
Activity
josephlr commentedon Oct 13, 2022
I agree that this testing will be challenging for Platforms that aren't Tier 1, but I think we should look into it for Linux and MacOS. Maybe using LD_PRELOAD shenanigans with an older libc could work?
For the syscall vs file fallback, it would be interesting if we could get a ptrace-based test to work.
newpavlov commentedon Oct 7, 2024
Using just older
libcwill not help since we uselibc::syscall. It may be worth to change code ofgetrandom_test_linux_fallbackto usedlopeninstead.linux_android: use `libc::getrandom` (#508)
linux_android: use `libc::getrandom` (rust-random#508)