Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memfd_create to os module #71023

Closed
tiran opened this issue Apr 24, 2016 · 12 comments
Closed

Add memfd_create to os module #71023

tiran opened this issue Apr 24, 2016 · 12 comments
Labels
3.8 only security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@tiran
Copy link
Member

tiran commented Apr 24, 2016

BPO 26836
Nosy @pitrou, @vstinner, @tiran, @jdemeyer, @applio, @pslacerda, @ZackerySpytz, @miss-islington, @pierreglaser
PRs
  • bpo-26836: Add os.memfd_create() #13567
  • bpo-26836: Add ifdefs for all MFD_HUGE* constants #13666
  • bpo-26836: Document os.memfd_create() name parameter #13838
  • [3.8] bpo-26836: Document os.memfd_create() name parameter (GH-13838) #13839
  • 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 = <Date 2019-06-05.08:46:01.091>
    created_at = <Date 2016-04-24.13:56:03.106>
    labels = ['extension-modules', 'type-feature', '3.8']
    title = 'Add memfd_create to os module'
    updated_at = <Date 2019-06-05.11:16:04.046>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2019-06-05.11:16:04.046>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-05.08:46:01.091>
    closer = 'christian.heimes'
    components = ['Extension Modules']
    creation = <Date 2016-04-24.13:56:03.106>
    creator = 'christian.heimes'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 26836
    keywords = ['patch']
    message_count = 12.0
    messages = ['264109', '268643', '343916', '343917', '343921', '343954', '344033', '344302', '344684', '344685', '344699', '344705']
    nosy_count = 9.0
    nosy_names = ['pitrou', 'vstinner', 'christian.heimes', 'jdemeyer', 'davin', 'Pedro Lacerda', 'ZackerySpytz', 'miss-islington', 'pierreglaser']
    pr_nums = ['13567', '13666', '13838', '13839']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26836'
    versions = ['Python 3.8']

    @tiran
    Copy link
    Member Author

    tiran commented Apr 24, 2016

    Add memfd_create() and constants MFD_ALLOW_SEALING, MFD_CLOEXEC to the os module. A glibc wrapper for memfd_create() is not available yet but the interface has been standardized.

    http://man7.org/linux/man-pages/man2/memfd_create.2.html
    https://dvdhrm.wordpress.com/tag/memfd/

    @tiran tiran self-assigned this Apr 24, 2016
    @tiran tiran added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Apr 24, 2016
    @tiran tiran removed their assignment Jun 12, 2016
    @pslacerda
    Copy link
    Mannequin

    pslacerda mannequin commented Jun 16, 2016

    Maybe useful at mmapmodule.c replacing

        /* SVR4 method to map anonymous memory is to open /dev/zero */
        fd = devzero = _Py_open("/dev/zero", O_RDWR);
    

    tagname is unused at UNIX version of new_mmap_object() so if provided something like could be added for Linux only
    fd = memfd_create(tagname, O_RDWR);

    @ZackerySpytz ZackerySpytz mannequin added the 3.8 only security fixes label May 25, 2019
    @tiran
    Copy link
    Member Author

    tiran commented May 29, 2019

    New changeset 43fdbd2 by Christian Heimes (Zackery Spytz) in branch 'master':
    bpo-26836: Add os.memfd_create() (bpo-13567)
    43fdbd2

    @tiran
    Copy link
    Member Author

    tiran commented May 29, 2019

    https://buildbot.python.org/all/#builders/99/builds/2738 is failing because some HUGE TLB constants are not defined on Gentoo.

    @miss-islington
    Copy link
    Contributor

    New changeset e70bfa9 by Miss Islington (bot) (Zackery Spytz) in branch 'master':
    bpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)
    e70bfa9

    @jdemeyer
    Copy link
    Contributor

    Testsuite breakage: https://bugs.python.org/issue37098

    @pitrou
    Copy link
    Member

    pitrou commented May 31, 2019

    Davin, Pierre, it looks like this could simplify lifetime management of shared memory pools, what do you think?

    @pierreglaser
    Copy link
    Mannequin

    pierreglaser mannequin commented Jun 2, 2019

    From a quick skim at the man page of memfd_create, this looks promising.

    @vstinner
    Copy link
    Member

    vstinner commented Jun 5, 2019

    It seems like this issue can now be closed, no?

    @tiran
    Copy link
    Member Author

    tiran commented Jun 5, 2019

    Yes, the feature is implemented and buildbots are green.

    @tiran tiran closed this as completed Jun 5, 2019
    @miss-islington
    Copy link
    Contributor

    New changeset ccf0efb by Miss Islington (bot) (Victor Stinner) in branch 'master':
    bpo-26836: Document os.memfd_create() name parameter (GH-13838)
    ccf0efb

    @vstinner
    Copy link
    Member

    vstinner commented Jun 5, 2019

    New changeset b496c26 by Victor Stinner (Miss Islington (bot)) in branch '3.8':
    bpo-26836: Document os.memfd_create() name parameter (GH-13838) (GH-13839)
    b496c26

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants