innfeed segfaults on NULL buffer in getBanner() - mine too..

Julien ÉLIE julien at trigofacile.com
Mon Aug 6 20:52:12 UTC 2007


En réponse à Russ Allbery :
> Does this happen on all platforms or only on FreeBSD?

The two persons who have reported that up to now use FreeBSD.


> prepareRead is responsible for setting up the buffers for the endpoint.
> It sets the buffers to the passed value of buffers.  Since inBuffer isn't
> NULL, this must have happened at some point.

What disconcerts me is:

(gdb) break prepareRead
Breakpoint 2 at 0x408e60: file endpoint.c, line 372.
(gdb) run
Starting program: /usr/local/news/snapshot/bin/innfeed
Breakpoint 2, prepareRead (endp=0x0, buffers=0x553300, func=0x553300, clientData=0x0, minlen=0) at endpoint.c:372
372     {
(gdb) print *endp
Error accessing memory address 0x0: Bad address.
(gdb) step
373       int bufferSizeTotal = 0 ;
(gdb)
372     {
(gdb)
376       ASSERT (endp != NULL) ;
(gdb)
372     {
(gdb)
376       ASSERT (endp != NULL) ;
(gdb)
378       if (endp->inBuffer != NULL || FD_ISSET (endp->myFd,&rdSet))
(gdb)
[...]

The ASSERT does not seem to be seen here: endp is NULL...

I checked that assertions are all the same seen, switching:

  char *p = bufferBase (b[0]) ;
  ASSERT (b[0] == cxn->respBuffer) ;

to:

  ASSERT (b[0] == cxn->respBuffer) ;
  char *p = bufferBase (b[0]) ;

and the assert is well recognized in getBanner().



> I think the only way to track down what's going on here is to walk through
> innfeed in gdb and set a lot of breakpoints and try to figure out where
> the buffer initialization is going wrong.

Thanks for the idea (and the explanations given in your previous mail).
I will try to inspect it further tomorrow.

-- 
Julien ÉLIE

« Il y a des sciences bonnes dont l'existence est nécessaire
  et dont la culture est inutile. Telles sont les mathématiques. » (Joseph Joubert) 



More information about the inn-workers mailing list