Graham Dumpleton wrote:

On 29/01/2006, at 1:29 AM, Jim Gallacher wrote:

Volodya wrote:

On Fri, Jan 27, 2006 at 10:28:24AM -0500, Gregory (Grisha) Trubetskoy wrote:


OK, and I see Ron sent a Solaris 10 +1, which is good. I think we need a FreeBSD +1 - perhaps not necessarily 6.0, but something...

FreeBSD 4.9
In my case PythonConnectionHandler test fails.
Tested on:
  Apache/2.0.55 (prefork) mod_python/3.2.6 Python/2.4.2
  Apache/2.0.50 (prefork) mod_python/3.2.6 Python/2.3.4


I think this is the same as Barry Pederson's failure.


Which are both similar to:

  http://issues.apache.org/jira/browse/MODPYTHON-102

Although in the Mac OS X case, only happened when on secondary port and not
main listener port.

I have never seen anyone use connection handlers so speculated that there was
probably no urgency in doing anything about it.

Graham


I don't know if this is the answer to the problem, but it looks like a bug anyway. In connobject.c starting at line 133:

        /* time to grow destination string? */
        if (len == 0 && bytes_read == bufsize) {

            _PyString_Resize(&result, bufsize + HUGE_STRING_LEN);
            buffer = PyString_AS_STRING((PyStringObject *) result);
            buffer += HUGE_STRING_LEN;
            bufsize += HUGE_STRING_LEN;
        }


It looks like we've just set the buffer pointer to an address somewhere inside the buffer. That can't be good. The buffer pointer should be set to the bytes_read position. Perhaps one of you FreeBSD heads could try the attached patch.

Jim





Index: src/connobject.c
===================================================================
--- src/connobject.c    (revision 369511)
+++ src/connobject.c    (working copy)
@@ -135,7 +135,7 @@
 
             _PyString_Resize(&result, bufsize + HUGE_STRING_LEN);
             buffer = PyString_AS_STRING((PyStringObject *) result);
-            buffer += HUGE_STRING_LEN;
+            buffer += bytes_read;
             bufsize += HUGE_STRING_LEN;
         }
 

Reply via email to