Skip to content

UBSan: misaligned memory loads in Objects/dictobject.c #127563

Closed
@encukou

Description

@encukou

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

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions