GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mmap.size() raises OSError on Unix for anonymous memory · Issue #87595 · python/cpython

mmap.size() raises OSError on Unix for anonymous memory #87595

New issue
Copy link
New issue
Copy link
Closed
Closed
mmap.size() raises OSError on Unix for anonymous memory#87595
Copy link
Labels
3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

Description

ZackerySpytz
mannequin
opened on Mar 7, 2021
Issue body actions
BPO 43429
Nosy @ZackerySpytz
PRs
  • gh-87595: mmap.size() now returns the size on Unix for anonymous memory #24781
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-03-07.23:29:06.867>
    labels = ['extension-modules', 'type-bug', '3.10']
    title = 'mmap.size() raises OSError on Unix for anonymous memory'
    updated_at = <Date 2021-03-07.23:33:14.666>
    user = 'https://github.com/ZackerySpytz'

    bugs.python.org fields:

    activity = <Date 2021-03-07.23:33:14.666>
    actor = 'ZackerySpytz'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2021-03-07.23:29:06.867>
    creator = 'ZackerySpytz'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43429
    keywords = ['patch']
    message_count = 1.0
    messages = ['388252']
    nosy_count = 1.0
    nosy_names = ['ZackerySpytz']
    pr_nums = ['24781']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43429'
    versions = ['Python 3.10']

    Linked PRs

    • gh-87595: Fix size method on anonymous mmap object #138198
    • [3.14] gh-87595: Support mmap.size() for anonymous mapping on Unix (GH-24781) #138404
    • [3.13] gh-87595: Support mmap.size() for anonymous mapping on Unix (GH-24781) #138405
    • gh-87595: Fix the docs for mmap.size() #138494

    Activity

    1. ZackerySpytz commented on Mar 7, 2021

      @ZackerySpytz
      ZackerySpytzmannequin
      on Mar 7, 2021
      MannequinAuthor
      More actions

      For anonymous memory, mmap.size() works without issue on Windows, but it raises OSError on Unix.

    2. ZackerySpytz
      added
      3.10 (EOL)end of lifeend of life
      extension-modulesC modules in the Modules dirC modules in the Modules dir
      type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
      on Mar 7, 2021
    3. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    4. arhadthedev
      added
      3.11only security fixesonly security fixes
      3.12only security fixesonly security fixes
      and removed
      3.10 (EOL)end of lifeend of life
      on May 12, 2023
    5. serhiy-storchaka commented on Aug 29, 2025

      @serhiy-storchaka
      serhiy-storchaka
      on Aug 29, 2025
      Member
      More actions

      The question is whether this should be classified as a bug fix or a new feature. It seems that mmap.size() never worked for anonymous mapping on Unix, so there is no user code that depends on it. Although this limitation was not documented.

      There are now two PRs, #24781 and #138198. The former adds this as a new feature and has more documentation, the latter treat it as a bug fix and takes into account trackfd.

      I think we should go with #24781, after it was updated.

      Reacted by Petr Viktorin
    6. serhiy-storchaka
      added
      type-featureA feature request or enhancementA feature request or enhancement
      3.15bugs and security fixesbugs and security fixes
      and removed
      type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
      3.11only security fixesonly security fixes
      3.12only security fixesonly security fixes
      on Aug 29, 2025
    7. serhiy-storchaka
      added a commit that references this issue on Sep 2, 2025

      gh-87595: Support mmap.size() for anonymous mapping on Unix (GH-24781)

      32032ee
    8. miss-islington
      added 2 commits that reference this issue on Sep 2, 2025

      pythongh-87595: Support mmap.size() for anonymous mapping on Unix (py…

      147eb94

      pythongh-87595: Support mmap.size() for anonymous mapping on Unix (py…

      8c45634
    9. serhiy-storchaka
      closed this as completedon Sep 2, 2025
    10. serhiy-storchaka commented on Sep 2, 2025

      @serhiy-storchaka
      serhiy-storchaka
      on Sep 2, 2025
      Member
      More actions

      Also, it was decided in the discussion for #138238 that it is better to raise a dedicated error for trackfd=False instead of triggering an OSError by passing invalid handler or descriptor to the OS API.

    11. ZackerySpytz
      added a commit that references this issue on Sep 4, 2025

      pythongh-87595: Fix the docs for mmap.size()

      5e23194
    12. vstinner
      added a commit that references this issue on Sep 4, 2025

      gh-87595: Fix the docs for mmap.size() (#138494)

      9d6b94a
    13. lkollar
      added 2 commits that reference this issue on Sep 9, 2025

      pythongh-87595: Support mmap.size() for anonymous mapping on Unix (py…

      9869e76

      pythongh-87595: Fix the docs for mmap.size() (python#138494)

      85fe034
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.