[MacPorts] #8296: mod_python package w/ latest apr is broken for Trac (patch included)
MacPorts
noreply at macports.org
Thu Mar 24 08:38:50 PDT 2016
#8296: mod_python package w/ latest apr is broken for Trac (patch included)
-------------------------+--------------------------------
Reporter: aturner@… | Owner: macports-tickets@…
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 1.2
Resolution: fixed | Keywords:
Port: mod_python |
-------------------------+--------------------------------
Changes (by ryandesign@…):
* port: => mod_python
Old description:
> [Note, I emailed Markus Weissmann <mww at opendarwin.org> the maintainer of
> the mod_python package, but apparently he just moved and doesn't have
> internet access and so he asked me to open a ticket]
>
> There's a real nasty bug in mod_python 3.2.8 when built against the
> latest versions of APR (1.2.x) which manifests itself thusly:
>
> dyld: lazy symbol binding failed: Symbol not found:
> _apr_sockaddr_port_get
> Referenced from: /opt/local/apache2/modules/mod_python.so
> Expected in: flat namespace
>
> dyld: Symbol not found: _apr_sockaddr_port_get
> Referenced from: /opt/local/apache2/modules/mod_python.so
> Expected in: flat namespace
>
> [Tue Mar 28 15:26:19 2006] [notice] child pid 7304 exit signal Trace/
> BPT trap (5)
>
> The attached patch against mod_python resolves this issue. It would be
> great if the darwinports package included the patch.
>
> -- BEGIN PATCH --
>
> diff --speed-large-files --minimal -Nru
> mod_python-3.2.8.orig/src/connobject.c mod_python-3.2.8/src/connobject.c
> --- mod_python-3.2.8.orig/src/connobject.c 2006-03-08
> 01:57:06.753128000 -0500
> +++ mod_python-3.2.8/src/connobject.c 2006-03-08 01:56:01.738907000
> -0500
> @@ -79,7 +79,7 @@
> rc = ap_get_brigade(c->input_filters, bb, mode, APR_BLOCK_READ,
> bufsize);
> Py_END_ALLOW_THREADS;
>
> - if (! APR_STATUS_IS_SUCCESS(rc)) {
> + if (! rc) {
> PyErr_SetObject(PyExc_IOError,
> PyString_FromString("Connection read
> error"));
> return NULL;
> @@ -320,13 +320,7 @@
> PyObject *addrobj = makeipaddr(addr);
> PyObject *ret = NULL;
> if (addrobj) {
> - apr_port_t port;
> - if(apr_sockaddr_port_get(&port, addr)==APR_SUCCESS) {
> - ret = Py_BuildValue("Oi", addrobj, port );
> - }
> - else {
> - PyErr_SetString(PyExc_SystemError,"apr_sockaddr_port_get
> failure");
> - }
> + ret = Py_BuildValue("Oi", addrobj,
> ntohs(addr->sa.sin.sin_port));
> Py_DECREF(addrobj);
> }
> return ret;
> diff --speed-large-files --minimal -Nru
> mod_python-3.2.8.orig/src/filterobject.c
> mod_python-3.2.8/src/filterobject.c
> --- mod_python-3.2.8.orig/src/filterobject.c 2006-03-08
> 01:57:06.690443000 -0500
> +++ mod_python-3.2.8/src/filterobject.c 2006-03-08 01:53:48.343873000
> -0500
> @@ -178,7 +178,7 @@
> APR_BLOCK_READ, self->readbytes);
> Py_END_ALLOW_THREADS;
>
> - if (!APR_STATUS_IS_EAGAIN(self->rc) &&
> !APR_STATUS_IS_SUCCESS(self->rc)) {
> + if (!APR_STATUS_IS_EAGAIN(self->rc) && !self->rc) {
> PyErr_SetObject(PyExc_IOError,
> PyString_FromString("Input filter read
> error"));
> return NULL;
> diff --speed-large-files --minimal -Nru
> mod_python-3.2.8.orig/test/test.py mod_python-3.2.8/test/test.py
> --- mod_python-3.2.8.orig/test/test.py 2006-03-08 01:57:06.125553000
> -0500
> +++ mod_python-3.2.8/test/test.py 2006-03-08 01:56:55.209055000
> -0500
> @@ -290,9 +290,9 @@
> PythonOption('PythonOptionTest sample_value'),
> DocumentRoot(DOCUMENT_ROOT),
> LoadModule("python_module %s" %
> quoteIfSpace(MOD_PYTHON_SO)),
> - IfModule("!mod_auth.c",
> - LoadModule("auth_module %s" %
> - quoteIfSpace(os.path.join(modpath,
> "mod_auth.so")))))
> + IfModule("!mod_auth_basic.c",
> + LoadModule("auth_basic_module %s" %
> + quoteIfSpace(os.path.join(modpath,
> "mod_auth_basic.so")))))
>
> f = open(CONFIG, "w")
> f.write(str(s))
New description:
[Note, I emailed Markus Weissmann <mww at opendarwin.org> the maintainer of
the mod_python package, but apparently he just moved and doesn't have
internet access and so he asked me to open a ticket]
There's a real nasty bug in mod_python 3.2.8 when built against the latest
versions of APR (1.2.x) which manifests itself thusly:
{{{
dyld: lazy symbol binding failed: Symbol not found: _apr_sockaddr_port_get
Referenced from: /opt/local/apache2/modules/mod_python.so
Expected in: flat namespace
dyld: Symbol not found: _apr_sockaddr_port_get
Referenced from: /opt/local/apache2/modules/mod_python.so
Expected in: flat namespace
[Tue Mar 28 15:26:19 2006] [notice] child pid 7304 exit signal Trace/
BPT trap (5)
}}}
The attached patch against mod_python resolves this issue. It would be
great if the darwinports package included the patch.
-- BEGIN PATCH --
{{{
diff --speed-large-files --minimal -Nru
mod_python-3.2.8.orig/src/connobject.c mod_python-3.2.8/src/connobject.c
--- mod_python-3.2.8.orig/src/connobject.c 2006-03-08
01:57:06.753128000 -0500
+++ mod_python-3.2.8/src/connobject.c 2006-03-08 01:56:01.738907000
-0500
@@ -79,7 +79,7 @@
rc = ap_get_brigade(c->input_filters, bb, mode, APR_BLOCK_READ,
bufsize);
Py_END_ALLOW_THREADS;
- if (! APR_STATUS_IS_SUCCESS(rc)) {
+ if (! rc) {
PyErr_SetObject(PyExc_IOError,
PyString_FromString("Connection read
error"));
return NULL;
@@ -320,13 +320,7 @@
PyObject *addrobj = makeipaddr(addr);
PyObject *ret = NULL;
if (addrobj) {
- apr_port_t port;
- if(apr_sockaddr_port_get(&port, addr)==APR_SUCCESS) {
- ret = Py_BuildValue("Oi", addrobj, port );
- }
- else {
- PyErr_SetString(PyExc_SystemError,"apr_sockaddr_port_get
failure");
- }
+ ret = Py_BuildValue("Oi", addrobj, ntohs(addr->sa.sin.sin_port));
Py_DECREF(addrobj);
}
return ret;
diff --speed-large-files --minimal -Nru
mod_python-3.2.8.orig/src/filterobject.c
mod_python-3.2.8/src/filterobject.c
--- mod_python-3.2.8.orig/src/filterobject.c 2006-03-08
01:57:06.690443000 -0500
+++ mod_python-3.2.8/src/filterobject.c 2006-03-08 01:53:48.343873000
-0500
@@ -178,7 +178,7 @@
APR_BLOCK_READ, self->readbytes);
Py_END_ALLOW_THREADS;
- if (!APR_STATUS_IS_EAGAIN(self->rc) &&
!APR_STATUS_IS_SUCCESS(self->rc)) {
+ if (!APR_STATUS_IS_EAGAIN(self->rc) && !self->rc) {
PyErr_SetObject(PyExc_IOError,
PyString_FromString("Input filter read
error"));
return NULL;
diff --speed-large-files --minimal -Nru mod_python-3.2.8.orig/test/test.py
mod_python-3.2.8/test/test.py
--- mod_python-3.2.8.orig/test/test.py 2006-03-08 01:57:06.125553000
-0500
+++ mod_python-3.2.8/test/test.py 2006-03-08 01:56:55.209055000
-0500
@@ -290,9 +290,9 @@
PythonOption('PythonOptionTest sample_value'),
DocumentRoot(DOCUMENT_ROOT),
LoadModule("python_module %s" % quoteIfSpace(MOD_PYTHON_SO)),
- IfModule("!mod_auth.c",
- LoadModule("auth_module %s" %
- quoteIfSpace(os.path.join(modpath,
"mod_auth.so")))))
+ IfModule("!mod_auth_basic.c",
+ LoadModule("auth_basic_module %s" %
+ quoteIfSpace(os.path.join(modpath,
"mod_auth_basic.so")))))
f = open(CONFIG, "w")
f.write(str(s))
}}}
--
--
Ticket URL: <https://trac.macports.org/ticket/8296#comment:3>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list