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

Premature Py_DECREF while generating a TypeError in call_tzinfo_method #66243

Closed
Knio mannequin opened this issue Jul 23, 2014 · 4 comments
Closed

Premature Py_DECREF while generating a TypeError in call_tzinfo_method #66243

Knio mannequin opened this issue Jul 23, 2014 · 4 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@Knio
Copy link
Mannequin

Knio mannequin commented Jul 23, 2014

BPO 22044
Nosy @rhettinger, @abalkin
Files
  • python_bug.diff: patch
  • python_crash.py: test case
  • 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/rhettinger'
    closed_at = <Date 2014-07-25.22:02:41.304>
    created_at = <Date 2014-07-23.04:53:02.047>
    labels = ['library', 'type-crash']
    title = 'Premature Py_DECREF while generating a TypeError in call_tzinfo_method'
    updated_at = <Date 2014-07-25.22:02:41.303>
    user = 'https://bugs.python.org/Knio'

    bugs.python.org fields:

    activity = <Date 2014-07-25.22:02:41.303>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2014-07-25.22:02:41.304>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2014-07-23.04:53:02.047>
    creator = 'Knio'
    dependencies = []
    files = ['36042', '36043']
    hgrepos = []
    issue_num = 22044
    keywords = ['patch']
    message_count = 4.0
    messages = ['223722', '223723', '224006', '224007']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'belopolsky', 'python-dev', 'Knio']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue22044'
    versions = ['Python 3.4', 'Python 3.5']

    @Knio
    Copy link
    Mannequin Author

    Knio mannequin commented Jul 23, 2014

    call_tzinfo_method in Modules/_datetimemodule.c:900 calls Py_DECREF(offset)
    before trying to use offset to generate a TypeError message.

    This causes a crash if that was the last reference to offset and Py_DECREF clears it.

    @Knio Knio mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 23, 2014
    @Knio
    Copy link
    Mannequin Author

    Knio mannequin commented Jul 23, 2014

    Included python test case which causes a segmentation fault on

    Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:45:13) [MSC v.1600 64 bit (AMD64)] on win32

    Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux

    Python 3.5.0a0 (default:89665cc05592+, Jul 22 2014, 21:35:55) [GCC 4.8.2] on linux

    @rhettinger rhettinger self-assigned this Jul 25, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 25, 2014

    New changeset 01c6d2893092 by Raymond Hettinger in branch '3.4':
    Issue bpo-22044: Fixed premature DECREF in call_tzinfo_method.
    http://hg.python.org/cpython/rev/01c6d2893092

    @rhettinger
    Copy link
    Contributor

    Thanks for the patch.

    @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
    stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant