Download raw body.
MurmurHash2 unaligned access
On Thu, Oct 14, 2021 at 07:02:37PM +0200, Christian Weisgerber wrote: > Stefan Sperling: > > > Just out of curiousity, can you produce a short > > program that calls murmurhash2 and triggers an alignment fault on sparc64, > > octeon, or similar platforms? > > I don't have a strict alignment arch at hand, but this should do > it: > > #include <sys/types.h> > #include <murmurhash2.h> > #include <stdio.h> > > #define SIZE 10 > > int main(void) > { > char a[SIZE+4]; > int i; > > for (i = 0; i < 4; i++) { > printf("%d\n", i); > fflush(stdout); > murmurhash2(a+i, SIZE, 0); > } > > return 0; > } Yes, this triggers are core dump on sparc64: $ cc naddy.c $ ./a.out 0 1 Bus error (core dumped) $ And with fixed murmurhash2: $ ./a.out 0 1 2 3 $ Thank you for providing a test case!
MurmurHash2 unaligned access