Bug 1976169
| Summary: | mod_wsgi segfaults when python program outputs a warning message | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Alfredo Moralejo <amoralej> |
| Component: | mod_wsgi | Assignee: | Luboš Uhliarik <luhliari> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Branislav Náter <bnater> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | CentOS Stream | CC: | apevec, bnater, bstinson, jpena, jwboyer, luhliari |
| Target Milestone: | beta | Keywords: | AutoVerified, Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | mod_wsgi-4.7.1-7.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-12-07 22:04:56 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: | |||
|
Description
Alfredo Moralejo
2021-06-25 11:52:06 UTC
I've just tested that applying following patch on top of mod_wsgi-4.7.1-6.el9 (last build in cs9 koji), it works fine:
# cat ../SOURCES/mod_wsgi_fix_deprecation.patch
--- a/src/server/wsgi_logger.c 2021-06-25 11:59:23.936000000 +0000
+++ b/src/server/wsgi_logger.c 2021-06-25 12:00:10.257000000 +0000
@@ -223,7 +223,7 @@
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 PyObject *Log_write(LogObject *self, PyObject *args)
{
const char *msg = NULL;
- int len = -1;
+ Py_ssize_t len = -1;
WSGIThreadInfo *thread_info = NULL;
--- a/src/server/wsgi_python.h 2021-06-25 12:00:38.400000000 +0000
+++ b/src/server/wsgi_python.h 2021-06-25 12:01:15.686000000 +0000
@@ -21,6 +21,8 @@
/* ------------------------------------------------------------------------- */
+#define PY_SSIZE_T_CLEAN 1
+
#include <Python.h>
#if !defined(PY_VERSION_HEX)
Just FTR, the patch mentioned by Alfredo is https://github.com/GrahamDumpleton/mod_wsgi/commit/2c9d1b3e725ad2a072e9fef4cb1cb0bb9ae2d540 mod_wsgi-4.7.1-7.el9 is not in last compose, it seems blocked by some gate? Can be moved to ON_QA, not sure what is the workflow for CS9 bugs, build is in CS9 compose: https://composes.stream.centos.org/production/latest-CentOS-Stream/compose/AppStream/x86_64/os/Packages/python3-mod_wsgi-4.7.1-7.el9.x86_64.rpm It works in Puppet OpenStack integration test scenarios. |