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

signal.signal should check tripped signals #74243

Closed
jdemeyer opened this issue Apr 12, 2017 · 5 comments
Closed

signal.signal should check tripped signals #74243

jdemeyer opened this issue Apr 12, 2017 · 5 comments
Labels
3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@jdemeyer
Copy link
Contributor

BPO 30057
Nosy @pitrou, @jdemeyer
PRs
  • bpo-30057: Fix potential missed signal in signal.signal(). #4258
  • [3.6] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) #4261
  • [2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) #4263
  • Files
  • fix30057-py2.patch: Patch for Python 2
  • fix30057-py3.patch: Patch for Python 3
  • 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 2017-11-03.19:36:58.774>
    created_at = <Date 2017-04-12.15:52:29.807>
    labels = ['interpreter-core', '3.7']
    title = 'signal.signal should check tripped signals'
    updated_at = <Date 2017-11-03.19:36:58.773>
    user = 'https://github.com/jdemeyer'

    bugs.python.org fields:

    activity = <Date 2017-11-03.19:36:58.773>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-03.19:36:58.774>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2017-04-12.15:52:29.807>
    creator = 'jdemeyer'
    dependencies = []
    files = ['46801', '46802']
    hgrepos = []
    issue_num = 30057
    keywords = ['patch']
    message_count = 5.0
    messages = ['291561', '305494', '305497', '305499', '305501']
    nosy_count = 2.0
    nosy_names = ['pitrou', 'jdemeyer']
    pr_nums = ['4258', '4261', '4263']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue30057'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @jdemeyer
    Copy link
    Contributor Author

    There is a race condition in calling signal.signal() if the signal arrives while (or right before) signal.signal() is being executed: the function signal.signal(sig, action) marks the signal "sig" as not tripped. Because of this, signals can get lost. Instead, it would be better to call PyErr_CheckSignals() to check for pending signals.

    @jdemeyer jdemeyer added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Apr 12, 2017
    @pitrou
    Copy link
    Member

    pitrou commented Nov 3, 2017

    Thanks for the report! I will push your patch soon.

    @pitrou pitrou added the 3.7 (EOL) end of life label Nov 3, 2017
    @pitrou
    Copy link
    Member

    pitrou commented Nov 3, 2017

    New changeset f6f90ff by Antoine Pitrou in branch 'master':
    bpo-30057: Fix potential missed signal in signal.signal(). (bpo-4258)
    f6f90ff

    @pitrou
    Copy link
    Member

    pitrou commented Nov 3, 2017

    New changeset ea80ae0 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6':
    bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (bpo-4261)
    ea80ae0

    @pitrou
    Copy link
    Member

    pitrou commented Nov 3, 2017

    New changeset c713837 by Antoine Pitrou in branch '2.7':
    [2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (bpo-4263)
    c713837

    @pitrou pitrou closed this as completed Nov 3, 2017
    @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 interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants