From ce5ecce91871df729425f8cf235786b9f715f54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?= Date: Thu, 1 Jul 2021 12:34:19 +0200 Subject: [PATCH] Resolves: #1976169 - mod_wsgi segfaults when python program outputs a warning message --- mod_wsgi-4.7.1-warning-segfaults.patch | 46 ++++++++++++++++++++++++++ mod_wsgi.spec | 7 +++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 mod_wsgi-4.7.1-warning-segfaults.patch diff --git a/mod_wsgi-4.7.1-warning-segfaults.patch b/mod_wsgi-4.7.1-warning-segfaults.patch new file mode 100644 index 0000000..905b04f --- /dev/null +++ b/mod_wsgi-4.7.1-warning-segfaults.patch @@ -0,0 +1,46 @@ +From 2c9d1b3e725ad2a072e9fef4cb1cb0bb9ae2d540 Mon Sep 17 00:00:00 2001 +From: Graham Dumpleton +Date: Sat, 13 Feb 2021 11:05:39 +1100 +Subject: [PATCH] Fix deprecation warning in PyArg_ParseTuple(). + +--- + docs/release-notes/version-4.8.0.rst | 5 +++++ + src/server/wsgi_logger.c | 4 ++-- + src/server/wsgi_python.h | 2 ++ + 3 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/server/wsgi_logger.c b/src/server/wsgi_logger.c +index 71c7d69e..df35887e 100644 +--- a/src/server/wsgi_logger.c ++++ b/src/server/wsgi_logger.c +@@ -223,7 +223,7 @@ static PyObject *Log_isatty(LogObject *self, PyObject *args) + return Py_False; + } + +-static void Log_queue(LogObject *self, const char *msg, int len) ++static void Log_queue(LogObject *self, const char *msg, Py_ssize_t len) + { + const char *p = NULL; + const char *q = NULL; +@@ -330,7 +330,7 @@ static void Log_queue(LogObject *self, const char *msg, int len) + static PyObject *Log_write(LogObject *self, PyObject *args) + { + const char *msg = NULL; +- int len = -1; ++ Py_ssize_t len = -1; + + WSGIThreadInfo *thread_info = NULL; + +diff --git a/src/server/wsgi_python.h b/src/server/wsgi_python.h +index 0464fe6d..5c10cae5 100644 +--- a/src/server/wsgi_python.h ++++ b/src/server/wsgi_python.h +@@ -21,6 +21,8 @@ + + /* ------------------------------------------------------------------------- */ + ++#define PY_SSIZE_T_CLEAN 1 ++ + #include + + #if !defined(PY_VERSION_HEX) diff --git a/mod_wsgi.spec b/mod_wsgi.spec index a462e06..6ee8734 100644 --- a/mod_wsgi.spec +++ b/mod_wsgi.spec @@ -21,7 +21,7 @@ Name: mod_wsgi Version: 4.7.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A WSGI interface for Python web applications in Apache License: ASL 2.0 URL: https://modwsgi.readthedocs.io/ @@ -30,6 +30,7 @@ Source1: wsgi.conf Source2: wsgi-python3.conf Patch1: mod_wsgi-4.5.20-exports.patch Patch2: mod_wsgi-4.7.1-remove-rpath.patch +Patch3: mod_wsgi-4.7.1-warning-segfaults.patch BuildRequires: make BuildRequires: httpd-devel @@ -164,6 +165,10 @@ ln -s %{_bindir}/mod_wsgi-express-2 $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express %endif %changelog +* Thu Jul 01 2021 Luboš Uhliarik - 4.7.1-7 +- Resolves: #1976169 - mod_wsgi segfaults when python program outputs a warning + message + * Tue Jun 08 2021 Luboš Uhliarik - 4.7.1-6 - Resolves: #1969555 - remove rpath