Skip to content

select.poll() objects are not thread-safe in the free-threaded build #121592

Closed
@colesbury

Description

@colesbury

Bug report

The polling objects returned by select.poll and related functions are not thread-safe in the free-threaded build.

The fix might be as simple as adding critical sections to the functions on pollObject or it may require more work.

The following test exercises the thread-unsafe behavior:

  • ./python -m test test_poll -m test_threaded_poll

Relevant object:

typedef struct {
PyObject_HEAD
PyObject *dict;
int ufd_uptodate;
int ufd_len;
struct pollfd *ufds;
int poll_running;
} pollObject;

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    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