Closed AlexGustafsson closed 3 years ago
This seems to occur pretty much no matter what memory cost I set, even for 65536KiB as in the examples. The service is running in an Alpine container. This seems to mostly affect Docker containers as the bare application works fine when running outside of Docker.
I haven't heard of any memory problems regarding docker. Could you paste the code which results in the failure and the docker commandline to run it here?
Alpine uses the musl libc. the embedded argon2 is compiled against glibc, that's the reason for the SIGSEGV. The workaround is to install argon2 via the apk
package manager:
apk add argon2-dev
I will add that to the documentation. Please let me know if this fixes the problem for you.
I'm running the same issue.. Do you have found a solution ?
Have you tried the suggested fix? Unfortunately I'm no longer part of the project where this issue came up, so I'm unable to test it in context.
I will try to modify my Dockerfile :)
PS: It's working :) Thanks !
Great :) I've added that to the documentation.
On a system with about 400MiB free RAM, trying to hash a password with a memory cost of 256 MiB causes a SIGSEGV.
Excerpt from the log, showing the cause to be this package:
/proc/meminfo
at the time of the crash:There's been some discussion here: https://github.com/P-H-C/phc-winner-argon2/issues/5. Would it be feasible to check the amount of available RAM before invoking the JNA bindings and throw an exception if there's too little? As can be seen in the
/proc/meminfo
output, this might not be accurate as there's a SIGSEGV despite 256MiB being available.