Closed
Description
Noticed the following when running my app: Assertion failed: (ret == 0), function isaac_seed, file /Users/jessejones/Source/Third_Party/rust/src/rt/rust_util.h, line 153.
Doesn't seem especially reproducible.
Looking at the header:
- The assert is firing when trying to close a /dev/urandom file descriptor. I can see checking for errors on a descriptor being written to (the close will often flush buffered data), but failing because close failed for reads seems a lot iffier.
- All the error checking in isaac_seed (including Windows) is using asserts which seems questionable: usually those should be reserved to catch errors programmers make, not arbitrary errors the runtime will throw up (especially if those errors may be ifdef'ed out).
- It'd be great if the Unix code used perror.
This was on a Mac. I note that man 2 close
lists three reasons why close may fail including the perennial favorite "execution was interrupted by a signal".