Browse code

Fixing closed socket refrence crash issue, bug # 1956257

Change-Id: I6f907d6acee00b71b283dd8c602fd8d3ca357485
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3771
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Kumar Kaushik <kaushikk@vmware.com>

Kumar Kaushik authored on 2017/09/15 06:00:25
Showing 2 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        A high-level scripting language
2 2
 Name:           python3
3 3
 Version:        3.5.3
4
-Release:        5%{?dist}
4
+Release:        6%{?dist}
5 5
 License:        PSF
6 6
 URL:            http://www.python.org/
7 7
 Group:          System Environment/Programming
... ...
@@ -10,6 +10,7 @@ Distribution:   Photon
10 10
 Source0:        https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
11 11
 %define         sha1 Python=127121fdca11e735b3686e300d66f73aba663e93
12 12
 Patch0:         cgi3.patch
13
+Patch1:         sockWarning.patch
13 14
 BuildRequires:  pkg-config >= 0.28
14 15
 BuildRequires:  bzip2-devel
15 16
 BuildRequires:  ncurses-devel >= 6.0-3
... ...
@@ -87,6 +88,7 @@ to build python programs.
87 87
 %prep
88 88
 %setup -q -n Python-%{version}
89 89
 %patch0 -p1
90
+%patch1 -p1
90 91
 
91 92
 %build
92 93
 export OPT="${CFLAGS}"
... ...
@@ -191,6 +193,8 @@ rm -rf %{buildroot}/*
191 191
 %{_bindir}/idle*
192 192
 
193 193
 %changelog
194
+*   Thu Sep 14 2017 Kumar Kaushik <kaushikk@vmware.com> 3.5.3-6
195
+-   Adding patch for socket cleanup issue, Bug # 1956257. 
194 196
 *   Fri Jul 28 2017 Divya Thaluru <dthaluru@vmware.com> 3.5.3-5
195 197
 -   Fixed dependencies for easy_install-3.5
196 198
 *   Thu Jun 29 2017 Divya Thaluru <dthaluru@vmware.com> 3.5.3-4
197 199
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
1
+index 47abe8d..50cfe29 100644
2
+--- a/Modules/socketmodule.c
3
+@@ -4175,7 +4175,7 @@ sock_dealloc(PySocketSockObject *s)
4
+         ++Py_REFCNT(s);
5
+         PyErr_Fetch(&exc, &val, &tb);
6
+         if (PyErr_WarnFormat(PyExc_ResourceWarning, 1,
7
+-                             "unclosed %R", s))
8
++                             "unclosed socket"))
9
+             /* Spurious errors can appear at shutdown */
10
+             if (PyErr_ExceptionMatches(PyExc_Warning))
11
+                 PyErr_WriteUnraisable((PyObject *) s);
12
+