-
Notifications
You must be signed in to change notification settings - Fork 349
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
tests/pass-dep/getrandom.rs ICEs on Solaris #3924
Comments
libc has the same signature for all Solarish OSes: pub fn getrandom(bbuf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; Is old getrandom just wrong? |
getrandom on solaris (11.4 at least) is the same as illumos, just checked. /*
* getrandom(2) syscall & getentropy(2)
*/
#define GRND_NONBLOCK 0x0001
#define GRND_RANDOM 0x0002
#define _GRND_ENTROPY 0xF000 /* Private flag for getentropy(2) */
extern ssize_t getrandom(void *buf, size_t buflen, uint_t flags);
#ifndef _KERNEL
extern int getentropy(void *buf, size_t buflen);
#endif /* _KERNEL */ |
I found this
That matches what rust-random/rand#730 does. Maybe the libc function has/had a different signature than the syscall? |
This blog by Oracle also suggests an |
OTOH, this says |
this manpage says same at this blog post. Was it really a different signature for 11.3 (implementation mistake) or doc mistake that I can t say, never used 11.3 |
glibc mentions 11.4 as the one with the wrong signature, though... very strange. |
The PR that added this to getrandom, rust-random/getrandom#9, mentions Solaris 11.3. So maybe this is really an 11.3 vs 11.4 difference, and the glibc page is wrong. |
skip old getrandom crate on Solaris Fixes #3924 Now we should be able to enable randomness tests on Solarish (and Android, while we are at it).
skip old getrandom crate on Solaris Fixes rust-lang/miri#3924 Now we should be able to enable randomness tests on Solarish (and Android, while we are at it).
To reproduce, run
./miri run --target x86_64-pc-solaris --dep tests/pass-dep/getrandom.rs
:Interestingly, it works fine on Illumos.
The backtrace points at this line
miri/src/shims/unix/foreign_items.rs
Line 793 in 3fec800
My first guess is this might be related to #3842 -- some argument type mismatches can cause ICEs. And strangely, getrandom does use a different signature for this function for Solaris and Illumos:
What is the true signature?
Cc @devnexen
The text was updated successfully, but these errors were encountered: