-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
macOS randombytes_buf infinite loop #1303
Comments
I was not able to replicate this, no one ever reported this, and this doesn't happen on CI either. From a vanilla macOS installation with Homebrew, what are the required steps (installation, minimal test case, compilation commands) to replicate this? |
rm -rf autom4te.cache configure Makefile.in ./src/Makefile.in ./src/libsodium/Makefile.in ./src/libsodium/include/Makefile.in ./builds/Makefile.in
./autogen.sh -f -s -o
/opt/d/C/sodium/configure --enable-static --disable-shared --without-pthreads --enable-opt build with flags master branch. now I will try |
recent I upgrade into clang 16. not sure this related. |
Error Are you sure your application doesn't do something else with file descriptor |
It is a huge project, I am not sure other part not touch fd 4. |
Please don't mess with the compilation flags, that doesn't help. And try with 1.0.18-stable release tarballs and just use |
Did the test suite pass when you typed |
when I make test, get some missing symbol error. I will try fix this and made the test. |
???? What symbols are missing? Was |
diff --git a/src/libsodium/randombytes/randombytes.c b/src/libsodium/randombytes/randombytes.c
index 6741434b..ab2429cf 100644
--- a/src/libsodium/randombytes/randombytes.c
+++ b/src/libsodium/randombytes/randombytes.c
@@ -15,7 +15,7 @@
#include "randombytes.h"
#ifndef RANDOMBYTES_CUSTOM_IMPLEMENTATION
# ifdef RANDOMBYTES_DEFAULT_IMPLEMENTATION
-# include "randombytes_internal.h"
+# include "randombytes_internal_random.h"
# endif
# include "randombytes_sysrandom.h"
#endif the make test error lld: error: undefined symbol: crypto_aead_aegis128l_aesni_implementation
>>> referenced by aead_aegis128l.c:142 (src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c:142)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-aead_aegis128l.o):(symbol _crypto_aead_aegis128l_pick_best_implementation+0x22)
lld: error: undefined symbol: crypto_stream_chacha20_dolbeau_ssse3_implementation
>>> referenced by stream_chacha20.c:0 (src/libsodium/crypto_stream/chacha20/stream_chacha20.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-stream_chacha20.o):(symbol _crypto_stream_chacha20_pick_best_implementation+0x2d)
lld: error: undefined symbol: crypto_stream_chacha20_dolbeau_avx2_implementation
>>> referenced by stream_chacha20.c:0 (src/libsodium/crypto_stream/chacha20/stream_chacha20.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-stream_chacha20.o):(symbol _crypto_stream_chacha20_pick_best_implementation+0x1b)
lld: error: undefined symbol: crypto_aead_aegis256_aesni_implementation
>>> referenced by aead_aegis256.c:141 (src/libsodium/crypto_aead/aegis256/aead_aegis256.c:141)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-aead_aegis256.o):(symbol _crypto_aead_aegis256_pick_best_implementation+0x22)
lld: error: undefined symbol: _sodium_blake2b_compress_ssse3
>>> referenced by blake2b-ref.c:0 (src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-blake2b-ref.o):(symbol _sodium_blake2b_pick_best_implementation+0x3a)
lld: error: undefined symbol: _sodium_blake2b_compress_sse41
>>> referenced by blake2b-ref.c:0 (src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-blake2b-ref.o):(symbol _sodium_blake2b_pick_best_implementation+0x1f)
lld: error: undefined symbol: _sodium_blake2b_compress_avx2
>>> referenced by blake2b-ref.c:0 (src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-blake2b-ref.o):(symbol _sodium_blake2b_pick_best_implementation+0xd)
lld: error: undefined symbol: crypto_onetimeauth_poly1305_sse2_implementation
>>> referenced by onetimeauth_poly1305.c:86 (src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c:86)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-onetimeauth_poly1305.o):(symbol _crypto_onetimeauth_poly1305_pick_best_implementation+0x1b)
lld: error: undefined symbol: _sodium_argon2_fill_segment_ssse3
>>> referenced by argon2-core.c:0 (src/libsodium/crypto_pwhash/argon2/argon2-core.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-argon2-core.o):(symbol _crypto_pwhash_argon2_pick_best_implementation+0x28)
lld: error: undefined symbol: _sodium_argon2_fill_segment_avx2
>>> referenced by argon2-core.c:0 (src/libsodium/crypto_pwhash/argon2/argon2-core.c:0)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-argon2-core.o):(symbol _crypto_pwhash_argon2_pick_best_implementation+0xd)
lld: error: undefined symbol: crypto_stream_salsa20_xmm6int_avx2_implementation
>>> referenced by stream_salsa20.c:89 (src/libsodium/crypto_stream/salsa20/stream_salsa20.c:89)
>>> ../../src/libsodium/.libs/libsodium.a(libsodium_la-stream_salsa20.o):(symbol _crypto_stream_salsa20_pick_best_implementation+0x1b)
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
|
If you invent your own way to compile it, you are on your own. Please compile as documented. Either just with |
Also, start from a fresh clone of the repository, or type |
I use ./configure && make check && make install, get this result. # TOTAL: 82
# PASS: 82 I find for the default systemrandom, it work after start init process. late on a client request get this error. so could be some code change the fd. (is there a way to reopen it?) and '-DRANDOMBYTES_DEFAULT_IMPLEMENTATION=&randombytes_internal_implementation' is safe to use for apple OSX, iOS ? |
Once again, no need to touch the compiler flags. There's a function to change the RNG, and it's documented: https://doc.libsodium.org/advanced/custom_rng You should call it before And try calling |
I use
13.2.1
, x86. get this error withrandombytes_buf
:The text was updated successfully, but these errors were encountered: