Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve assertion messages from Random::secureRandom
Summary: When the PCHECK for read() in Random::secureRandom fails, the message is often misleading. In the following case, bytesRead != size caused the assertion failure. Unfortunately, the message includes an unrelated error message ("No such file or directory"), which can throw people off: F1031 13:15:26.997059 270573 Random.cpp:69] Check failed: bytesRead >= 0 && size_t(bytesRead) == size : No such file or directory [2] Improve the message by splitting the PCHECK into a PCHECK (for the read() error) and a CHECK_EQ (for the logic error): F1108 17:33:31.771008 3185333 Random.cpp:70] Check failed: size_t(bytesRead) == size (112960 vs. 1048576) Reviewed By: yfeldblum, simpkins Differential Revision: D12856276 fbshipit-source-id: fe9067972db805a54f2cc290aab11bac425601ef
- Loading branch information