Subject: pkg_delete -O was hanging (under Linux)
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/17/2003 11:15:56
I noticed when doing a "bmake -DFORCE_PKG_REGISTER install" that it would
hang (even for a couple days).

I see that "pkg_delete -O" was hanging under Linux.

I saw this when trying to force reinstall of gcc3 and pkg_install via
pkgsrc.

I was able to fix this problem with doing "pkg_admin rebuild".

Here is a part of the strace (yes, I packaged sysutils/strace).


open("/var/db/pkg/pkgdb.byfile.db", O_RDWR|O_CREAT, 0644) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = -1 ENOSYS (Function not
implemented)
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat64(3, 0xbfffdb98)                  = -1 ENOSYS (Function not
implemented)
fstat(3, {st_mode=S_IFREG|0644, st_size=528384, ...}) = 0
read(3, "b1\5\0\3\0\0\0\0\20\0\0\0\0\0\0\0\0\0\0 \0\0\0", 24) = 24
fstat(3, {st_mode=S_IFREG|0644, st_size=528384, ...}) = 0
brk(0x805d000)                          = 0x805d000
lseek(3, 0, SEEK_SET)                   = 0
read(3, "b1\5\0\3\0\0\0\0\20\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0"..., 4096)
= 4096
lseek(3, 4096, SEEK_SET)                = 4096
read(3, "\1\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\30\0\264\17\364\17\264"...,
4096) = 4096
brk(0x805f000)                          = 0x805f000
***many similar lines skipped ****
lseek(3, 159744, SEEK_SET)              = 159744
read(3, "\'\0\0\0&\0\0\0(\0\0\0\2\0\0\0R\0D\10\300\17\204\17D\17"...,
4096) = 4096
brk(0x80bb000)                          = 0x80bb000
lseek(3, 163840, SEEK_SET)              = 163840
read(3, "(\0\0\0\'\0\0\0w\0\0\0\2\0\0\0R\0(\10\300\17\200\17@\17"...,
4096) = 4096
lseek(3, 487424, SEEK_SET)              = 487424
read(3, "w\0\0\0(\0\0\0\23\0\0\0\2\0\0\0~\0\230\3\300\17|\0178\17"...,
4096) = 4096
brk(0x80bd000)                          = 0x80bd000
lseek(3, 77824, SEEK_SET)               = 77824
read(3, "\23\0\0\0w\0\0\0z\0\0\0\2\0\0\0^\0(\10\320\17\240\17p\17"...,
4096) = 4096
lseek(3, 499712, SEEK_SET)              = 499712
read(3, "z\0\0\0\23\0\0\0{\0\0\0\2\0\0\0b\0,\10\320\17\240\17p\17"...,
4096) = 4096
brk(0x80bf000)                          = 0x80bf000
lseek(3, 503808, SEEK_SET)              = 503808
read(3, "{\0\0\0z\0\0\0u\0\0\0\2\0\0\0\260\0\274\0\304\17\214\17"...,
4096) = 4096
** and hangs here **


Anyways, I don't have the problem anymore. I am just emailing this so it
is archived which may be useful for others. The fix was to do "pkg_admin
rebuild".


I wonder if pkg_install installation via pkgsrc should do the pkg_admin
rebuild no matter what??

   Jeremy C. Reed
   http://bsd.reedmedia.net/