merge 167159 487605
tags 167159 fixed-upstream
thanks

On Mon, Nov 11, 2002 at 01:36:51AM +0000, Colin Watson wrote:
> On Wed, Oct 30, 2002 at 10:15:29PM +0000, Mark Brown wrote:
> > Occasionally I find that the mandb database rebuild will lock up,
> > consuming 100% of the CPU, apparently repeatably.  The longest I've let
> > it run like this is over two hours.  The reason it's failing is that the
> > partition with /var/cache/man is full which is reasonable but the error
> > handling could do with some improvement :) .
> [...]
> > write(1, "Processing manual pages under /u"..., 48) =3D 48
> > open("/var/cache/man/index.bt", O_RDONLY) =3D 3
> > open("/var/cache/man/9157", O_WRONLY|O_CREAT|O_TRUNC, 0666) =3D 4
> > fstat64(0x3, 0x7ffff5a8)                =3D 0
> > mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> > =3D 0x30019000
> > read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0051b\0\0\0\10\0\0\20\0\0\t"..., 4096) =
> > =3D 4096
> > fstat64(0x4, 0x7ffff5a8)                =3D 0
> > mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> > =3D 0x3001a000
> > read(3, "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\3\17\320\3\3"..., 4096)=
> >  =3D 4096
> > write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0051b\0\0\0\10\0\0\20\0\0\t"..., 4096)=
> >  =3D -1 ENOSPC (No space left on device)
> 
> It's a fair cop. Looks like xcopy() in src/mandb.c is at least the first
> function at fault; it starts with the comment "Still plenty of error
> handling could be added here", which is clearly accurate. :)

And, indeed, this is the same as Russell's bug #487605 (excluding the
bit I already cloned off for better handling of exit codes in the
maintainer scripts). I've now fixed the part of this bug that lies in
mandb itself upstream:

Thu Dec  4 15:03:08 GMT 2008  Colin Watson  <[EMAIL PROTECTED]>

        Exit as soon as possible if database writes return ENOSPC (Debian
        bug #167159).

        * src/check_mandirs.c (testmandirs, create_db, update_db,
          purge_normal, purge_whatis, check_multi_key, purge_missing):
          Return int rather than short, to make space for -errno.
        * src/mandb.c (update_one_file, update_db_wrapper, mandb,
          process_manpath): Likewise.
        * src/check_mandirs.h (create_db, update_db, purge_missing): Update
          prototypes.

        * src/check_mandirs.c (create_db): Return -errno for database open
          errors other than EACCES and EROFS.
        * src/mandb.c (mandb): Return early on errors from create_db and
          update_db_wrapper. Propagate errors from xcopy as well as
          returning early.
          (process_manpath): Return early on errors from mandb.
          (main): Exit FATAL on errors from process_manpath.

-- 
Colin Watson                                       [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to