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

Fixes bugs found by pyfailmalloc during Python initialization #62720

Closed
vstinner opened this issue Jul 21, 2013 · 9 comments
Closed

Fixes bugs found by pyfailmalloc during Python initialization #62720

vstinner opened this issue Jul 21, 2013 · 9 comments

Comments

@vstinner
Copy link
Member

BPO 18520
Nosy @jcea, @vstinner, @skrah
PRs
  • bpo-30547: Fix multiple reference leaks #1995
  • 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 2013-07-22.22:47:29.167>
    created_at = <Date 2013-07-21.11:22:44.264>
    labels = []
    title = 'Fixes bugs found by pyfailmalloc during Python initialization'
    updated_at = <Date 2017-06-08.10:16:46.312>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-06-08.10:16:46.312>
    actor = 'matrixise'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-07-22.22:47:29.167>
    closer = 'vstinner'
    components = []
    creation = <Date 2013-07-21.11:22:44.264>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 18520
    keywords = []
    message_count = 9.0
    messages = ['193439', '193440', '193441', '193567', '193572', '201467', '201471', '201472', '201475']
    nosy_count = 4.0
    nosy_names = ['jcea', 'vstinner', 'skrah', 'python-dev']
    pr_nums = ['1995']
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue18520'
    versions = ['Python 3.4']

    @vstinner
    Copy link
    Member Author

    I'm working on a version of pyfailmalloc integrated into CPython to inject memory allocation failures duging Python startup. As expected, I found new bugs.

    I create this issue to track these bugs and their fix, as I did with the issue bpo-18408.

    Home page of the project:
    https://pypi.python.org/pypi/pyfailmalloc

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 21, 2013

    New changeset 276477d5a548 by Victor Stinner in branch 'default':
    Issue bpo-18520: Fix initsigs(), handle PyOS_InitInterrupts() error
    http://hg.python.org/cpython/rev/276477d5a548

    @vstinner
    Copy link
    Member Author

    PyStructSequence_InitTypeWithError() return type is void, whereas it can fail and raise an exception. Can I change the return type, or should I create a new function?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 22, 2013

    New changeset fc718c177ee6 by Victor Stinner in branch 'default':
    Issue bpo-18520: Add a new PyStructSequence_InitType2() function, same than
    http://hg.python.org/cpython/rev/fc718c177ee6

    New changeset 9b77b3ee6fb8 by Victor Stinner in branch 'default':
    Issue bpo-18520: PyErr_NoMemory() now fails with a fatal error if it is called
    http://hg.python.org/cpython/rev/9b77b3ee6fb8

    New changeset 31796b188bec by Victor Stinner in branch 'default':
    Issue bpo-18520: Fix _PySys_Init(), handle PyDict_SetItemString() errors
    http://hg.python.org/cpython/rev/31796b188bec

    New changeset d38348173c46 by Victor Stinner in branch 'default':
    Issue bpo-18520: initsite() is a little bit more verbose when import site fails
    http://hg.python.org/cpython/rev/d38348173c46

    New changeset 9267a0b836b7 by Victor Stinner in branch 'default':
    Issue bpo-18520: Fix PyFunction_NewWithQualName() error handling
    http://hg.python.org/cpython/rev/9267a0b836b7

    New changeset 4a69dbe71aeb by Victor Stinner in branch 'default':
    Issue bpo-18520: Fix _PyDict_GetItemId(), suppress _PyUnicode_FromId() error
    http://hg.python.org/cpython/rev/4a69dbe71aeb

    New changeset a4998e8fd7fc by Victor Stinner in branch 'default':
    Issue bpo-18520: Fix initstdio(), handle PySys_SetObject() failure
    http://hg.python.org/cpython/rev/a4998e8fd7fc

    @vstinner
    Copy link
    Member Author

    I ran my test for more than 30 minutes and I didn't find any interesting bug anymore, so I'm closing the issue.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Oct 27, 2013

    Victor, could you look at the end of bpo-10241? Starting from 31796b188bec,
    many values in _PySys_Init() have 2 references. Why is that required?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 27, 2013

    New changeset 5eb00460e6e8 by Victor Stinner in branch 'default':
    Issue bpo-18520: fix reference leak in _PySys_Init()
    http://hg.python.org/cpython/rev/5eb00460e6e8

    @vstinner
    Copy link
    Member Author

    Victor, could you look at the end of bpo-10241? Starting from 31796b188bec,
    many values in _PySys_Init() have 2 references. Why is that required?

    It was a mistake, it should now be fixed. Nice catch.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Oct 27, 2013

    Ah, thanks. I was wondering if there was some obscure reason that escaped me.

    @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
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant