Overview building errors

Jen Linkova jen at comp.chem.msu.su
Fri Sep 7 09:35:59 UTC 2001


On Thu, Sep 06, 2001 at 10:38:38PM -0400, Roman Gollent wrote:
> When running makehistory -Ox (inn 2.3.2) on a news spool
> that was rsynced from an old news server running inn 1.4
> (read: Collabra) I am running into the following errors:
> Sep  6 17:05:46 smaug makehistory[8323]: [ID 131604 news.error] tradindexed: packgroup cant write to
> /usr/local/news/spool/overview/n/p/m/b/netscape.public.mozilla.builds-NEW.IDX: No such file or directory
> makehistory: Can't write overview data "@050100000049000018110000000000000000@"

If files mentioning in those error messages exist - in spite of
log messages you get - may be it's the case described below.

I have the same error messgaes on my news server. While reading src & running
makehistory under gdb I've found some interesting things.

First, 'No such file or directory' is incorrect. See at storage/ov3/ov3.c,
function OV3packgroup
    if (pwrite(fd, &gh->indexmem[ge->low - ge->base] , nbytes,
               sizeof(INDEXENTRY)*(ge->low - ge->base + delta - 1)) != nbytes) {
        syslog(L_ERROR, "tradindexed: packgroup cant write to %s: %m", newidx);
        OV3closegroup(gh, FALSE);
        GROUPlock(gloc, LOCK_UNLOCK);
        return FALSE;

According to standarts, pwrite returns number of bytes _actually_ written - 
and so its return value may be less than nbytes, but greater than '-1'.
In this case errno is not set. 
In some cases (now it isn't clear for me  depending on what ;-( )
&gh->indexmem[ge->low - ge->base] + nbytes points  
outside the process's allocated address space. 
So, only part of requested data is written, but errno is not set,
and %m is syslog(..) contains some junks and more than meaningless - 
it's confusing...
IMHO, errno should be checked _only_ if function return '-1'.

I'm working on resovling real reasons of this - and i'm not ready yet
for sending bug fixes to inn-bugs... Because I don't know yet
why/when buffer in pwrite() arguments points to incorrect address space.

OS: Owl, kernel 2.2.19 

I've never seen such problem on FreeBSD...

P.S. If Inn developers read this thread - they may help, I hope ;-)

SY, Jen aka Furry

More information about the inn-workers mailing list