Closed
Description
Bug report
clang
18+'s undefined behavior sanitizer reports two cases of misaligned load:
Objects/unicodeobject.c:5088:24: runtime error: load of misaligned address 0x0000008b74be for type 'const size_t' (aka 'const unsigned long'), which requires 8 byte alignment
0x0000008b74be: note: pointer points here
20 25 73 2e 5f 5f 72 65 70 72 5f 5f 00 72 61 77 20 73 74 72 65 61 6d 20 68 61 73 20 62 65 65 6e
^
and
Objects/dictobject.c:2015:40: runtime error: load of misaligned address 0x5f7d064233d1 for type 'PyDictUnicodeEntry *', which requires 8 byte alignment
0x5f7d064233d1: note: pointer points here
00 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 74 da 0f 06 7d 5f 00 00 df 01 00 00 14
^
Linked PRs
- gh-127563: fix UBSan failure in
dictobject.c
#127568 - [3.13] gh-127563: use
dk_log2_index_bytes=3
in empty dicts (GH-127568) #127798 - [3.12] gh-127563: use
dk_log2_index_bytes=3
in empty dicts (GH-127568) #127813 - [3.11] gh-127563: use
dk_log2_index_bytes=3
in empty dicts (GH-127568) (GH-127813) #135463