apple / apple/foundationdb

Undefined behaviour analyzer : Member access within misaligned address

Open
#1,434 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
1.6k
Avg merge
1d 20h
Merged PRs (30d)
126

Description

With the Undefined behaviour analyzer enabled in xcode, I get the following warning
when accessing the **_value_length_** and **_value_** members of FDBKeyValue struct following
a call to fdb_transaction_get_range() :

> Member access within misaligned address 0x0001070c00a6 for type 'const FDBKeyValue' (aka 'const keyvalue'), which requires 4 byte alignment

Is there any way to fix this?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the warning in Xcode's Undefined Behavior analyzer around fdb_transaction_get_range() and accesses to the FDBKeyValue _value_length_ and _value_ members. Trace the FDBKeyValue definition and returned range data to determine where the alignment issue is introduced. Done means those member accesses no longer trigger the reported misaligned-address warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.