Details
-
Bug
-
Status: Done
-
Medium
-
Resolution: Fixed
-
5.6.38-83.0, 5.7.20-18
-
None
Description
In omt.cc, we take an address of a data member in a templated function:
https://github.com/percona/PerconaFT/blob/416a28e514ddd8918465d186c44b408f426f621c/util/omt.cc#L762?
This function is instantiated with an instance of omt_node_templated:
https://github.com/percona/PerconaFT/blob/91273dbcebaa682c72b48bd0917ad2e4efc291d8/util/omt.h#L195
Where the omtdata_t member is a referenced_xid_tuple, which is an 8 byte aligned type currently.
Because of the packing/alignment of omt_node_templated, the value member is potentially unaligned, and taking the address of an unaligned data member is undefined behavior and a potential crash source on some platforms. Clang reports a warning about this.
We have several possible solutions:
- Silence the warning, as this shouldn't cause any issues on x86
- Remove the packing/alignment attributes from omt_node_templated
- Relax the alignment requirements of referenced_xid_tuple
- ?
Attachments
Issue Links
- is triggering
-
PS-4349 Advance FT submodule commit pointer to pick up several changes
-
- Done
-