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

Julien ÉLIE julien at trigofacile.com
Fri Aug 10 15:13:47 UTC 2007


En réponse à Julien ÉLIE :
> And we finally arrive here in endpoint.c:

I believe there is a problem with priorityList since:


815                       if (ep != NULL)
(gdb) print **priorityList[idx].inBuffer
$48 = {refCount = 2, mem = 0x575000 "", memSize = 8192, dataSize = 0,
  deletable = true, bufferDeletedCbk = 0, bufferDeletedCbkData = 0x0,
  next = 0x0, prev = 0x56e048}
(gdb) n
817                           ep->selectHits *= 0.9 ;
(gdb)
818                           if (selectHit)
(gdb)
820                           else if (readMiss && writeMiss)
(gdb)
824                       if (readyCount > 0 && ep != NULL && FD_ISSET (fd,&eSet))
(gdb)
666               for (idx = 0 ; idx < priorityCount ; idx++)
(gdb)
668                   EndPoint ep = priorityList [idx] ;
(gdb)
669                   bool specialCheck = false ;
(gdb) print **priorityList[idx].inBuffer
Error accessing memory address 0x0: Bad address.
(gdb) print priorityList
$49 = (EndPoint *) 0x56b800
(gdb) print idx
$51 = 1
(gdb) print **priorityList
$52 = {inBuffer = 0x56f280, inBufferIdx = 0, inIndex = 0, inMinLen = 1,
  inAmtRead = 0, inCbk = 0x419bf0 <newArticleCommand>,
  inClientData = 0x5663c0, outBuffer = 0x0, outBufferIdx = 0, outIndex = 0,
  outSize = 0, outAmtWritten = 0, outProgressCbk = 0, outDoneCbk = 0,
  outClientData = 0x0, workCbk = 0, workData = 0x0, myFd = 0, myErrno = 0,
  selectHits = 0}



**priorityList[idx].inBuffer becomes undefined at line 668, so doRead fails just after.

On a news server which works, it contains something like that:

(gdb) print **priorityList[idx].inBuffer
$29 = {refCount = 2, mem = 0x809f138 "ø\224ï·ø\224ï·/rec/aviation", memSize = 256, dataSize = 0, deletable = true, bufferDeletedCbk 
= 0,
  bufferDeletedCbkData = 0x0, next = 0x80b0778, prev = 0x0}

And then, doRead works and I correctly have the banner in inBuffer.

-- 
Julien ÉLIE

« -- Vous croyez qu'on s'est fait rouler, chef ?
  -- P'têt ben qu'oui, p'têt ben qu'non... » (Astérix) 



More information about the inn-workers mailing list