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

gh-118608: datetime: Fix use-after-free on embedded CPython#118531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
neonene wants to merge9 commits intopython:mainfromneonene:statickey
Closed

gh-118608: datetime: Fix use-after-free on embedded CPython#118531

neonene wants to merge9 commits intopython:mainfromneonene:statickey

Conversation

@neonene
Copy link
Contributor

@neoneneneonene commentedMay 3, 2024
edited by bedevere-appbot
Loading

Debug build on Windows (and CI:7bbce38):

>_testembed_d test_repeated_init_exec "import datetime"--- Loop #1 ------ Loop #2 ---Assertion failed: PyUnicode_CheckExact(ep_key), file C:\a\Objects\dictobject.c, line 1119

At theLoop #2, the static types are carried over in the_datetime module, but theirtp_dict no longer has valid keys, since all interned strings (keys) are freed after_PyUnicode_ClearInterned() inunicodeobject.c is invoked.

To check a key without a crash, the following strings need to be statically allocated:

  • The names inPyMemberDef array
  • The names inPyMethodDef array
  • The names inPyGetSetDef array
  • Thekey parameters of thePyDict_SetItemString(tp_dict, key, value) calls.

This patch includes the names that are already statically allocated (e.g. getset names).


@bedevere-appbedevere-appbot added the testsTests in the Lib/test dir labelMay 3, 2024
@neoneneneonene changed the titledatetime: Fix use-after-free on embedded CPythongh-113055: datetime: Fix use-after-free on embedded CPythonMay 3, 2024
@neoneneneonene marked this pull request as ready for reviewMay 3, 2024 02:24
@neoneneneonene changed the titlegh-113055: datetime: Fix use-after-free on embedded CPythongh-118608: datetime: Fix use-after-free on embedded CPythonMay 5, 2024
@neoneneneonene marked this pull request as draftMay 5, 2024 20:04
@neoneneneonene deleted the statickey branchMay 23, 2024 14:21
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

Assignees

No one assigned

Labels

testsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@neonene

[8]ページ先頭

©2009-2025 Movatter.jp