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

remove_module() needs to save/restore exception state #68236

Closed
opensdh mannequin opened this issue Apr 24, 2015 · 9 comments
Closed

remove_module() needs to save/restore exception state #68236

opensdh mannequin opened this issue Apr 24, 2015 · 9 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@opensdh
Copy link
Mannequin

opensdh mannequin commented Apr 24, 2015

BPO 24048
Nosy @ncoghlan, @ericsnowcurrently, @opensdh, @ZackerySpytz, @miss-islington
PRs
  • bpo-24048: Save the live exception during import.c's remove_module() #13005
  • [3.7] bpo-24048: Save the live exception during import.c's remove_module() (GH-13005) #20521
  • 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 = 'https://github.com/ncoghlan'
    closed_at = <Date 2020-06-28.06:52:49.426>
    created_at = <Date 2015-04-24.05:58:38.623>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7']
    title = 'remove_module() needs to save/restore exception state'
    updated_at = <Date 2020-06-28.06:52:49.425>
    user = 'https://github.com/opensdh'

    bugs.python.org fields:

    activity = <Date 2020-06-28.06:52:49.425>
    actor = 'ncoghlan'
    assignee = 'ncoghlan'
    closed = True
    closed_date = <Date 2020-06-28.06:52:49.426>
    closer = 'ncoghlan'
    components = ['Interpreter Core']
    creation = <Date 2015-04-24.05:58:38.623>
    creator = 'herring'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 24048
    keywords = ['patch']
    message_count = 9.0
    messages = ['241914', '341063', '341905', '342428', '342430', '370329', '370335', '370497', '372498']
    nosy_count = 5.0
    nosy_names = ['ncoghlan', 'eric.snow', 'herring', 'ZackerySpytz', 'miss-islington']
    pr_nums = ['13005', '20521']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24048'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']

    @opensdh
    Copy link
    Mannequin Author

    opensdh mannequin commented Apr 24, 2015

    import.c's remove_module() is always called with an exception set and can invoke arbitrary code via deallocation; if that code calls PyErr_Clear() (or is sensitive to PyErr_Occurred()) it will lose (or be damaged by) the preexisting exception.

    @opensdh opensdh mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Apr 24, 2015
    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Apr 29, 2019

    I've created a PR for this issue.

    @ZackerySpytz ZackerySpytz mannequin added 3.7 (EOL) end of life 3.8 only security fixes labels Apr 29, 2019
    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented May 8, 2019

    New changeset 94a64e9 by Nick Coghlan (Zackery Spytz) in branch 'master':
    bpo-24048: Save the live exception during import.c's remove_module() (GH-13005)
    94a64e9

    @brettcannon
    Copy link
    Member

    Can this be closed, Nick?

    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented May 14, 2019

    I think this change should be backported.

    @brettcannon
    Copy link
    Member

    Assigning to Nick to decide if he wants to backport it to 3.7 before it's no longer possible.

    @miss-islington
    Copy link
    Contributor

    New changeset 5aa40e5 by Miss Islington (bot) in branch '3.7':
    bpo-24048: Save the live exception during import.c's remove_module() (GH-13005)
    5aa40e5

    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented May 31, 2020

    It seems that Serhiy backported the fix.

    @ncoghlan
    Copy link
    Contributor

    Belatedly marking this as resolved.

    @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.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants