Skip to content

Possible integer overflow when call PyDTrace_GC_DONE() #76986

Closed

Description

@serhiy-storchaka
BPO 32805
Nosy @jcea, @vstinner, @ambv, @serhiy-storchaka
PRs
  • bpo-32805: Fix compiler warnings in gcmodule.c #11010
  • 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-08-31.20:29:43.602>
    created_at = <Date 2018-02-09.09:27:38.990>
    labels = ['interpreter-core', 'type-bug', '3.8']
    title = 'Possible integer overflow when call PyDTrace_GC_DONE()'
    updated_at = <Date 2019-08-31.20:29:43.602>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-08-31.20:29:43.602>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-31.20:29:43.602>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2018-02-09.09:27:38.990>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32805
    keywords = ['patch']
    message_count = 4.0
    messages = ['311870', '313857', '337329', '337330']
    nosy_count = 4.0
    nosy_names = ['jcea', 'vstinner', 'lukasz.langa', 'serhiy.storchaka']
    pr_nums = ['11010']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32805'
    versions = ['Python 3.8']

    Activity

    1. serhiy-storchaka commented on Feb 9, 2018

      @serhiy-storchaka
      MemberAuthor

      PyDTrace_GC_DONE() accepts the argument of type int. But it is called with the sum of collected and uncollectable objects which has type Py_ssize_t and can be larger that maximal int.

      This produces a compiler warning on Windows:

      ..\Modules\gcmodule.c(978): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\buildarea\3.x.bolen-windows10\build\PCbuild\pythoncore.vcxproj]

      and looks as not false alarm.

    2. serhiy-storchaka commented on Mar 15, 2018

      @serhiy-storchaka
      MemberAuthor

      DTrace support was implemented in bpo-21590 (changeset a785c87).

    3. vstinner commented on Mar 6, 2019

      @vstinner
      Member

      The warning in the C code has been fixed by:

      New changeset edad38e by Victor Stinner (Jeremy Kloth) in branch 'master':
      bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)
      edad38e

      The remaining question is if Include/pydtrace.d must be updated or not:
      #11010 (comment)

    4. vstinner commented on Mar 6, 2019

      @vstinner
      Member

      I don't think that Python 3.7 should be modified. I prefer to avoid any risk and only modify Python 3.8.

    5. transferred this issue fromon Apr 10, 2022
    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.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions