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
I first noticed this when running zeromq inside a chroot on nixos; it was trying to open /dev/urandom and failing. Building manually, I noticed that cmake checks for getrandom() in zmq_check_getrandom() but then never sets -DZMQ_HAVE_GETRANDOM at buildtime
Environment
libzmq version (commit hash if unreleased): 4.3.2
OS: Linux/NixOS
Minimal test code / Steps to reproduce the issue
Start with source on any system with getrandom()
mkdir build
cd build
cmake ..
Ensure the following in output:
-- Performing Test ZMQ_HAVE_GETRANDOM
-- Performing Test ZMQ_HAVE_GETRANDOM - Success
Build the whole system, strace any program that initializes zeromq
What's the actual result? (include assertion message & call stack if applicable)
In step #5 above, -DZMQ_HAVE_GETRANDOM does not appear on the command line
In step #6 above tweenacl,c.o has no match to the string "getrandom"
In step #7 above, observe that "/dev/urandom" is being opened, indicating getrandom is not in use
What's the expected result?
We should see -DZMQ_HAVE_GETRANDOM on the build command-line
grep should find a "getrandom" string in the tweentnacl binary file
initializing zeromq should not open /dev/urandom
Patch that fixes the problem
The following patch fixes the issue for getrandom(). I don't know if it's the idiomatic way to do it with cmake, and I suspect that most of the other checks will need updating as well (e.g. ZMQ_HAVE_NOEXCEPT seems to similarly have no effect), so I didn't make a PR:
This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.
Issue description
I first noticed this when running zeromq inside a chroot on nixos; it was trying to open /dev/urandom and failing. Building manually, I noticed that cmake checks for getrandom() in zmq_check_getrandom() but then never sets
-DZMQ_HAVE_GETRANDOM
at buildtimeEnvironment
Minimal test code / Steps to reproduce the issue
mkdir build
cd build
cmake ..
grep getrandom CMakeFiles/objects.dir/src/tweetnacl.c.o
What's the actual result? (include assertion message & call stack if applicable)
In step #5 above,
-DZMQ_HAVE_GETRANDOM
does not appear on the command lineIn step #6 above tweenacl,c.o has no match to the string "getrandom"
In step #7 above, observe that "/dev/urandom" is being opened, indicating getrandom is not in use
What's the expected result?
Patch that fixes the problem
The following patch fixes the issue for getrandom(). I don't know if it's the idiomatic way to do it with cmake, and I suspect that most of the other checks will need updating as well (e.g. ZMQ_HAVE_NOEXCEPT seems to similarly have no effect), so I didn't make a PR:
The text was updated successfully, but these errors were encountered: