P-H-C / phc-winner-argon2

The password hash Argon2, winner of PHC
Other
4.78k stars 406 forks source link

Binary built on macOS 10.15 Catalina exits with segmentation fault #280

Closed mr-j-tree closed 4 years ago

mr-j-tree commented 4 years ago

When I build argon2 on macOS 10.15 Catalina (19A602) it produces a binary but the binary does not work - it always exits with a segmentation fault when trying to produce a hash. Running make test also fails. My shell is zsh, and I have Apple's current command line tools installed . Here are the steps I took:

% make 
Building with optimizations for native
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread -march=native  src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c src/run.c -o argon2

No error is thrown during build, and the argon2 binary is created as expected. Running tests:

% make test
Building with optimizations for native
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread -march=native  -Wextra -Wno-type-limits src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c src/test.c -o testcase
ld: can't write output file: testcase for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [test] Error 1

If I try and produce a hash using the produced argon2 binary:

% ./argon2 ThisIsMySalt
asdfjkl
Type:       Argon2i
Iterations: 3
Memory:     4096 KiB
Parallelism:    1
zsh: segmentation fault  ./argon2 ThisIsMySalt

That's it!

jedisct1 commented 4 years ago

Known issue: https://github.com/jedisct1/libsodium/issues/881

zeph commented 4 years ago

can this be related? https://github.com/openzfsonosx/zfs/issues/749

khovratovich commented 4 years ago

Not Argon2 problem apparently