srijs / rusha

High-performance pure-javascript SHA1 implementation suitable for large binary data, reaching up to half the native speed.
https://npmjs.org/rusha
MIT License
277 stars 32 forks source link

segfault in node.js #22

Closed dominictarr closed 9 years ago

dominictarr commented 9 years ago

It seems totally strange that this could be happening in js, but I'm getting a segfault with this in node.js

I have been benchmarking js hash implementations and before 0.7.8 rusha does very very well, but with 0.7.8 or 0.8.0 it gets a segfault!

clone this repo: https://github.com/dominictarr/crypto-bench and run npm install

then I get this output:

run (N), input-size (bytes), ops (bytes/ms), time (ms)
1, 1, 8.17, 0.12239902080783353
3, 2, 31.24, 0.06402048655569782
5, 3, 31.71, 0.0946073793755913
7, 4, 32.48, 0.12315270935960591
Segmentation fault (core dumped)

this does create many hashes in quick succession... maybe that is related?

srijs commented 9 years ago

Hi Dominic,

I can't reproduce the issue. Can you give me more detail on which platform and node version you are running?

And btw, great work with your benchmark! I saw it earlier and was very impressed :+1:

Cheers, Sam.

dominictarr commented 9 years ago

archlinux, node@0.10.31

okay I upgraded to 0.10.34 and now it doesn't happen.