Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue37915

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Segfault in comparison between datetime.timezone.utc and pytz.utc
Type:crashStage:resolved
Components:Versions:Python 3.9, Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: belopolsky, lukasz.langa, miss-islington, ned.deily, p-ganssle, pablogsal, serhiy.storchaka, tomaugspurger, xtreak
Priority:release blockerKeywords:3.8regression

Created on2019-08-22 11:18 bytomaugspurger, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 15390mergedpablogsal,2019-08-22 15:12
PR 15399mergedmiss-islington,2019-08-22 19:24
PR 15417mergedpablogsal,2019-08-23 09:54
Messages (10)
msg350184 -(view)Author: Tom Augspurger (tomaugspurger)*Date: 2019-08-22 11:18
The following crashes with Python 3.8b3```import sysimport pytzimport datetimeprint(sys.version_info)print(pytz.__version__)print(datetime.timezone.utc == pytz.utc)```When run with `-X faulthandler`, I see```sys.version_info(major=3, minor=8, micro=0, releaselevel='beta', serial=3)2019.2Fatal Python error: Segmentation faultCurrent thread 0x00000001138dc5c0 (most recent call first):  File "foo.py", line 8 in <module>Segmentation fault: 11```
msg350186 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2019-08-22 11:45
I am adding 3.8 regression since the code works with 3.7 though it involves pytz.
msg350189 -(view)Author: Karthikeyan Singaravelan (xtreak)*(Python committer)Date: 2019-08-22 12:34
Seems this is due toissue37685 (dde944f9df) on bisecting datetime related changes. Adding Serhiy. I guess this could be marked as release blocker.Here is a simplified reproducer on extracting pytz.utc source [0] which is an object of simple subclass of datetime.tzinfo : import sysimport datetimeprint(sys.version)class UTC(datetime.tzinfo):    passprint(datetime.timezone.utc == UTC())datetime.timezone.utc == datetime.tzinfo() # This also segfaults without a subclass and should be False# Segfaults➜  cpython git:(dde944f9df) git checkoutdde944f9df && make -s -j4 > /dev/nullHEAD is now atdde944f9dfbpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)➜  cpython git:(dde944f9df) ./python.exe ../backups/bpo37915.py3.8.0b3+ (tags/v3.8.0b3-30-gdde944f9df:dde944f9df, Aug 22 2019, 17:55:14)[Clang 7.0.2 (clang-700.1.81)][1]    33988 segmentation fault  ./python.exe ../backups/bpo37915.py# Commit before works fine➜  cpython git:(dde944f9df) git checkoutdde944f9df~1 && make -s -j4 > /dev/nullPrevious HEAD position wasdde944f9dfbpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)HEAD is now at4e402d37eb Correct description of HTTP status code 308. (GH-15098)➜  cpython git:(4e402d37eb) ./python.exe ../backups/bpo37915.py3.8.0b3+ (tags/v3.8.0b3-30-gdde944f9df:dde944f9df, Aug 22 2019, 17:55:14)[Clang 7.0.2 (clang-700.1.81)]False[0]https://github.com/stub42/pytz/blob/62f872054dde69e5c510094093cd6e221d96d5db/src/pytz/__init__.py#L256
msg350194 -(view)Author: Tom Augspurger (tomaugspurger)*Date: 2019-08-22 15:19
Thanks for debugging this Karthikeyan and for the quick fix Pablo!
msg350195 -(view)Author: Pablo Galindo Salgado (pablogsal)*(Python committer)Date: 2019-08-22 15:20
This is due to an incorrect type check in the timezone_richcompare, it should be a comparison against PyDateTime_TimeZoneType not against PyDateTime_TZInfoType. The segfault is due to an invalid casting to PyDateTime_TimeZoneType (the child) from the parent (PyDateTime_TZInfoType).
msg350196 -(view)Author: Pablo Galindo Salgado (pablogsal)*(Python committer)Date: 2019-08-22 15:21
Thanks, Tom and Karthikeyan for the finding and the debugging :)
msg350227 -(view)Author: miss-islington (miss-islington)Date: 2019-08-22 19:24
New changeset4be11c009abe88175fa164b45e4838e7267dfa97 by Miss Islington (bot) (Pablo Galindo) in branch 'master':bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)https://github.com/python/cpython/commit/4be11c009abe88175fa164b45e4838e7267dfa97
msg350267 -(view)Author: miss-islington (miss-islington)Date: 2019-08-23 08:48
New changeset5c77730300c0358d7bebd2bb39ea5d10222a3d9a by Miss Islington (bot) in branch '3.8':bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)https://github.com/python/cpython/commit/5c77730300c0358d7bebd2bb39ea5d10222a3d9a
msg350270 -(view)Author: Pablo Galindo Salgado (pablogsal)*(Python committer)Date: 2019-08-23 10:12
New changeset1b1796df3a4292067a174faa11b1a852f79e98e3 by Pablo Galindo in branch '3.7':[3.7]bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390) (GH-15417)https://github.com/python/cpython/commit/1b1796df3a4292067a174faa11b1a852f79e98e3
msg350277 -(view)Author: Ned Deily (ned.deily)*(Python committer)Date: 2019-08-23 11:53
(Removing “3.7regression” as the problematic change for 3.7 had not yet been released.)
History
DateUserActionArgs
2022-04-11 14:59:19adminsetgithub: 82096
2019-08-23 11:53:21ned.deilysetkeywords: -3.7regression

messages: +msg350277
2019-08-23 10:12:53pablogsalsetstatus: open -> closed

nosy: +ned.deily
versions: + Python 3.7, Python 3.9
keywords: +3.7regression, -patch
resolution: fixed
stage: patch review -> resolved
2019-08-23 10:12:34pablogsalsetmessages: +msg350270
2019-08-23 09:54:56pablogsalsetpull_requests: +pull_request15118
2019-08-23 08:48:45miss-islingtonsetmessages: +msg350267
2019-08-22 19:24:36miss-islingtonsetpull_requests: +pull_request15107
2019-08-22 19:24:31miss-islingtonsetnosy: +miss-islington
messages: +msg350227
2019-08-22 18:43:05pablogsalsetpriority: normal -> release blocker
nosy: +lukasz.langa
2019-08-22 15:21:06pablogsalsetmessages: +msg350196
2019-08-22 15:20:25pablogsalsetnosy: +pablogsal
messages: +msg350195
2019-08-22 15:19:22tomaugspurgersetmessages: +msg350194
2019-08-22 15:12:46pablogsalsetkeywords: +patch
stage: patch review
pull_requests: +pull_request15100
2019-08-22 12:34:33xtreaksetnosy: +serhiy.storchaka
messages: +msg350189
2019-08-22 11:46:19xtreaksettitle: Segfault in comparison between datetime.timezone.utc and putz.utc -> Segfault in comparison between datetime.timezone.utc and pytz.utc
2019-08-22 11:45:51xtreaksetkeywords: +3.8regression
nosy: +p-ganssle,xtreak,belopolsky
messages: +msg350186

2019-08-22 11:18:39tomaugspurgercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp