Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Undefined Behavior triggered in dictobject #136660

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@marler8997

Description

@marler8997

Bug report

Bug description:

When building with ubsan enabled, an unaligned access error gets triggered in dictobject.c. I triggered this on linux x86_64 when interpreting the following script:

importargparseparser=argparse.ArgumentParser()

Here's the ubsan error message:

thread 15767 panic: load of misaligned address 0x386b491 for type 'PyDictUnicodeEntry *', which requires 8 byte alignmentObjects/dictobject.c:1504:21: 0x2916e0e in dictresize (cpython/Objects/dictobject.c)                    memcpy(newentries, oldentries, numentries * sizeof(PyDictUnicodeEntry));                    ^

Adding logs around the call to memcpy reveals thatoldentries contains an unaligned value, but,numentries is also0, which, means most implementations would probably do what the caller expects, namely, nothing.

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp