classification
Title: Premature Py_DECREF while generating a TypeError in call_tzinfo_method
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.5, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Knio, belopolsky, python-dev, rhettinger
Priority: normal Keywords: patch

Created on 2014-07-23 04:53 by Knio, last changed 2014-07-25 22:02 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
python_bug.diff Knio, 2014-07-23 04:53 patch
python_crash.py Knio, 2014-07-23 04:56 test case
Messages (4)
msg223722 - (view) Author: Tom Flanagan (Knio) * Date: 2014-07-23 04:53
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.
msg223723 - (view) Author: Tom Flanagan (Knio) * Date: 2014-07-23 04:56
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
msg224006 - (view) Author: Roundup Robot (python-dev) Date: 2014-07-25 22:00
New changeset 01c6d2893092 by Raymond Hettinger in branch '3.4':
Issue #22044: Fixed premature DECREF in call_tzinfo_method.
http://hg.python.org/cpython/rev/01c6d2893092
msg224007 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-07-25 22:02
Thanks for the patch.
History
Date User Action Args
2014-07-25 22:02:41rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg224007
2014-07-25 22:00:37python-devsetnosy: + python-dev
messages: + msg224006
2014-07-25 21:15:01rhettingersetassignee: rhettinger

nosy: + rhettinger
versions: - Python 3.3
2014-07-23 04:56:18Kniosetfiles: + python_crash.py

messages: + msg223723
2014-07-23 04:53:02Kniocreate