Bug 1384957

Summary: Python bug #26617: Assertion failed in gc with __del__ and weakref
Product: [Fedora] Fedora EPEL Reporter: Victor Stinner <vstinner>
Component: python34Assignee: Charalampos Stratakis <cstratak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: cstratak, kevin, orion, pviktori, python-sig, TicoTimo, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python34-3.4.5-1.el6 python34-3.4.5-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 18:46:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Script to reproduce the crash none

Description Victor Stinner 2016-10-14 12:29:58 UTC
Created attachment 1210512 [details]
Script to reproduce the crash

Attached script crashs randomly on Python 3.4. It's a bug in Python which was fixed in Python 3.5 and newer: http://bugs.python.org/issue26617

The following commit should be backported to Python 3.4:
https://hg.python.org/cpython/rev/c9b7272e2553

Note: Python 3.4 is no more maintained upstream.

Comment 1 Charalampos Stratakis 2016-10-14 12:41:56 UTC
In order to reproduce the crash the debug build rpm needs to be installed: python34-debug

I reproduced it in mock:
python3-debug crash.py

python3-debug: /builddir/build/BUILD/Python-3.4.3/Modules/gcmodule.c:364: update_refs: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed.
Aborted (core dumped)

Comment 2 Orion Poplawski 2016-10-14 14:32:19 UTC
FYI - I've got this ready to go if it helps at all.  Seems worth it to update to 3.4.5 while we're at it.

commit 3039791749fd48c4024e61fc9d27a87a74b5a8ca
Author: Orion Poplawski <orion.com>
Date:   Tue Oct 4 11:56:40 2016 -0600

    3.4.5

diff --git a/python34.spec b/python34.spec
index 5602813..5880160 100644
--- a/python34.spec
+++ b/python34.spec
@@ -152,8 +152,8 @@
 # ==================
 Summary: Version 3 of the Python programming language aka Python 3000
 Name: python%{pyshortver}
-Version: %{pybasever}.3
-Release: 8%{?dist}
+Version: %{pybasever}.5
+Release: 1%{?dist}
 License: Python
 Group: Development/Languages
 
@@ -740,42 +740,9 @@ Patch200: 00200-gettext-plural-fix.patch
 # Note: Backported from scl
 Patch201: 00201-fix-memory-leak-in-gdbm.patch 
 
-# 00202 #
-# Fixes undefined behaviour in faulthandler which caused tests to hang in on x86_64
-# http://bugs.python.org/issue23433
-Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch
-
 # test_threading fails in koji dues to it's handling of signals
 Patch203: 00203-disable-threading-test-koji.patch
 
-# openssl requires DH keys to be > 768bits
-Patch204: 00204-increase-dh-keys-size.patch
-
-# 00237 #
-# CVE-2016-0772 python: smtplib StartTLS stripping attack
-#   https://bugzilla.redhat.com/show_bug.cgi?id=1303647
-#   FIXED UPSTREAM: https://hg.python.org/cpython/rev/d590114c2394
-# Raise an error when STARTTLS fails
-# Resolves: rhbz#1348973
-Patch237: 00237-CVE-2016-0772-smtplib.patch
-
-# 00238 #
-# CVE-2016-5699 python: http protocol steam injection attack
-#   https://bugzilla.redhat.com/show_bug.cgi?id=1303699
-#   FIXED UPSTREAM: https://hg.python.org/cpython/rev/bf3e1c9b80e9
-# Disabled HTTP header injections in http.client
-# Resolves: rhbz#1348982
-Patch238: 00238-CVE-2016-5699-http-client.patch
-
-# 00241 #
-# CVE-2016-5636: http://seclists.org/oss-sec/2016/q2/560
-# rhbz#1356365: https://bugzilla.redhat.com/show_bug.cgi?id=1356365
-# https://hg.python.org/cpython/rev/985fc64c60d6/
-# https://hg.python.org/cpython/rev/2edbdb79cd6d
-# Fix possible integer overflow and heap corruption in zipimporter.get_data()
-# FIXED UPSTREAM: https://bugs.python.org/issue26171
-Patch241: 00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
-
 # 00242 #
 # HTTPoxy attack (CVE-2016-1000110)
 # https://httpoxy.org/
@@ -1065,12 +1032,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
 %patch196 -p1
 # 00197: upstream as of Python 3.4.2
 # 00199: doesn't apply to RHEL 7
-%patch202 -p1
 %patch203 -p1
-%patch204 -p1
-%patch237 -p1
-%patch238 -p1
-%patch241 -p1
 %patch242 -p1

Comment 3 Charalampos Stratakis 2016-10-14 14:42:56 UTC
(In reply to Orion Poplawski from comment #2)
> FYI - I've got this ready to go if it helps at all.  Seems worth it to
> update to 3.4.5 while we're at it.
> 

Already pushed and building [0]. Could you maybe rebase your patch to the current tip?

[0]: http://koji.fedoraproject.org/koji/taskinfo?taskID=16088369

Comment 4 Orion Poplawski 2016-10-14 15:09:14 UTC
Updated and building - http://koji.fedoraproject.org/koji/taskinfo?taskID=16088713

Comment 5 Orion Poplawski 2016-10-14 15:16:49 UTC
also, I assume the same issue applies to the EPEL6 build?

Comment 6 Tim Orling 2016-10-14 21:20:08 UTC
EPEL6 pushed and building now. I will then try to get the 3.4.5 commits in.

Comment 7 Tim Orling 2016-10-14 23:27:19 UTC
3.4.5-1 for EPEL6 building.

Comment 8 Fedora Update System 2016-10-16 00:20:33 UTC
python34-3.4.5-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-c32672ef1b

Comment 9 Fedora Update System 2016-10-21 16:49:48 UTC
python34-3.4.5-2.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-91bccac54f

Comment 10 Fedora Update System 2016-11-04 18:46:44 UTC
python34-3.4.5-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2016-11-06 03:19:35 UTC
python34-3.4.5-2.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.