Opened 18 years ago

Closed 18 years ago

Last modified 8 years ago

#8296 closed defect (fixed)

mod_python package w/ latest apr is broken for Trac (patch included)

Reported by: aturner@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.2
Keywords: Cc: mww@…
Port: mod_python

Description (last modified by ryandesign (Ryan Carsten Schmidt))

[Note, I emailed Markus Weissmann <mww@…> 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))

Change History (3)

comment:1 Changed 18 years ago by danchr@…

Cc: mww@… added
Status: newassigned

Taking + Cc-ing maintainer.

comment:2 Changed 18 years ago by danchr@…

Resolution: fixed
Status: assignedclosed

I already fixed this in <http://www.opendarwin.org/pipermail/cvs-darwinports-all/2006-April/069141.html>. Seems to be largely the same – if not exactly the same – as the patch posted by the reporter.

comment:3 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: mod_python added
Note: See TracTickets for help on using tickets.