pwrite() bug?

Russ Allbery rra at
Sun Mar 31 19:06:43 UTC 2002

Alexey Promokhov <ayp at> writes:
> 27 Mar 2002, Alexey Promokhov wrote:

>  AP> I can do something with gdb, but probably only after Friday, because I'm
>  AP> going now to small travel. ;)

> I'm ready.

> Just tried to debug snapshot of 30/03. First call of pwrite returns a
> number smaller than has been requested, second call returns -1 with
> errno==14. Printed error is:

> Mar 31 03:28:28 thunder makehistory[17697]: tradindexed: packgroup cant write to /usr/local/news/spool/overview/f/r/s/ftn.r50.sysop-NEW.IDX: Bad address

> So, need you any help from me?

I think I found the problem.  It looks like there isn't an article
corresponding to the high water mark of the group, so the old index file
size is smaller than what the packgroup routine calculates.  I think it's
trying to be too smart (it only copies the actual entries rather than
copying the entire old file) as a performance optimization, when packgroup
is not a performance-critical operation.  I'll look at this later today
and try to make it simpler and more reliable.

This was a bug that I already fixed in the new implementation; I thought
that code looked a bit odd.

Russ Allbery (rra at             <>

More information about the inn-bugs mailing list