-
Notifications
You must be signed in to change notification settings - Fork 24
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
[bug] keccak does not work in linux alpine image #15
Comments
@wanseob can you help me reprodce this? Do you have a link to some place where I can do it? |
here is a very basic test: docker run --rm -it node:alpine /bin/sh
/ # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.6
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
/ # mkdir test
/ # cd test
/ # npm init -y
/ # npm install --save keccak
> keccak@3.0.0 install /node_modules/keccak
> node-gyp-build || exit 0
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @1.0.0 No description
npm WARN @1.0.0 No repository field.
+ keccak@3.0.0
added 3 packages from 52 contributors and audited 3 packages in 1.643s
found 0 vulnerabilities
/ # node
Welcome to Node.js v14.5.0.
Type ".help" for more information.
> const createKeccakHash = require('keccak')
> createKeccakHash('keccak256').digest().toString('hex')
'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'
> createKeccakHash('keccak256').update('Hello')
Segmentation fault
|
Hey @fanatid, I dug deeper into this, and I now understand what's going on. The Linux version of this package is being built using glibc, but Alpine Linux (a super popular distro in Docker-land) uses another libc. These are not compatible with each other, so the module ends up crashing. I asked about this in the
I think (1) is pretty easy to implement, but maybe not so much to test, and that (2) is really nice to have, but requires more work, and can be added in the future. If you agree with this, I can send a PR implementing (1). Also, this same problem is probably present in |
Thanks for digging! If first sounds easy we can choose this way right now and try a better solution later. Probably I'll able check this issue on weekend. |
Published as |
Awesome! Thanks for doing both releases! |
Tested the tutorial on node:12-alpine docker image shell but failed. Tutorial works well on Ubuntu.
It failed when I try to call
update()
function with "Segmentation fault (core dumped)" error.The text was updated successfully, but these errors were encountered: