kvm_open: kvm_nlist: No such file or directory




A few weeks ago I did a source upgrade from 6.2 to 7-STABLE. I didn't "make delete-old" so a bunch of old libraries and such were left lying around causing problems when I rebuilt all my ports. I'd read about some recent improvements to DDB and SCHED_ULE in 7-STABLE, and it's a miserable snowy weekend in Seattle right now, so I decided I'd take this opportunity to update my system to the latest 7-STABLE and get rid of those old libraries properly this time.

Now sysutils/wmmemmon and sysutils/wmcpuload stopped working.
Both die with:
kvm_open: kvm_nlist: No such file or directory
error extracting symbols

I found two PRs for other ports (ascpu and wmcube-gdk) to fix similar problems, but they seem to be related to 8-CURRENT. The solution in both of these cases is to use sysctls instead of using kvm.
PR numbers are 119923 and 120142.

My question is should the existing code work in 7-STABLE or do wmmemmon and wmcpuload need to be changed to use sysctls?
They worked for me for a couple of weeks on 7-STABLE, but like I said, I had old libraries lying around and some of the windowmaker stuff chose to link to them.
I have since cleaned up my system and rebuilt (I believe) everything and now the ports no longer work.

This is what I believe is the offending code snippet from sysutils/wmmemmon's mem_freebsd.c file:
--------------------------------------------------------------
static kvm_t *kvm_data = NULL;
static int pageshift;
static struct nlist nlst[] = { {"_cp_time"}, {"_cnt"}, {0} };

/* initialize function */
void mem_init(void)
{
int pagesize = getpagesize();
pageshift = 0;

while (pagesize > 1) {
pageshift++;
pagesize >>= 1;
}

kvm_data = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");

if (kvm_data == NULL) {
fprintf(stderr, "can't open kernel virtual memory");
exit(1);
}
kvm_nlist(kvm_data, nlst);

if (nlst[0].n_type == 0 || nlst[1].n_type == 0) {
fprintf(stderr, "error extracting symbols");
exit(1);
}

_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: 32 bit ports on an AMD64 system
    ... You've given some of your reasons for using amd64 -- but are your ... you use a different LOCALBASE for 32-bit ports, ... between 32-bit and 64-bit versions of the same libraries depending ... kernel modules is a bit more important to me. ...
    (freebsd-questions)
  • Re: the more build knobs bikeshed
    ... minimum set of libraries as well. ... And it doesn't work with cross building because of its use of LDD. ... Tinybsd uses the binaries on your system rather than building them. ... cooperative ports would work... ...
    (freebsd-arch)
  • Re: Upgrading to 7.0 - stupid requirements
    ... independance from ports. ... The ports still use libraries from the base OS, ... Now you update to FreeBSD 7, ...
    (freebsd-stable)
  • Re: -pthread propagation
    ... but it's shared libraries are not linked with -pthread: ... I assume this should be fixed in ilmbase instead of all dependent ports ... /* On Solaris 2.6 up to 9, the libc exposes a POSIX threads ... interface even if -pthreads is not specified. ...
    (freebsd-hackers)
  • Re: Fast releases demand binary updates.. (Was: Release schedule for 2006 )
    ... > binaries, including X11, KDE, printing, Mozilla, etc worked just fine. ... > Upgrading the ports from there was somewhat annoying, ... libs/apps from pkg_add which are trying to link to libraries installed via ... grab binaries and install them... ...
    (freebsd-current)