ITADN

fix: remove alignment assertion that crashes on LMDB data

#111Pull Requestalltheseas 创建于 2025-12-30
A
alltheseascommented
## Summary - Remove 8-byte alignment assertion in `ndb_note_meta_find_entry_impl` that crashes when LMDB returns misaligned metadata pointers - Add explanatory comment about why alignment isn't checked - Add regression test for misaligned metadata access ## Root Cause LMDB does not guarantee 8-byte alignment for stored values. The assertion at `metadata.c:244` assumed aligned pointers, but LMDB stores values at arbitrary offsets within B-tree pages. The packed structs (`#pragma pack(push, 1)`) handle misaligned access correctly on modern ARM (ARMv7+) and x86 architectures. ## Test plan - [x] `make check` passes - [x] New `test_metadata_misaligned` regression test verifies metadata operations work with misaligned pointers (offsets 1-7 bytes) Closes #110 Signed-off-by: alltheseas 🤖 Generated with [Claude Code](https://claude.com/claude-code)
合并状态:未合并 1 条评论