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

MemoryError freelist is not thread-safe in free threaded build #129668

Closed
Assignees
colesbury
Labels
3.13bugs and security fixes3.14bugs and security fixestopic-free-threadingtype-bugAn unexpected behavior, bug, or error
@colesbury

Description

@colesbury

Bug report

TheMemoryError freelist isn't thread-safe if the GIL is disabled:

/* Fetch object from freelist and revive it */
self=state->memerrors_freelist;
self->args=PyTuple_New(0);
/* This shouldn't happen since the empty tuple is persistent */
if (self->args==NULL) {
returnNULL;
}
state->memerrors_freelist= (PyBaseExceptionObject*)self->dict;
state->memerrors_numfree--;

Most of the freelists were made thread-safe by making them per-thread in the free threaded build (usingpycore_freelist.h), but we don't want to do that forMemoryError because its freelist serves a different purpose (it's not really for performance). I think we should just use a lock forMemoryError's freelist.

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixes3.14bugs and security fixestopic-free-threadingtype-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