From owner-freebsd-stable@FreeBSD.ORG Sun Apr 20 17:56:24 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 329061065673 for ; Sun, 20 Apr 2008 17:56:24 +0000 (UTC) (envelope-from LukeD@pobox.com) Received: from sasl.smtp.pobox.com (a-sasl-fastnet.sasl.smtp.pobox.com [207.106.133.19]) by mx1.freebsd.org (Postfix) with ESMTP id 089D38FC2F for ; Sun, 20 Apr 2008 17:56:23 +0000 (UTC) (envelope-from LukeD@pobox.com) Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id D7FE95FA2 for ; Sun, 20 Apr 2008 13:38:38 -0400 (EDT) Received: from lukas.is-a-geek.org (pool-71-113-78-181.sttlwa.dsl-w.verizon.net [71.113.78.181]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 39ABE5FA1 for ; Sun, 20 Apr 2008 13:38:37 -0400 (EDT) Date: Sun, 20 Apr 2008 10:38:32 -0700 (PDT) From: Luke Dean X-X-Sender: lukas@border.lukas.is-a-geek.org To: freebsd-stable@freebsd.org Message-ID: <20080420101554.J57244@border.lukas.is-a-geek.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: kvm_open: kvm_nlist: No such file or directory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Luke Dean List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2008 17:56:24 -0000 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); }