Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Segmentation fault when computing 512bit SHA3 hash #18

wereHamster opened this Issue · 1 comment

2 participants


I have roughly the following code:

return $ BS8.unpack $ BS16.encode $ SHA3.hashlazy 512 contents

And it consistently throws a Segmentation fault exception. The stacktrace indicates that it happens in sha3_finalize:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68e57cd in memset () from /usr/lib/
(gdb) bt
#0  0x00007ffff68e57cd in memset () from /usr/lib/
#1  0x0000000000866af9 in sha3_finalize ()
#2  0x000000000085fc36 in s6PC_info ()
#3  0x0000000000000000 in ?? ()

The content was 141679296 bytes long, which is divisible by 8.

@vincenthz vincenthz closed this issue from a commit
@vincenthz Fix segfault in SHA3 when having message sized aligned with the buffe…
…r size.

When the buffer is full, we need to process it before appending the padding.

fix #18
@vincenthz vincenthz closed this in a69b8c8

Thanks, it's now fixed in 0.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.