Unaligned access in SipHash24 code
Tor segfaults on OpenBSD/sparc64 on startup. GDB backtrace:
#0 siphash24 (src=0xfffffffffffcdc34, src_sz=20, key=Variable "key" is not avai
lable.
)
at src/ext/csiphash.c:118
118 memcpy(&mi, in, 8);
(gdb) bt
#0 siphash24 (src=0xfffffffffffcdc34, src_sz=20, key=Variable "key" is not avai
lable.
)
at src/ext/csiphash.c:118
#1 0x00000026f1b853c8 in node_get_mutable_by_id (identity_digest=Variable "iden
tity_digest" is not available.
)
As you can easily see, node_get_mutable_by_id passes an unaligned pointer to siphash24, which memcpy then tries to copy from. This is a (struct node_t)->identity, so maybe that struct should have alignment padding?
**Trac**:
**Username**: pstumpf
issue