Problem with history - cant fgets after article

Russ Allbery rra at stanford.edu
Mon Jan 26 22:32:20 UTC 2004


Russ Allbery <rra at stanford.edu> writes:
> Steve Youngs <sryoungs at bigpond.net.au> writes:

>> The Bad News:  Now I get...

>> $ rnews -U
>> rnews: unexpected EOF from server after article
>> rnews: cant unspool saving to /usr/local/news/spool/incoming/bad/bigpond2e5Q2E
>> Broken pipe

> Could you run innd under valgrind again while posting that same article
> with rnews -U?

> Also, if the article isn't private, could I see a copy of it?

Oh, and our snapshot system is sometimes flaky about picking up patches.
Could you make sure that you have the following patch in your current
source?

--- innd/python.c	2003/10/20 21:51:38	1.24
+++ innd/python.c	2004/01/25 22:21:59	1.25
@@ -1,4 +1,4 @@
-/*  $Id: python.c,v 1.24 2003/10/20 21:51:38 rra Exp $
+/*  $Id: python.c,v 1.25 2004/01/25 22:21:59 rra Exp $
 **
 **  python.c: Embed Python in the style of innd's TCL and Perl stuff.
 ** 
@@ -623,6 +623,7 @@ void
 PYsetup(void)
 {
     const ARTHEADER *hp;
+    size_t hdrcount;
 
     setenv("PYTHONPATH", innconf->pathfilter, 1);
     Py_Initialize();
@@ -653,10 +654,13 @@ PYsetup(void)
 	syslog(L_NOTICE, "defined python methods");
     }
 
-    /* Grab space for these so we aren't forever recreating them. */
+    /* Grab space for these so we aren't forever recreating them.  We also
+       put the body and the line count into PYheaditem, so it needs to be
+       two elements longer than the total number of headers. */
     PYheaders = PyDict_New();
-    PYheaditem = xmalloc((ARRAY_END(ARTheaders) - ARTheaders) * sizeof(PyObject *));
-    PYheadkey = xmalloc((ARRAY_END(ARTheaders) - ARTheaders) * sizeof(PyObject *));
+    hdrcount = ARRAY_END(ARTheaders) - ARTheaders;
+    PYheaditem = xmalloc((hdrcount + 2) * sizeof(PyObject *));
+    PYheadkey = xmalloc(hdrcount * sizeof(PyObject *));
 
     /* Preallocate keys for the article dictionary */
     for (hp = ARTheaders; hp < ARRAY_END(ARTheaders); hp++)


-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list