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 when using selectors on Solaris #102494

Labels
OS-unsupportedstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@kulikjak

Description

@kulikjak

If you setulimit -n unlimited on Solaris and its derivatives (where/dev/poll is available) and importselectors, Python crashes with aMemoryError:

> ulimit -n unlimited> python3.11 -c"import selectors"Traceback (most recentcall last):  File"<string>", line 1, in<module>  File"/usr/lib/python3.11/selectors.py", line 613, in<module>    elif _can_use('devpoll'):^^^^^^^^^^^^^^^^^^^  File"/usr/lib/python3.11/selectors.py", line 594, in _can_use    selector_obj = selector()^^^^^^^^^^MemoryError

The issue is that Python usesRLIMIT_NOFILE to allocatedthat manystruct pollfds, and there is no upper limit. Infinity is represented by something close to INT_MAX, and the allocation thus fails.

Your environment

I tested this on Oracle Solaris with 3.11, 3.9 and 3.7 (where you need a slightly different way to crash it:python3.7 -c "import select; select.devpoll()").

I verified that on SmartOS, it behaves the same way (on SmartOS, you can actually set hugeulimit -n values that break it as well).

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-unsupportedstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp